Merge pull request #125 from LAKostis/feature/add-snuffleupagus-ext

added snuffleupagus ext support
pull/126/head
Michele Locati 2020-02-28 00:43:02 +01:00 committed by GitHub
commit 6de943b31a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 2 deletions

View File

@ -54,6 +54,7 @@ rdkafka 5.5 5.6 7.0 7.1 7.2 7.3 7.4
recode 5.5 5.6 7.0 7.1 7.2 7.3 recode 5.5 5.6 7.0 7.1 7.2 7.3
redis 5.5 5.6 7.0 7.1 7.2 7.3 7.4 redis 5.5 5.6 7.0 7.1 7.2 7.3 7.4
shmop 5.5 5.6 7.0 7.1 7.2 7.3 7.4 shmop 5.5 5.6 7.0 7.1 7.2 7.3 7.4
snuffleupagus 7.0 7.1 7.2 7.3 7.4
snmp 5.5 5.6 7.0 7.1 7.2 7.3 7.4 snmp 5.5 5.6 7.0 7.1 7.2 7.3 7.4
soap 5.5 5.6 7.0 7.1 7.2 7.3 7.4 soap 5.5 5.6 7.0 7.1 7.2 7.3 7.4
sockets 5.5 5.6 7.0 7.1 7.2 7.3 7.4 sockets 5.5 5.6 7.0 7.1 7.2 7.3 7.4

View File

@ -55,7 +55,7 @@ getDistroVersion() {
# Output: # Output:
# The PHP numeric Major-Minor version # The PHP numeric Major-Minor version
getPHPMajorMinor() { getPHPMajorMinor() {
php -r '$v = explode(".", PHP_VERSION); echo $v[0] * 100 + $v[1];' php-config --version | awk -F. '{print $1*100+$2}'
} }
# Get the normalized list of already installed PHP modules # Get the normalized list of already installed PHP modules
@ -553,6 +553,13 @@ buildRequiredPackageLists() {
esac esac
fi fi
;; ;;
snuffleupagus@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent pcre"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile pcre-dev"
;;
snuffleupagus@debian)
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile libpcre3-dev"
;;
snmp@alpine) snmp@alpine)
buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent net-snmp-libs" buildRequiredPackageLists_persistent="$buildRequiredPackageLists_persistent net-snmp-libs"
buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile net-snmp-dev" buildRequiredPackageLists_volatile="$buildRequiredPackageLists_volatile net-snmp-dev"
@ -1001,12 +1008,25 @@ getPackageSource() {
installModuleFromSource() { installModuleFromSource() {
printf '### INSTALLING MODULE %s FROM SOURCE CODE ###\n' "$1" printf '### INSTALLING MODULE %s FROM SOURCE CODE ###\n' "$1"
installModuleFromSource_dir="$(getPackageSource "$2")" installModuleFromSource_dir="$(getPackageSource "$2")"
cd "$installModuleFromSource_dir" case "$1" in
snuffleupagus)
cd "$installModuleFromSource_dir/src"
;;
*)
cd "$installModuleFromSource_dir"
;;
esac
phpize phpize
./configure $3 CFLAGS="${4:-}" ./configure $3 CFLAGS="${4:-}"
make -j$(nproc) install make -j$(nproc) install
cd - >/dev/null cd - >/dev/null
docker-php-ext-enable "$1" docker-php-ext-enable "$1"
case "$1" in
snuffleupagus)
cp -a "$installModuleFromSource_dir/config/default.rules" "$PHP_INI_DIR/conf.d/snuffleupagus.rules"
printf 'sp.configuration_file=%s\n' "$PHP_INI_DIR/conf.d/snuffleupagus.rules" >>"$PHP_INI_DIR/conf.d/docker-php-ext-snuffleupagus.ini"
;;
esac
} }
# Install a PECL PHP module given its handle # Install a PECL PHP module given its handle
@ -1413,6 +1433,10 @@ for PHP_MODULE_TO_INSTALL in $PHP_MODULES_TO_INSTALL; do
MODULE_SOURCE_CONFIGOPTIONS=--enable-igbinary MODULE_SOURCE_CONFIGOPTIONS=--enable-igbinary
MODULE_SOURCE_CFLAGS='-O2 -g' MODULE_SOURCE_CFLAGS='-O2 -g'
;; ;;
snuffleupagus)
MODULE_SOURCE="https://codeload.github.com/jvoisin/snuffleupagus/tar.gz/v0.5.0"
MODULE_SOURCE_CONFIGOPTIONS=--enable-snuffleupagus
;;
esac esac
if test -n "$MODULE_SOURCE"; then if test -n "$MODULE_SOURCE"; then
installModuleFromSource "$PHP_MODULE_TO_INSTALL" "$MODULE_SOURCE" "$MODULE_SOURCE_CONFIGOPTIONS" "$MODULE_SOURCE_CFLAGS" installModuleFromSource "$PHP_MODULE_TO_INSTALL" "$MODULE_SOURCE" "$MODULE_SOURCE_CONFIGOPTIONS" "$MODULE_SOURCE_CFLAGS"