2015-10-05 20:30:26 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# In this configuration, the following dependent libraries are compiled:
|
|
|
|
#
|
|
|
|
# * zlib
|
|
|
|
# * c-ares
|
|
|
|
# * expat
|
|
|
|
# * sqlite3
|
|
|
|
# * openSSL
|
|
|
|
# * libssh2
|
|
|
|
|
2023-12-23 17:31:24 +01:00
|
|
|
#IMPORTANT: Require install gcc make
|
|
|
|
|
2015-10-05 20:30:26 +02:00
|
|
|
#COMPILER AND PATH
|
|
|
|
PREFIX=/opt/aria2/build_libs
|
|
|
|
C_COMPILER="gcc"
|
|
|
|
CXX_COMPILER="g++"
|
|
|
|
|
2016-05-04 23:37:45 +02:00
|
|
|
#CHECK TOOL FOR DOWNLOAD
|
|
|
|
aria2c --help > /dev/null
|
|
|
|
if [ "$?" -eq 0 ] ; then
|
|
|
|
DOWNLOADER="aria2c --check-certificate=false"
|
|
|
|
else
|
|
|
|
DOWNLOADER="wget -c"
|
|
|
|
fi
|
|
|
|
|
2015-10-05 20:30:26 +02:00
|
|
|
## DEPENDENCES ##
|
2023-12-23 17:31:24 +01:00
|
|
|
ZLIB=https://www.zlib.net/zlib-1.3.tar.gz
|
|
|
|
OPENSSL=https://www.openssl.org/source/openssl-1.1.1w.tar.gz
|
|
|
|
EXPAT=https://github.com/libexpat/libexpat/releases/download/R_2_5_0/expat-2.5.0.tar.bz2
|
|
|
|
SQLITE3=https://www.sqlite.org/2023/sqlite-autoconf-3440200.tar.gz
|
|
|
|
C_ARES=https://c-ares.org/download/c-ares-1.24.0.tar.gz
|
|
|
|
SSH2=https://libssh2.org/download/libssh2-1.11.0.tar.gz
|
2015-10-05 20:30:26 +02:00
|
|
|
|
|
|
|
## CONFIG ##
|
|
|
|
BUILD_DIRECTORY=/tmp/
|
|
|
|
|
|
|
|
## BUILD ##
|
|
|
|
cd $BUILD_DIRECTORY
|
|
|
|
#
|
|
|
|
# zlib build
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $ZLIB
|
2023-12-23 17:31:24 +01:00
|
|
|
tar zxvf zlib-1.3.tar.gz
|
|
|
|
cd zlib-1.3/
|
2015-10-05 20:30:26 +02:00
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER" CXX="$CXX_COMPILER" ./configure --prefix=$PREFIX --static
|
|
|
|
make
|
|
|
|
make install
|
2016-10-09 13:18:23 +02:00
|
|
|
#
|
2015-10-05 20:30:26 +02:00
|
|
|
# expat build
|
|
|
|
cd ..
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $EXPAT
|
2023-12-23 17:31:24 +01:00
|
|
|
tar jxvf expat-2.5.0.tar.bz2
|
|
|
|
cd expat-2.5.0/
|
2016-03-14 17:01:56 +01:00
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER" CXX="$CXX_COMPILER" ./configure --prefix=$PREFIX --enable-static --enable-shared
|
2015-10-05 20:30:26 +02:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
# c-ares build
|
|
|
|
cd ..
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $C_ARES
|
2023-12-23 17:31:24 +01:00
|
|
|
tar zxvf c-ares-1.24.0.tar.gz
|
|
|
|
cd c-ares-1.24.0/
|
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER" CXX="$CXX_COMPILER" ./configure --prefix=$PREFIX --disable-tests --enable-static --disable-shared
|
2015-10-05 20:30:26 +02:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
# Openssl build
|
|
|
|
cd ..
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $OPENSSL
|
2023-12-23 17:31:24 +01:00
|
|
|
tar zxvf openssl-1.1.1w.tar.gz
|
|
|
|
cd openssl-1.1.1w/
|
2016-02-18 21:43:18 +01:00
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER" CXX="$CXX_COMPILER" ./Configure --prefix=$PREFIX linux-x86_64 shared
|
2015-10-05 20:30:26 +02:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
# sqlite3
|
|
|
|
cd ..
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $SQLITE3
|
2023-12-23 17:31:24 +01:00
|
|
|
tar zxvf sqlite-autoconf-3440200.tar.gz
|
|
|
|
cd sqlite-autoconf-3440200/
|
2016-02-18 21:43:18 +01:00
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER" CXX="$CXX_COMPILER" ./configure --prefix=$PREFIX --enable-static --enable-shared
|
2015-10-05 20:30:26 +02:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
# libssh2
|
|
|
|
cd ..
|
2016-05-04 23:37:45 +02:00
|
|
|
$DOWNLOADER $SSH2
|
2023-12-23 17:31:24 +01:00
|
|
|
tar zxvf libssh2-1.11.0.tar.gz
|
|
|
|
cd libssh2-1.11.0/
|
2015-10-17 16:55:37 +02:00
|
|
|
rm -rf $PREFIX/lib/pkgconfig/libssh2.pc
|
|
|
|
PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig/ LD_LIBRARY_PATH=$PREFIX/lib/ CC="$C_COMPILER" CXX="$CXX_COMPILER" ./configure --without-libgcrypt --with-openssl --without-wincng --prefix=$PREFIX --enable-static --disable-shared
|
2015-10-05 20:30:26 +02:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
#
|
|
|
|
#cleaning
|
|
|
|
cd ..
|
|
|
|
rm -rf c-ares*
|
|
|
|
rm -rf sqlite-autoconf*
|
|
|
|
rm -rf zlib-*
|
|
|
|
rm -rf expat-*
|
|
|
|
rm -rf openssl-*
|
|
|
|
rm -rf libssh2-*
|
|
|
|
#
|
|
|
|
echo "finished!"
|