summaryrefslogtreecommitdiffstats
path: root/php-pecl-gearman.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-gearman.spec')
-rw-r--r--php-pecl-gearman.spec76
1 files changed, 29 insertions, 47 deletions
diff --git a/php-pecl-gearman.spec b/php-pecl-gearman.spec
index 8da46ec..4674333 100644
--- a/php-pecl-gearman.spec
+++ b/php-pecl-gearman.spec
@@ -8,30 +8,25 @@
#
# Please, preserve the changelog entries
#
-%if 0%{?scl:1}
-%global sub_prefix %{scl_prefix}
-%scl_package php-pecl-gearman
-%endif
+%{?scl:%scl_package php-pecl-gearman}
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global pecl_name gearman
-%if "%{php_version}" < "5.6"
-%global ini_name %{pecl_name}.ini
-%else
-%global ini_name 40-%{pecl_name}.ini
-%endif
+%global ini_name 40-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
-%bcond_without tests
+%bcond_without tests
-%global extver 2.1.0
-%global libver 1.1.0
+%global extver 2.1.0
+%global libver 1.1.0
-Name: %{?sub_prefix}php-pecl-gearman
+Name: %{?scl_prefix}php-pecl-gearman
Version: %{extver}
-Release: 5%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
+Release: 6%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}
Summary: PHP wrapper to libgearman
-License: PHP
+License: PHP-3.01
URL: https://pecl.php.net/package/gearman
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}.tgz
@@ -48,34 +43,17 @@ BuildRequires: autoconf, automake, libtool
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}
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}
+%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} == 7
# Other third party repo stuff
Obsoletes: php55w-pecl-%{pecl_name} <= %{version}
Obsoletes: php56u-pecl-%{pecl_name} <= %{version}
Obsoletes: php56w-pecl-%{pecl_name} <= %{version}
-%if "%{php_version}" > "7.3"
-Obsoletes: php73-pecl-%{pecl_name} <= %{version}
-%endif
-%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
@@ -90,7 +68,6 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -q -c
-mv %{pecl_name}-%{version} NTS
# Dont register tests on install
sed -e 's/role="test"/role="src"/' \
@@ -98,8 +75,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
-pushd NTS
-%patch0 -p1
+pushd %{sources}
+%patch -P0 -p1
extver=$(sed -n '/#define PHP_GEARMAN_VERSION/{s/.* "//;s/".*$//;p}' php_gearman.h)
if test "x${extver}" != "x%{version}"; then
@@ -113,25 +90,27 @@ cat >%{ini_name} <<EOF
extension=%{pecl_name}.so
EOF
-find NTS -type f -exec chmod -x {} \;
+find %{sources} -type f -exec chmod -x {} \;
+mkdir NTS
%if %{with_zts}
-cp -pr NTS ZTS
+mkdir ZTS
%endif
%build
%{?dtsenable}
-cd NTS
-%{_bindir}/phpize
-%configure --with-php-config=%{_bindir}/php-config
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+%configure --with-php-config=%{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
-%configure --with-php-config=%{_bindir}/zts-php-config
+%configure --with-php-config=%{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -154,7 +133,7 @@ install -Dpm644 %{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
@@ -166,9 +145,9 @@ done
%if %{with tests}
: Upstream test suite for NTS extension
-cd NTS
+cd %{sources}
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
%{__php} -n run-tests.php -q --offline --show-diff
%endif
@@ -202,7 +181,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -216,6 +195,9 @@ fi
%changelog
+* Thu Jul 20 2023 Remi Collet <remi@remirepo.net> - 2.1.0-6
+- build out of sources tree
+
* Wed Sep 01 2021 Remi Collet <remi@remirepo.net> - 2.1.0-5
- rebuild for 8.1.0RC1