Advertisement
Guest User

RTbuild-curl-cares.sh

a guest
Oct 18th, 2019
957
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.83 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. MAIN()
  4. {
  5.  
  6.         installDepends
  7.         getSources
  8.  
  9.         makeOpenSSL
  10.         makeC-ares
  11.         makeCurl
  12.  
  13.         makeXMLRPC-c
  14.         makeLibTorrent
  15.         makeRTorrent
  16. }
  17.  
  18. function _exitIfFailed()
  19. {
  20.         if [ $1 -ne 0 ]
  21.         then
  22.                 exit -1
  23.         fi
  24. }
  25.  
  26. function installDepends()
  27. {
  28.         apt-get -y -q install git build-essential automake libtool libcppunit-dev libsigc++-2.0-dev libncurses-dev libxml2-dev pkg-config software-properties-common
  29.  
  30.         _exitIfFailed $?
  31. }
  32.  
  33. function getSources()
  34. {
  35.         # Getting Ducks in a row, change versions herer
  36.  
  37.         git clone git://git.openssl.org/openssl.git
  38.  
  39.         git clone https://github.com/c-ares/c-ares.git
  40.  
  41.         git clone https://github.com/curl/curl.git
  42.  
  43.         git clone https://github.com/mirror/xmlrpc-c
  44.  
  45.         wget -O - http://rtorrent.net/downloads/libtorrent-0.13.8.tar.gz |tar xz
  46.         mv libtorrent-0.13.8 libtorrent
  47.  
  48.         wget -O - http://rtorrent.net/downloads/rtorrent-0.9.8.tar.gz| tar zx
  49.         mv rtorrent-0.9.8 rtorrent
  50.  
  51.         result=$(test -d openssl && test -d c-ares && test -d curl && test -d curl && test -d xmlrpc-c && test -d libtorrent && test -d rtorrent ; echo $? )
  52.  
  53.  
  54.         _exitIfFailed $result
  55. }
  56.  
  57.  
  58. function makeOpenSSL()
  59. {
  60.         cd openssl
  61.  
  62.         ./config -fPIC
  63.         make -j2 && make install
  64.  
  65.         _exitIfFailed $?
  66.  
  67.         cd ..
  68. }
  69.  
  70. function makeC-ares()
  71. {
  72.         cd c-ares
  73.         ./buildconf
  74.         ./configure --enable-nonblocking --enable-shared
  75.         make -j2 && make install
  76.  
  77.         _exitIfFailed $?
  78.  
  79.         cd ..
  80. }
  81.  
  82. function makeCurl()
  83. {
  84.         cd curl
  85.  
  86.         ./buildconf
  87.         ./configure --enable-ares
  88.         make -j2  && make install
  89.  
  90.         _exitIfFailed $?
  91.  
  92.         cd ..
  93. }
  94.  
  95. function makeXMLRPC-c()
  96. {
  97.         cd xmlrpc-c/advanced
  98.  
  99.         ./configure -disable-wininet-client  --disable-libwww-client  --enable-abyss-server  --disable-cplusplus  --disable-abyss-threads  --disable-cgi-server  --with-libwww-ssl
  100.  
  101.         make -j2 && make install
  102.  
  103.  
  104.         _exitIfFailed $?
  105.  
  106.         cd ../..
  107. }
  108.  
  109. function makeLibTorrent
  110. {
  111.         cd libtorrent
  112.  
  113.         ./autogen.sh
  114.         ./configure --with-posix-fallocate --disable-debug
  115.         make -j2 && make install
  116.  
  117.  
  118.         _exitIfFailed $?
  119.  
  120.         cd ..
  121. }
  122.  
  123. function makeRTorrent()
  124. {
  125.  
  126.         cd rtorrent
  127.  
  128.         ./autogen.sh
  129.         ./configure --disable-debug  --with-xmlrpc-c
  130.  
  131.         make -j2 && make install
  132.  
  133.         result=$?
  134.  
  135.         ldconfig
  136.  
  137.          _exitIfFailed $?
  138.  
  139.         cd ..
  140. }
  141.  
  142.  
  143. ### Body
  144.  
  145.         exec &> >(tee -a BUILD_LOG.$$)
  146.  
  147.         mkdir ~/WorkingDirectory
  148.         cd ~/WorkingDirectory
  149.  
  150.         MAIN
  151.  
  152.         rtorrent -h |grep version
  153.         ldd /usr/local/bin/rtorrent
  154.  
  155.         echo "Complete"
  156. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement