summaryrefslogtreecommitdiffstats
path: root/php-pecl-rdkafka6.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-07-12 15:49:54 +0200
committerRemi Collet <remi@php.net>2023-07-12 15:49:54 +0200
commitd35910eda5cd5f79267cc2c325503aca73025a88 (patch)
treece212943ce7a4f379774edcd18a8c5f77f9b7f11 /php-pecl-rdkafka6.spec
parent8ee0d922b6853ad562436c49ca21967e340d5a7b (diff)
build out of sources tree
Diffstat (limited to 'php-pecl-rdkafka6.spec')
-rw-r--r--php-pecl-rdkafka6.spec39
1 files changed, 21 insertions, 18 deletions
diff --git a/php-pecl-rdkafka6.spec b/php-pecl-rdkafka6.spec
index 12a3716..cb4ff04 100644
--- a/php-pecl-rdkafka6.spec
+++ b/php-pecl-rdkafka6.spec
@@ -31,11 +31,13 @@
%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: %{?scl_prefix}php-pecl-%{pecl_name}6
Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}}
-Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 3%{?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
@@ -43,7 +45,7 @@ Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upst
BuildRequires: make
BuildRequires: %{?dtsprefix}gcc
%if %{with move_to_opt}
-BuildRequires: %{?vendeur:%{vendeur}-}librdkafka-devel >= 2
+BuildRequires: %{?vendeur:%{vendeur}-}librdkafka-devel >= 2.2
Requires: %{?vendeur:%{vendeur}-}librdkafka%{?_isa} >= %{buildver}
%else
BuildRequires: librdkafka-devel >= 1.4
@@ -53,7 +55,6 @@ 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}}
Provides: %{?scl_prefix}php-%{pecl_name} = %{version}
Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}
@@ -77,7 +78,7 @@ Provides: %{?scl_prefix}php-pecl-%{pecl_name}4%{?_isa} = %{version}-%{relea
%if %{with move_to_opt}
%{?filter_requires_in: %filter_requires_in %{_libdir}/.*\.so$}
- %endif
+%endif
%{?filter_setup}
@@ -89,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
@@ -105,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
@@ -125,10 +126,12 @@ EOF
export PKG_CONFIG_PATH=/opt/%{?vendeur:%{vendeur}/}librdkafka/%{_lib}/pkgconfig
%endif
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
- --with-php-config=%{_bindir}/php-config \
+ --with-php-config=%{__phpconfig} \
--with-libdir=%{_lib} \
%if %{with move_to_opt}
--with-rdkafka=/opt/%{?vendeur:%{vendeur}/}librdkafka
@@ -140,9 +143,8 @@ make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
- --with-php-config=%{_bindir}/zts-php-config \
+ --with-php-config=%{__ztsphpconfig} \
--with-libdir=%{_lib} \
%if %{with move_to_opt}
--with-rdkafka=/opt/%{?vendeur:%{vendeur}/}librdkafka
@@ -173,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
@@ -198,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 \
@@ -213,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
@@ -234,6 +234,9 @@ REPORT_EXIT_STATUS=1 \
%changelog
+* 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