Rechercher dans ce blog

Affichage des articles dont le libellé est compile. Afficher tous les articles
Affichage des articles dont le libellé est compile. Afficher tous les articles

lundi 19 novembre 2012

install transmission 2.7.3 on ubuntu hardy 8.04

Préparer ubuntu

sudo apt-get install build-essential automake autoconf libtool pkg-config intltool libcurl4-openssl-dev libglib2.0-dev libevent-dev (libminiupnpc-dev libminiupnpc5 libappindicator-dev)

*** Compiler libevent >= 2.0.10

http://libevent.org/

tar xvf libevent-2.0.20-stable.tar

cd libevent-2.0.20-stable

./configure

make

make verify

make install

libevent s’installe dans /usr/local/lib alors que transmission la veut dans /usr/lib

Solutions :

1 - LD_LIBRARY_PATH=”/usr/local/lib” transmission-daemon -h

2 - ln -s /usr/local/lib/libevent-2.0.so.5 /usr/lib/libevent-2.0.so.5

ldd /usr/local/bin/transmission-daemon

libevent-2.0.so.5 => /usr/lib/libevent-2.0.so.5 (0xb76e8000)

*** Compiler transmission

tar xvjf transmission-2.73.tar.bz2

./configure —disable-gtk —disable-mac —disable—cli

make -s

make install

Un fichier de configuration est crée au premier lancement du daemon dans ~/.config//transmission-daemon/settings.json

La blocklist peut être mise dans ~/.config/transmission-daemon/blocklist/

au format bluetack : http://www.bluetack.co.uk/config/level1.gz

Script de démarrage pour lancer transmission en tant que mldonkey avec mise à jour de la blocklist et rotation du logfile

#!/bin/sh

### BEGIN INIT INFO

# Provides: transmission-daemon

# Required-Start: networking

# Required-Stop: networking

# Default-Start: 2 3 5

# Default-Stop: 0 1 6

# Short-Description: Start the transmission BitTorrent daemon client.

### END INIT INFO

# The name of the user that should run Transmission.

# It's RECOMENDED to run Transmission in it's own user,

# by default, this is set to 'transmission'.

# For the sake of security you shouldn't set a password

# on this user

USERNAME=mldonkey

# The folder where Transmission stores the config & web files.

# ONLY change this you have it at a non-default location

TRANSMISSION_HOME="/home/mldonkey/.config/transmission-daemon"

TRANSMISSION_WEB_HOME="/usr/local/share/transmission/web"

#

# The arguments passed on to transmission-daemon.

LOGFILE="/home/mldonkey/.config/transmission-daemon/transmission-daemon.log"

TRANSMISSION_ARGS="--logfile $LOGFILE --log-info"

BL_DIR="/home/mldonkey/.config/transmission-daemon/blocklists"

BL_URL="http://www.bluetack.co.uk/config/level1.gz"

# ----- END OF CONFIGURATION -----

#

PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

DESC="bittorrent client"

NAME=transmission-daemon

DAEMON=$(which $NAME)

PIDFILE=/var/run/$NAME.pid

SCRIPTNAME=/etc/init.d/$NAME

# Exit if the binary is not installed

[ -x "$DAEMON" ] || exit 0

#

# Function that starts the daemon/service

#

rotate_logfile() {

if [ -f "${LOGFILE}" ]; then

mv "${LOGFILE}" "${LOGFILE}.last" 1> /dev/null 2>&1

fi

touch "${LOGFILE}"

chmod 666 "${LOGFILE}"

}

# Download a fresh blocklist if there isn't one or current one is over four days old

refresh_blocklist() {

find "${BL_DIR}" -mtime +4 -type f -name "level1" -exec /bin/rm {} \; 1>> "${LOGFILE}" 2>&1

if [ ! -f "${BL_DIR}/level1" ]; then

wget -q -O "${BL_DIR}/level1.gz" "${BL_URL}" 1>> "${LOGFILE}" 2>&1

if [ -f "${BL_DIR}/level1.gz" ]; then

/bin/gunzip "${BL_DIR}/level1.gz" 1>> "${LOGFILE}" 2>&1

if [ $? -eq 0 ]; then

chmod go+r "${BL_DIR}/level1" 1>> "${LOGFILE}" 2>&1

else

rm -f "${BL_DIR}/level1*" 1>> "${LOGFILE}" 2>&1

fi

fi

fi

}

