Skip to content

Instantly share code, notes, and snippets.

@sfan5 sfan5/rtorrent-git.sh
Last active Sep 25, 2019

Embed
What would you like to do?
Compiles rtorrent & libtorrent from git statically linked together
#!/bin/bash -e
LIBTORRENT_BRANCH=master
LIBTORRENT_CONFIG="--disable-debug"
RTORRENT_BRANCH=master
RTORRENT_CONFIG="--disable-debug --enable-ipv6"
# Dependencies on Debian/Ubuntu:
#sudo apt install \
# g++ autoconf libtool pkg-config \
# zlib1g-dev libssl-dev libcurl4-openssl-dev \
# libncurses5-dev libncursesw5-dev
[ -f libtorrent.tar.gz ] || \
wget https://github.com/rakshasa/libtorrent/archive/$LIBTORRENT_BRANCH.tar.gz \
-O libtorrent.tar.gz
[ -d libtorrent ] || {
mkdir libtorrent
tar -xz --strip-components=1 -f libtorrent.tar.gz -C libtorrent
}
cd libtorrent
./autogen.sh
./configure $LIBTORRENT_CONFIG --prefix=/ --disable-shared
make -j2
make DESTDIR=$PWD/_install install
sed 's|^prefix=.*|prefix='$PWD/_install'|' -i ./_install/lib/pkgconfig/libtorrent.pc
cd ..
[ -f rtorrent.tar.gz ] || \
wget https://github.com/rakshasa/rtorrent/archive/$RTORRENT_BRANCH.tar.gz \
-O rtorrent.tar.gz
[ -d rtorrent ] || {
mkdir rtorrent
tar -xz --strip-components=1 -f rtorrent.tar.gz -C rtorrent
}
cd rtorrent
./autogen.sh
PKG_CONFIG_PATH=$PWD/../libtorrent/_install/lib/pkgconfig \
./configure $RTORRENT_CONFIG
make -j2
strip --strip-all ./src/rtorrent
cd ..
echo
echo "Done."
echo "To install rtorrent system-wide run:"
echo " \$ cd rtorrent; sudo make install"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.