viewing:    build.sh     -     view raw:      build.sh

source of: build.sh

#!/bin/bash

function _xmlrpc() {
    cd "$BUILDPATH"
    echo -ne "Installing xmlrpc-c-\033[1m1.33.12\033[0m ... "
    if [[ -d "$BUILDPATH/xmlrpc-c" ]]; then rm -rf xmlrpc-c;fi
    wget https://code.justla.me/sources/xmlrpc.tar.gz --no-check-certificate
    tar -xzf xmlrpc.tar.gz
    cd xmlrpc-c
    ./configure --prefix=/usr --disable-cplusplus >> "${HOME}/build.log" 2>&1
    echo "xmlrpc: continue (configure 50%)?"; #read
    make >> "${HOME}/build.log" 2>&1
    echo "xmlrpc: continue (make 75%)?"; #read
    make install >> "${HOME}/build.log" 2>&1
    echo "xmlrpc: 100%"
    rm "$BUILDPATH/xmlrpc.tar.gz"
}
function _libtorrent() {
    cd "$BUILDPATH"
        echo -ne "Installing libtorrent-\033[1m$LTORRENT\033[0m ... "
        rm -rf xmlrpc-c  
        if [[ -e "$BUILDPATH/libtorrent-${LTORRENT}.tar.gz" ]]; then rm -rf "libtorrent-${LTORRENT}.tar.gz";fi
        wget https://code.justla.me/sources/libtorrent-${LTORRENT}.tar.gz --no-check-certificate
        tar -xzf libtorrent-${LTORRENT}.tar.gz 
        cd "libtorrent-${LTORRENT}"
        sed -i 's/240/40/g' src/protocol/peer_connection_leech.cc
        sed -i 's/if (ticks % 4 == 0)/if (ticks % 1 == 0)/g' src/download/download_wrapper.cc
        ./autogen.sh >> "${HOME}/build.log" 2>&1
        echo "libtorrent: continue (autogen 25%)?"; #read
        ./configure --prefix=/usr >> "${HOME}/build.log" 2>&1
        echo "libtorrent: continue (configure 50%)?"; #read
        make -j"${MAXCPUS}" >> "${HOME}/build.log" 2>&1
        echo "libtorrent: continue (make 75%)?"; #read
        make install >> "${HOME}/build.log" 2>&1
        echo "libtorrent: 100%"
}

function _rtorrent() {
    cd "$BUILDPATH"
        echo -ne "Installing rtorrent-\033[1m$RTVERSION\033[0m ... "
        rm -rf "rtorrent-${RTVERSION}*"
        if [[ -e "$BUILDPATH/rtorrent-${RTVERSION}.tar.gz" ]]; then rm -rf "rtorrent-${RTVERSION}.tar.gz";fi
        wget "https://code.justla.me/sources/rtorrent-${RTVERSION}.tar.gz" --no-check-certificate
        tar -xzf "rtorrent-${RTVERSION}.tar.gz"
        cd "rtorrent-${RTVERSION}"
        ./autogen.sh >> "${HOME}/build.log" 2>&1
        echo "rtorrent: continue (rtorrent autogen 20%)?"; #read
        ./configure --prefix=/usr --with-xmlrpc-c >> "${HOME}/build.log" 2>&1
        echo "rtorrent: continue (configure 40%)?"; #read
        make -j"${MAXCPUS}" >> "${HOME}/build.log" 2>&1
        echo "rtorrent:     continue (make 80%)?"; #read
        make install  >> "${HOME}/build.log" 2>&1
        cd "$BUILDPATH"
        ldconfig
        echo "rtorrent: 100%"
        rm -rf "$BUILDPATH/rtorrent-${RTVERSION}*"
}

RTVERSION=0.9.5
LTORRENT=0.13.5
BUILDPATH=/tmp/
MAXCPUS=2

apt-get -q --assume-yes --force-yes install build-essential automake libtool libncurses5-dev libcurl3 libcurl4-openssl-dev libcrypto++-dev pkg-config zlib1g-dev >> "${HOME}/build.log" 2>&1

_xmlrpc
_libtorrent
_rtorrent

download

Go Home