From 821cc51fc2c88387506eec6108b225d794698ab5 Mon Sep 17 00:00:00 2001 From: Quan TRAN Date: Wed, 18 Dec 2019 13:53:29 +0100 Subject: [PATCH 1/6] Update install-php-extensions --- install-php-extensions | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/install-php-extensions b/install-php-extensions index 215383c..f337860 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -41,6 +41,22 @@ getDistro () { fi } +# Get the distribution name with version +# +# Output: +# alpine|debian +getDistroVersion () { + getDistro_version_id='' + if test -r /etc/os-release; then + getDistro_version_id="$(cat /etc/os-release | grep -E ^VERSION_ID= | cut -d = -f 2)" + fi + if test -n "$getDistro_version_id"; then + printf '%s' "$(getDistro)$getDistro_version_id" + else + printf '%s' '' + fi +} + # Get the PHP Major-Minor version as an integer value, in format MMmm (example: 506 for PHP 5.6.15) # # Output: @@ -522,7 +538,13 @@ buildRequiredPackageLists () { ;; zip@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzip4 libmbedtls1?" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev libssl-dev libzip-dev libbz2-dev libmbedtls-dev zlib1g-dev" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev libzip-dev libbz2-dev libmbedtls-dev zlib1g-dev" + if test -z "$(apt-cache search libssl1.0 | grep -E ^libssl)"; then + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssl-dev" + else + # Debian 9, uses libssl1.0 instead of libssl, due to conflict with libssh-dev + buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libssl1.0-dev" + fi ;; esac done @@ -620,6 +642,9 @@ expandPackagesToBeInstalled () { # $@: the list of APT/APK packages to be installed installRequiredPackages () { printf '### INSTALLING REQUIRED PACKAGES ###\n' + printf 'PACKAGES_PERSISTENT:\n%s\n' "$PACKAGES_PERSISTENT" + printf 'PACKAGES_VOLATILE:\n%s\n' "$PACKAGES_VOLATILE" + case "$(getDistro)" in alpine) apk add $PACKAGES_PERSISTENT $PACKAGES_VOLATILE From b97c7db893f6d994ef4f47977329cbbb0ba8b46c Mon Sep 17 00:00:00 2001 From: Quan TRAN Date: Wed, 18 Dec 2019 14:39:02 +0100 Subject: [PATCH 2/6] Update install-php-extensions --- install-php-extensions | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/install-php-extensions b/install-php-extensions index f337860..280076a 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -41,22 +41,6 @@ getDistro () { fi } -# Get the distribution name with version -# -# Output: -# alpine|debian -getDistroVersion () { - getDistro_version_id='' - if test -r /etc/os-release; then - getDistro_version_id="$(cat /etc/os-release | grep -E ^VERSION_ID= | cut -d = -f 2)" - fi - if test -n "$getDistro_version_id"; then - printf '%s' "$(getDistro)$getDistro_version_id" - else - printf '%s' '' - fi -} - # Get the PHP Major-Minor version as an integer value, in format MMmm (example: 506 for PHP 5.6.15) # # Output: From b509412481051244e03a385f7fd68c22da200ff3 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 19 Dec 2019 16:06:25 +0100 Subject: [PATCH 4/6] Fix volatile/persistent libraries of ZIP extension --- install-php-extensions | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-php-extensions b/install-php-extensions index 280076a..ba24d60 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -527,7 +527,7 @@ buildRequiredPackageLists () { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssl-dev" else # Debian 9, uses libssl1.0 instead of libssl, due to conflict with libssh-dev - buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libssl1.0-dev" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssl1.0-dev" fi ;; esac From 6ee28220f3fd8d2e9ff8e8aed311c5a5ff5c2760 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 19 Dec 2019 16:06:42 +0100 Subject: [PATCH 5/6] Improve message about packages to be installed --- install-php-extensions | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install-php-extensions b/install-php-extensions index ba24d60..a38e9ff 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -626,8 +626,8 @@ expandPackagesToBeInstalled () { # $@: the list of APT/APK packages to be installed installRequiredPackages () { printf '### INSTALLING REQUIRED PACKAGES ###\n' - printf 'PACKAGES_PERSISTENT:\n%s\n' "$PACKAGES_PERSISTENT" - printf 'PACKAGES_VOLATILE:\n%s\n' "$PACKAGES_VOLATILE" + printf '# Packages to be kept after installation: %s\n' "$PACKAGES_PERSISTENT" + printf '# Packages to be used only for installation: %s\n' "$PACKAGES_VOLATILE" case "$(getDistro)" in alpine) From f8313949ef70711bbb82a2ac519ee71f37644807 Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Thu, 19 Dec 2019 16:17:29 +0100 Subject: [PATCH 6/6] Simplify handling of libssl-dev on Debian Test: -STOP- --- install-php-extensions | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/install-php-extensions b/install-php-extensions index a38e9ff..b897fe3 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -181,9 +181,19 @@ buildRequiredPackageLists () { buildRequiredPackageLists_volatile='' buildRequiredPackageLists_distro="$(getDistro)" buildRequiredPackageLists_phpv=$1 - if test "$buildRequiredPackageLists_distro" = 'alpine'; then - buildRequiredPackageLists_volatile="$PHPIZE_DEPS" - fi + case "$buildRequiredPackageLists_distro" in + alpine) + buildRequiredPackageLists_volatile="$PHPIZE_DEPS" + ;; + debian) + if test -n "$(apt-cache search libssl1.0 | grep -E ^libssl1\.0)"; then + # Debian 9, uses libssl1.0 instead of libssl, due to conflict with libssh-dev + buildRequiredPackageLists_libssldev='libssl1.0-dev' + else + buildRequiredPackageLists_libssldev='libssl-dev' + fi + ;; + esac while :; do if test $# -lt 2; then break @@ -326,7 +336,7 @@ buildRequiredPackageLists () { buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libressl-dev cyrus-sasl-dev" ;; mongo@debian) - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssl-dev libsasl2-dev" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile $buildRequiredPackageLists_libssldev libsasl2-dev" ;; mongodb@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent icu-libs libsasl snappy" @@ -339,7 +349,7 @@ buildRequiredPackageLists () { ;; mongodb@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libsnappy1v5" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev libsasl2-dev libsnappy-dev libssl-dev zlib1g-dev" + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libicu-dev libsasl2-dev libsnappy-dev $buildRequiredPackageLists_libssldev zlib1g-dev" ;; mssql@alpine) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent freetds" @@ -522,13 +532,7 @@ buildRequiredPackageLists () { ;; zip@debian) buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent libzip4 libmbedtls1?" - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev libzip-dev libbz2-dev libmbedtls-dev zlib1g-dev" - if test -z "$(apt-cache search libssl1.0 | grep -E ^libssl)"; then - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssl-dev" - else - # Debian 9, uses libssl1.0 instead of libssl, due to conflict with libssh-dev - buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libssl1.0-dev" - fi + buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile cmake gnutls-dev $buildRequiredPackageLists_libssldev libzip-dev libbz2-dev libmbedtls-dev zlib1g-dev" ;; esac done