summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-pecl-nsq.spec67
1 files changed, 25 insertions, 42 deletions
diff --git a/php-pecl-nsq.spec b/php-pecl-nsq.spec
index f75b01a..4424842 100644
--- a/php-pecl-nsq.spec
+++ b/php-pecl-nsq.spec
@@ -1,7 +1,7 @@
# remirepo spec file for php-pecl-nsq
#
-# Copyright (c) 2018-2021 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2018-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
@@ -20,13 +20,15 @@
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name nsq
%global ini_name 40-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Summary: PHP extension for NSQ client
-Name: %{?sub_prefix}php-pecl-nsq
+Name: %{?scl_prefix}php-pecl-nsq
Version: 3.5.1
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-Source: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
-License: PHP
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Source: https://pecl.php.net/get/%{sources}%{?prever}.tgz
+License: PHP-3.01
URL: https://pecl.php.net/package/nsq
BuildRequires: make
@@ -39,29 +41,11 @@ BuildRequires: pkgconfig(libevent) >= 2
Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
Requires: %{?scl_prefix}php-json%{?_isa}
-%{?_sclreq:Requires: %{?scl_prefix}runtime%{?_sclreq}%{?_isa}}
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 "%{?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
-%endif
%description
@@ -72,14 +56,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -qc
-mv %{pecl_name}-%{version} NTS
# Don't install/register 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_NSQ_VERSION/{s/.* "//;s/".*$//;p}' php_nsq.h )
if test "x${extver}" != "x%{version}"; then
@@ -88,9 +71,9 @@ if test "x${extver}" != "x%{version}"; then
fi
cd ..
+mkdir NTS
%if %{with_zts}
-# duplicate for ZTS build
-cp -pr NTS ZTS
+mkdir ZTS
%endif
# Drop in the bit of configuration
@@ -105,21 +88,22 @@ EOF
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
%configure \
--with-nsq \
--with-libevent-path=%{_root_prefix} \
- --with-php-config=%{_bindir}/php-config
+ --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
%configure \
--with-nsq \
--with-libevent-path=%{_root_prefix} \
- --with-php-config=%{_bindir}/zts-php-config
+ --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -142,15 +126,15 @@ install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
: 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
%check
+cd %{sources}
OPTS="-n"
[ -f %{php_extdir}/json.so ] && OPTS="$OPTS -d extension=json.so"
-cd NTS
: Minimal load test for NTS extension
%{__php} $OPTS \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
@@ -159,13 +143,10 @@ cd NTS
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__php} \
TEST_PHP_ARGS="$OPTS -d extension=%{buildroot}%{php_extdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php --show-diff
+%{__php} -n run-tests.php -q --show-diff
%if %{with_zts}
-cd ../ZTS
-
: Minimal load test for ZTS extension
%{__ztsphp} $OPTS \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
@@ -174,9 +155,8 @@ cd ../ZTS
: Upstream test suite for NTS extension
TEST_PHP_EXECUTABLE=%{__ztsphp} \
TEST_PHP_ARGS="$OPTS -d extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so" \
-NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php --show-diff
+%{__ztsphp} -n run-tests.php -q --show-diff
%endif
@@ -201,7 +181,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -215,6 +195,9 @@ fi
%changelog
+* Fri Sep 1 2023 Remi Collet <remi@remirepo.net> - 3.5.1-2
+- build out of sources tree
+
* Sat Sep 18 2021 Remi Collet <remi@remirepo.net> - 3.5.1-1
- update to 3.5.1