summaryrefslogtreecommitdiffstats
path: root/php-pecl-rdkafka6.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-rdkafka6.spec')
-rw-r--r--php-pecl-rdkafka6.spec115
1 files changed, 74 insertions, 41 deletions
diff --git a/php-pecl-rdkafka6.spec b/php-pecl-rdkafka6.spec
index 99f38b5..18c157f 100644
--- a/php-pecl-rdkafka6.spec
+++ b/php-pecl-rdkafka6.spec
@@ -1,14 +1,17 @@
# remirepo/fedora spec file for php-pecl-rdkafka6
#
-# Copyright (c) 2015-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2015-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
+
+# use library installed in /opt
+%bcond_without move_to_opt
+
%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-rdkafka
+%scl_package php-pecl-rdkafka6
%endif
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
@@ -16,38 +19,47 @@
%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
%global ini_name 40-%{pecl_name}.ini
+%if %{with move_to_opt}
+# Disable RPATH check
+%global __arch_install_post /bin/true
+%global __brp_check_rpaths /bin/true
+
+%global buildver %(PKG_CONFIG_PATH=/opt/%{?vendeur:%{vendeur}/}librdkafka/%{_lib}/pkgconfig pkg-config --silence-errors --modversion rdkafka 2>/dev/null || echo 65536)
+%else
%global buildver %(pkg-config --silence-errors --modversion rdkafka 2>/dev/null || echo 65536)
+%endif
-%global upstream_version 6.0.2
+%global upstream_version 6.0.3
#global upstream_prever RC2
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%global _configure ../%{sources}/configure
Summary: Kafka client based on librdkafka
-Name: %{?sub_prefix}php-pecl-%{pecl_name}6
+Name: %{?scl_prefix}php-pecl-%{pecl_name}6
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 4%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
License: MIT
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
-BuildRequires: librdkafka1php-devel >= 1.6
+%if %{with move_to_opt}
+BuildRequires: %{?vendeur:%{vendeur}-}librdkafka-devel >= 2.2
+Requires: %{?vendeur:%{vendeur}-}librdkafka%{?_isa} >= %{buildver}
+%else
+BuildRequires: librdkafka-devel >= 1.4
+%endif
BuildRequires: %{?scl_prefix}php-devel >= 7.0
BuildRequires: %{?scl_prefix}php-pear
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
-Requires: librdkafka1php%{?_isa} >= %{buildver}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version}
Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version}
-%if "%{?scl_prefix}" != "%{?sub_prefix}"
-Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release}
-Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release}
-%endif
%if 0%{?fedora} >= 36 || 0%{?rhel} >= 9 || "%{php_version}" >= "8.1"
Obsoletes: %{?scl_prefix}php-pecl-%{pecl_name} < 5
@@ -64,18 +76,10 @@ Obsoletes: %{?scl_prefix}php-pecl-%{pecl_name}4 < 5
Provides: %{?scl_prefix}php-pecl-%{pecl_name}4 = %{version}-%{release}
Provides: %{?scl_prefix}php-pecl-%{pecl_name}4%{?_isa} = %{version}-%{release}
-%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel}
-# Other third party repo stuff
-%if "%{php_version}" > "7.4"
-Obsoletes: php74-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.0"
-Obsoletes: php80-pecl-%{pecl_name} <= %{version}
-%endif
-%if "%{php_version}" > "8.1"
-Obsoletes: php81-pecl-%{pecl_name} <= %{version}
-%endif
+%if %{with move_to_opt}
+%{?filter_requires_in: %filter_requires_in %{_libdir}/.*\.so$}
%endif
+%{?filter_setup}
%description
@@ -86,14 +90,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
-mv %{pecl_name}-%{upstream_version}%{?upstream_prever} NTS
# Don't install tests
sed -e 's/role="test"/role="src"/' \
%{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \
-i package.xml
-cd NTS
+cd %{sources}
# Sanity check, really often broken
extver=$(sed -n '/#define PHP_RDKAFKA_VERSION/{s/.* "//;s/".*$//;p}' php_rdkafka.h)
if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
@@ -102,9 +105,10 @@ if test "x${extver}" != "x%{upstream_version}%{?upstream_prever}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
# Duplicate source tree for NTS / ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Create configuration file
@@ -117,19 +121,37 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+%if %{with move_to_opt}
+# not yet used
+export PKG_CONFIG_PATH=/opt/%{?vendeur:%{vendeur}/}librdkafka/%{_lib}/pkgconfig
+%endif
+
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
- --with-php-config=%{_bindir}/php-config \
- --with-rdkafka
+ --with-php-config=%{__phpconfig} \
+ --with-libdir=%{_lib} \
+%if %{with move_to_opt}
+ --with-rdkafka=/opt/%{?vendeur:%{vendeur}/}librdkafka
+%else
+ --with-rdkafka
+%endif
+
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
- --with-php-config=%{_bindir}/zts-php-config \
- --with-rdkafka
+ --with-php-config=%{__ztsphpconfig} \
+ --with-libdir=%{_lib} \
+%if %{with move_to_opt}
+ --with-rdkafka=/opt/%{?vendeur:%{vendeur}/}librdkafka
+%else
+ --with-rdkafka
+%endif
+
make %{?_smp_mflags}
%endif
@@ -153,7 +175,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
# Documentation
for i in $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
-do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
+do install -Dpm 644 %{sources}/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
@@ -178,14 +200,12 @@ fi
%check
-cd NTS
: Minimal load test for NTS extension
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
--modules | grep '^%{pecl_name}$'
%if %{with_zts}
-cd ../ZTS
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
@@ -193,14 +213,14 @@ cd ../ZTS
%endif
: Upstream test suite for NTS extension
-cd ../NTS
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+cd %{sources}
+TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php -P -q --show-diff
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -214,6 +234,19 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* Wed Aug 30 2023 Remi Collet <remi@remirepo.net> - 6.0.3-4
+- rebuild for PHP 8.3.0RC1
+
+* Wed Jul 12 2023 Remi Collet <remi@remirepo.net> - 6.0.3-3
+- build out of sources tree
+
+* Thu Jan 19 2023 Remi Collet <remi@remirepo.net> - 6.0.3-2
+- rebuild using remi-librdkafka 2.0.1
+
+* Mon Jul 4 2022 Remi Collet <remi@remirepo.net> - 6.0.3-1
+- update to 6.0.3 (no change)
+- rebuild with librdkafka 1.9.0
+
* Mon Jun 13 2022 Remi Collet <remi@remirepo.net> - 6.0.2-1
- update to 6.0.2