summaryrefslogtreecommitdiffstats
path: root/php-pecl-memcache.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-memcache.spec')
-rw-r--r--php-pecl-memcache.spec37
1 files changed, 21 insertions, 16 deletions
diff --git a/php-pecl-memcache.spec b/php-pecl-memcache.spec
index 7285761..a6c3ee0 100644
--- a/php-pecl-memcache.spec
+++ b/php-pecl-memcache.spec
@@ -14,11 +14,13 @@
%global pecl_name memcache
%global with_zts 0%{!?_without_zts:%{?__ztsphp:1}}
%global ini_name 40-%{pecl_name}.ini
+%global sources %{pecl_name}-%{version}
+%global _configure ../%{sources}/configure
Summary: Extension to work with the Memcached caching daemon
Name: %{?scl_prefix}php-pecl-memcache
Version: 8.2
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
Source0: https://pecl.php.net/get/%{pecl_name}-%{version}%{?prever}.tgz
License: PHP-3.01
URL: https://pecl.php.net/package/%{pecl_name}
@@ -34,7 +36,6 @@ BuildRequires: memcached
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}
@@ -78,14 +79,13 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -c -q
-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
-pushd NTS
+pushd %{sources}
# Check version as upstream often forget to update this
extver=$(sed -n '/#define PHP_MEMCACHE_VERSION/{s/.* "//;s/".*$//;p}' src/php_memcache.h)
if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then
@@ -148,23 +148,25 @@ extension=%{pecl_name}.so
;memcache.session_save_path = ''
EOF
+mkdir NTS
%if %{with_zts}
-cp -r 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
@@ -186,7 +188,7 @@ install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
# Documentation
for i in $(grep '<file .* 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
@@ -194,17 +196,17 @@ done
: Minimal load test for NTS extension
%{__php} --no-php-ini \
--define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
- -m | grep %{pecl_name}
+ -m | grep '^%{pecl_name}$'
%if %{with_zts}
: Minimal load test for ZTS extension
%{__ztsphp} --no-php-ini \
--define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
- -m | grep %{pecl_name}
+ -m | grep '^%{pecl_name}$'
%endif
%if %{with tests}
-cd NTS
+cd %{sources}
: ignore test with erratic results
rm tests/040.phpt
rm tests/056.phpt
@@ -222,7 +224,7 @@ memcached -s $PWD/memcached.sock -d -P $PWD/memcached3.pid
: Upstream test suite for NTS extension
ret=0
TEST_PHP_EXECUTABLE=%{_bindir}/php \
-TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \
+TEST_PHP_ARGS="-n -d extension_dir=$PWD/../NTS/modules -d extension=%{pecl_name}.so" \
NO_INTERACTION=1 \
REPORT_EXIT_STATUS=1 \
%{_bindir}/php -n run-tests.php --show-diff || ret=1
@@ -257,7 +259,7 @@ fi
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -271,6 +273,9 @@ fi
%changelog
+* Tue Jul 11 2023 Remi Collet <remi@remirepo.net> - 8.2-2
+- build out of sources tree
+
* Mon May 1 2023 Remi Collet <remi@remirepo.net> - 8.2-1
- update to 8.2
- drop patches merged upstream