From b289f2d7e9713a4350b19474ace509c3be9cf759 Mon Sep 17 00:00:00 2001 From: Minh-Quan TRAN Date: Wed, 18 Dec 2019 16:01:52 +0100 Subject: [PATCH] handle alpine for kafka --- data/supported-extensions | 1 + install-php-extensions | 17 ++++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/data/supported-extensions b/data/supported-extensions index 96cb068..00bca06 100644 --- a/data/supported-extensions +++ b/data/supported-extensions @@ -42,6 +42,7 @@ pgsql 5.6 7.0 7.1 7.2 7.3 7.4 protobuf 5.6 7.0 7.1 7.2 7.3 7.4 pspell 5.6 7.0 7.1 7.2 7.3 7.4 pthreads 5.6 7.0 +rdkafka 7.0 7.1 7.2 7.3 7.4 recode 5.6 7.0 7.1 7.2 7.3 redis 5.6 7.0 7.1 7.2 7.3 7.4 shmop 5.6 7.0 7.1 7.2 7.3 7.4 diff --git a/install-php-extensions b/install-php-extensions index 50206dd..f2af355 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -902,9 +902,20 @@ installPECLModule () { fi ;; rdkafka) - if test ! -z "$(apt-cache show librdkafka++1 | grep -E '^Version: 0.9')"; then - installPECLModule_actual="$2-3.1.3" - fi + case "$(getDistro)" in + alpine) + # lowest version on alpine is 0.9 + if test ! -z "$(apk search librdkafka | grep -E '^librdkafka-0.9')"; then + installPECLModule_actual="$2-3.1.3" + fi + ;; + debian) + # lowest version on debian is 0.8 (jessie), 0.9 (stretch) + if test ! -z "$(apt-cache show librdkafka++1 | grep -E -e '^Version: 0.9' -e '^Version: 0.8')"; then + installPECLModule_actual="$2-3.1.3" + fi + ;; + esac ;; redis) if test $1 -le 506; then