diff --git a/build-qycli-php74 b/build-qycli-php74 index fe74244..cfc4b32 100644 --- a/build-qycli-php74 +++ b/build-qycli-php74 @@ -1,54 +1,38 @@ #!/bin/bash -# This is built on ubuntu 21.10 so there are some preparing steps: sed -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' -i /etc/apt/sources.list -if [[ -f /etc/needrestart/needrestart.conf ]]; then - export NEEDRESTART_MODE=a - sed "s+#\$nrconf{restart} = '.*';+\$nrconf{restart} = 'a';+" -i /etc/needrestart/needrestart.conf -fi -apt purge snapd -y && apt autoremove -y -sed -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' -i /etc/apt/sources.list -apt update && apt dist-upgrade -y -sed -re 's/([a-z]{2}\.)?archive.ubuntu.com|security.ubuntu.com/old-releases.ubuntu.com/g' -i /etc/apt/sources.list +mkdir /etc/apt/disabled.apt.conf.d/ +dpkg-divert --divert /etc/apt/disabled.apt.conf.d/99needrestart --rename /etc/apt/apt.conf.d/99needrestart + # Install dependencies apt update && apt upgrade -y -apt -y install build-essential software-properties-common rsync curl wget tar php-pear libxml2-dev pkg-config libcurl4-openssl-dev libssl-dev libpng-dev libjpeg-dev libwebp-dev libmagickwand-dev libzip-dev libargon2-dev libonig-dev libsodium-dev - -# Compile old openssl -#[[ -d /usr/src/qycli/openssl-1.1.1 ]] && rm -rf /usr/src/qycli/openssl-1.1.1 - -#mkdir /usr/src/qycli/openssl-1.1.1 -#cd /usr/src/qycli/openssl-1.1.1 || exit -#opensslOld=$(curl -s https://www.openssl.org/source/ | tac | tac | grep -o "href=\"openssl-1.1.1.*.tar.gz\"" | grep -o "openssl-.*.gz") -#wget -qO "$opensslOld" https://www.openssl.org/source/"$opensslOld" -#tar -zxf "$opensslOld" --strip-components=1 - -#./config --prefix=/opt/openssl-1.1.1 --openssldir=/usr/src/qycli/openssl-1.1.1 -#make -j4 -#make install - -#[[ ! $(echo $PATH | grep 1.1.1) ]] && export PATH=/opt/openssl-1.1.1/bin:${PATH} -#[[ ! $(echo $LD_LIBRARY_PATH | grep 1.1.1) ]] && export LD_LIBRARY_PATH=/opt/openssl-1.1.1/lib:${LD_LIBRARY_PATH} +apt -y install build-essential software-properties-common patchelf rsync curl wget tar php-pear libxml2-dev pkg-config libcurl4-openssl-dev libssl-dev libpng-dev libjpeg-dev libwebp-dev libmagickwand-dev libzip-dev libargon2-dev libonig-dev libsodium-dev # Download PHP php_major_version=7.4 php_version=$(curl -s https://www.php.net/downloads.php | tac | tac | grep "

>/usr/src/qycli/php-"$php_version_short"/alllibs -for lib in $(ldd /usr/local/php"$php_version_short"/sbin/php-fpm | grep -o "/.* "); do - ldd "$lib" | grep -o "/.* " | cut -d ' ' -f 1 >>/usr/src/qycli/php-"$php_version_short"/alllibs +ldd "$install_prefix"/sbin/php-fpm | grep -o "/.* " | cut -d ' ' -f 1 >>"$compile_prefix"/alllibs +for lib in $(ldd "$install_prefix"/sbin/php-fpm | grep -o "/.* "); do + ldd "$lib" | grep -o "/.* " | cut -d ' ' -f 1 >>"$compile_prefix"/alllibs for lib2 in $(ldd "$lib" | grep -o "/.* "); do - ldd "$lib2" | grep -o "/.* " | cut -d ' ' -f 1 >>/usr/src/qycli/php-"$php_version_short"/alllibs + ldd "$lib2" | grep -o "/.* " | cut -d ' ' -f 1 >>"$compile_prefix"/alllibs for lib3 in $(ldd "$lib2" | grep -o "/.* "); do - ldd "$lib3" | grep -o "/.* " | cut -d ' ' -f 1 >>/usr/src/qycli/php-"$php_version_short"/alllibs + ldd "$lib3" | grep -o "/.* " | cut -d ' ' -f 1 >>"$compile_prefix"/alllibs done done done -cd /usr/local/php"$php_version_short"/lib/php/extensions/ || exit +cd "$install_prefix"/lib/php/extensions/ || exit cd "$(ls)" || exit for ext in *; do - ldd "$ext" | grep -o "/.* " | cut -d ' ' -f 1 >>/usr/src/qycli/php-"$php_version_short"/alllibs + ldd "$ext" | grep -o "/.* " | cut -d ' ' -f 1 >>"$compile_prefix"/alllibs for lib in $(ldd "$ext" | grep -o "/.* "); do - ldd "$lib" | grep -o "/.* " | cut -d ' ' -f 1 >>/usr/src/qycli/php-"$php_version_short"/alllibs + ldd "$lib" | grep -o "/.* " | cut -d ' ' -f 1 >>"$compile_prefix"/alllibs for lib2 in $(ldd "$lib" | grep -o "/.* "); do - ldd "$lib2" | grep -o "/.* " | cut -d ' ' -f 1 >>/usr/src/qycli/php-"$php_version_short"/alllibs + ldd "$lib2" | grep -o "/.* " | cut -d ' ' -f 1 >>"$compile_prefix"/alllibs done done done -sort -u /usr/src/qycli/php-"$php_version_short"/alllibs >/usr/src/qycli/php-"$php_version_short"/libssorted +sort -u "$compile_prefix"/alllibs >"$compile_prefix"/libssorted +mkdir -p "$result_volume_dir"/lib/qycli/21.10 while IFS= read -r lib; do - libdir=$(echo /php"$php_version_short"-result"$lib" | grep -o "/.*/") - [[ ! -d $libdir ]] && mkdir -p "$libdir" - rsync -aL "$lib" /php"$php_version_short"-result"$lib" -done