diff options
author | Remi Collet <remi@remirepo.net> | 2023-08-18 19:25:09 +0200 |
---|---|---|
committer | Remi Collet <remi@php.net> | 2023-08-18 19:25:09 +0200 |
commit | 738640fc3f13d3cfaa3f284befca943a16e8cc7d (patch) | |
tree | 037b2183a331c0298a1d30334ecab7cea564d5cb /php-pecl-cassandra.spec | |
parent | 12eb2c701dc4c290886b26a1571dc472cb68d87f (diff) |
Diffstat (limited to 'php-pecl-cassandra.spec')
-rw-r--r-- | php-pecl-cassandra.spec | 84 |
1 files changed, 45 insertions, 39 deletions
diff --git a/php-pecl-cassandra.spec b/php-pecl-cassandra.spec index 35edb5d..9bb9134 100644 --- a/php-pecl-cassandra.spec +++ b/php-pecl-cassandra.spec @@ -7,11 +7,9 @@ # Please preserve changelog entries # -%if 0%{?scl:1} -%scl_package php-pecl-cassandra -%endif +%{?scl:%scl_package php-pecl-cassandra} -%bcond_without tests +%bcond_without tests %global pecl_name cassandra %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} @@ -22,6 +20,12 @@ %global gh_owner datastax %global gh_project php-driver %global ini_name 40-%{pecl_name}.ini +%if 0%{?gh_commit:1} +%global sources %{gh_project}-%{gh_commit}/ext +%else +%global sources %{pecl_name}-%{version}%{?prever} +%endif +%global _configure ../%{sources}/configure # We don't really rely on upstream ABI %global buildver %(pkg-config --silence-errors --modversion cassandra 2>/dev/null || echo 65536) @@ -29,7 +33,7 @@ Summary: DataStax PHP Driver for Apache Cassandra Name: %{?scl_prefix}php-pecl-%{pecl_name} Version: 1.3.2 -Release: 12%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 13%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: Apache-2.0 URL: https://pecl.php.net/package/%{pecl_name} @@ -60,7 +64,6 @@ BuildRequires: gmp-devel Requires: cassandra-cpp-driver%{?_isa} >= %{buildver} 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} @@ -79,10 +82,7 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO %prep %setup -c -q %if 0%{?gh_commit:1} -mv %{gh_project}-%{gh_commit}/ext NTS -mv NTS/package.xml . -%else -mv %{pecl_name}-%{version}%{?prever} NTS +mv %{sources}/package.xml . %endif # Don't install/register tests @@ -90,14 +90,14 @@ sed -e 's/role="test"/role="src"/' \ %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ -i package.xml -cd NTS -%patch0 -p2 -b .pr126 -%patch1 -p2 -b .pr132 -%patch2 -p2 -b .pr135 -%patch3 -p2 -b .pr141 -%patch4 -p2 -b .php8 -%patch5 -p2 -b .php81 -%patch6 -p2 -b .php82 +pushd %{sources} +%patch -P0 -p2 -b .pr126 +%patch -P1 -p2 -b .pr132 +%patch -P2 -p2 -b .pr135 +%patch -P3 -p2 -b .pr141 +%patch -P4 -p2 -b .php8 +%patch -P5 -p2 -b .php81 +%patch -P6 -p2 -b .php82 # Sanity check, really often broken extver=$(sed -n '/#define PHP_DRIVER_VERSION /{s/.* "//;s/".*$//;p}' version.h) @@ -105,7 +105,7 @@ if test "x${extver}" != "x%{version}%{?prever}"; then : Error: Upstream extension version is ${extver}, expecting %{version}%{?prever}. exit 1 fi -cd .. +popd cat << 'EOF' | tee %{ini_name} ; Enable '%{summary}' extension module @@ -116,8 +116,9 @@ extension=%{pecl_name}.so ;cassandra.log_level = 'ERROR' EOF +mkdir NTS %if %{with_zts} -cp -pr NTS ZTS +mkdir ZTS %endif @@ -126,20 +127,24 @@ cp -pr NTS ZTS export PHP_RPATH=no -cd NTS -%{_bindir}/phpize +pushd %{sources} +%{__phpize} +popd + +pushd NTS %configure \ --with-cassandra \ - --with-php-config=%{_bindir}/php-config + --with-php-config=%{__phpconfig} make %{?_smp_mflags} +popd %if %{with_zts} -cd ../ZTS -%{_bindir}/zts-phpize +pushd ZTS %configure \ --with-cassandra \ - --with-php-config=%{_bindir}/zts-php-config + --with-php-config=%{__ztsphpconfig} make %{?_smp_mflags} +popd %endif @@ -161,7 +166,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 @@ -186,41 +191,39 @@ fi %check +cd %{sources} + : Minimal load test for NTS extension %{__php} -n \ -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ - -m | grep %{pecl_name} + -m | grep '^%{pecl_name}$' %if %{with tests} -cd NTS : Upstream test suite NTS extension TEST_PHP_EXECUTABLE=%{__php} \ -TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ -NO_INTERACTION=1 \ +TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ -%{__php} -n run-tests.php --show-diff +%{__php} -n run-tests.php -q --show-diff %endif %if %{with_zts} : Minimal load test for ZTS extension %{__ztsphp} -n \ -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ - -m | grep %{pecl_name} + -m | grep '^%{pecl_name}$' %if %{with tests} -cd ../ZTS : Upstream test suite ZTS extension TEST_PHP_EXECUTABLE=%{__ztsphp} \ -TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ -NO_INTERACTION=1 \ +TEST_PHP_ARGS="-n -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ -%{__ztsphp} -n run-tests.php --show-diff +%{__ztsphp} -n run-tests.php -q --show-diff %endif %endif %files -%{?_licensedir:%license NTS/LICENSE} +%{?_licensedir:%license %{sources}/LICENSE} %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -234,7 +237,10 @@ REPORT_EXIT_STATUS=1 \ %changelog -* Tue Feb 20 2023 Remi Collet <remi@remirepo.net> - 1.3.2-12 +* Fri Aug 18 2023 Remi Collet <remi@remirepo.net> - 1.3.2-13 +- build out of sources tree + +* Tue Feb 21 2023 Remi Collet <remi@remirepo.net> - 1.3.2-12 - spec cleanup, synced with fork version 1.3.8 * Fri Sep 16 2022 Remi Collet <remi@remirepo.net> - 1.3.2-11 |