do_start()

{

# Export the configuration/web directory, if set

if [ -n "$TRANSMISSION_HOME" ]; then

export TRANSMISSION_HOME

fi

if [ -n "$TRANSMISSION_WEB_HOME" ]; then

export TRANSMISSION_WEB_HOME

fi

# Return

# 0 if daemon has been started

# 1 if daemon was already running

# 2 if daemon could not be started

start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \

--exec $DAEMON --background --test -- -f $TRANSMISSION_ARGS > /dev/null \

|| return 1

start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \

--exec $DAEMON --background -- -f $TRANSMISSION_ARGS \

|| return 2

}

#

# Function that stops the daemon/service

#

do_stop()

{

# Return

# 0 if daemon has been stopped

# 1 if daemon was already stopped

# 2 if daemon could not be stopped

# other if a failure occurred

start-stop-daemon --stop --quiet --retry=TERM/10/KILL/5 --pidfile $PIDFILE --exec $DAEMON

RETVAL="$?"

[ "$RETVAL" = 2 ] && return 2

# Wait for children to finish too if this is a daemon that forks

# and if the daemon is only ever run from this initscript.

# If the above conditions are not satisfied then add some other code

# that waits for the process to drop all resources that could be

# needed by services started subsequently. A last resort is to

# sleep for some time.

start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON

[ "$?" = 2 ] && return 2

# Many daemons don't delete their pidfiles when they exit.

rm -f $PIDFILE

return "$RETVAL"

}

case "$1" in

start)

echo "Starting $DESC" "$NAME..."

rotate_logfile

case "$?" in

0) echo " Rotating logfile succeeded" ;;

*) echo " Rotating logfile failed" ;;

esac

refresh_blocklist

case "$?" in

0) echo " Refreshing blocklist succeeded" ;;

*) echo " Refreshing blocklist failed" ;;

esac

do_start

case "$?" in

0|1) echo " Starting $DESC $NAME succeeded" ;;

*) echo " Starting $DESC $NAME failed" ;;

esac

;;

stop)

echo "Stopping $DESC $NAME..."

do_stop

case "$?" in

0|1) echo " Stopping $DESC $NAME succeeded" ;;

*) echo " Stopping $DESC $NAME failed" ;;

esac

;;

restart|force-reload)

#

# If the "reload" option is implemented then remove the

# 'force-reload' alias

#

echo "Restarting $DESC $NAME..."

do_stop

case "$?" in

0|1)

do_start

case "$?" in

0|1) echo " Restarting $DESC $NAME succeeded" ;;

*) echo " Restarting $DESC $NAME failed: couldn't start $NAME" ;;

esac

;;

*)

echo " Restarting $DESC $NAME failed: couldn't stop $NAME" ;;

esac

;;

*)

echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2

exit 3

;;

esac


lundi 12 décembre 2011

ffmpeg compile && install mac os x

Prerequisites: LAME

MP3 is the audio codec most often used with Flash video, so you will need an MP3 encoder. FFmpeg doesn't include one, but it will use LAME, which creates good quality audio files, if you install it. Header files will be needed during the compile, so it is not enough to install a prebuilt binary using a package manager. Instead follow these directions to compile it from source:

Start by creating a working directory:

mkdir ~/lame
cd ~/lame

On a good day you can get the latest source code release of LAME from Sourceforge. The file you want will be named lame-3.97.tar.gz or something similar.

After downloading and unpacking the source or checking it out from CVS, change to the main directory and then enter the three commands which are typically used to build open source projects:

cd lame-3.97
./configure
make
sudo make install

First create a working directory:

mkdir ~/ffmpeg
cd ~/ffmpeg

The up-to-date version of FFmpeg generally compiles cleanly, and that is the version you usually will want:

svn checkout svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
cd ffmpeg

Next, configure and make

./configure --enable-libmp3lame --enable-shared \
  --disable-mmx --arch=x86_64
make
sudo make install

The --disable-mmx flag is not required on a PowerPC. If you leave it out on an Intel Mac, you will probably get a compile error, but it's worth trying since it will provide a speed boost.