summaryrefslogtreecommitdiffstats
path: root/php-pecl-memcached.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-pecl-memcached.spec')
-rw-r--r--php-pecl-memcached.spec94
1 files changed, 40 insertions, 54 deletions
diff --git a/php-pecl-memcached.spec b/php-pecl-memcached.spec
index 0c15c06..c7b8d0a 100644
--- a/php-pecl-memcached.spec
+++ b/php-pecl-memcached.spec
@@ -3,16 +3,13 @@
#
# Fedora spec file for php-pecl-memcached
#
-# Copyright (c) 2009-2022 Remi Collet
-# License: CC-BY-SA
+# Copyright (c) 2009-2023 Remi Collet
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
-# we don't want -z defs linker flag
-%undefine _strict_symbol_defs_build
-
%if 0%{?scl:1}
%global sub_prefix %{scl_prefix}
%scl_package php-pecl-memcached
@@ -35,13 +32,15 @@
# upstream use dev => alpha => beta => RC
# make RPM happy DEV => alpha => beta => rc
#global upstream_lower rc2
+%global sources %{pecl_name}-%{upstream_version}%{?upstream_prever}
+%global _configure ../%{sources}/configure
Summary: Extension to work with the Memcached caching daemon
-Name: %{?sub_prefix}php-pecl-memcached
+Name: %{?scl_prefix}php-pecl-memcached
Version: %{upstream_version}%{?upstream_prever:~%{upstream_lower}}
-Release: 5%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
-License: PHP
+Release: 6%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+License: PHP-3.01
URL: https://pecl.php.net/package/%{pecl_name}
Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz
@@ -54,10 +53,10 @@ BuildRequires: %{?scl_prefix}php-devel >= 7.0
BuildRequires: %{?scl_prefix}php-pear
BuildRequires: %{?scl_prefix}php-json
%if %{with igbinary}
-BuildRequires: %{?sub_prefix}php-pecl-igbinary-devel
+BuildRequires: %{?scl_prefix}php-pecl-igbinary-devel
%endif
%if %{with msgpack}
-BuildRequires: %{?sub_prefix}php-pecl-msgpack-devel
+BuildRequires: %{?scl_prefix}php-pecl-msgpack-devel
%endif
BuildRequires: zlib-devel
BuildRequires: cyrus-sasl-devel
@@ -86,23 +85,18 @@ Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api}
Requires: %{?scl_prefix}php(api) = %{php_core_api}
Requires: %{?scl_prefix}php-json%{?_isa}
%if %{with igbinary}
-Requires: %{?sub_prefix}php-igbinary%{?_isa}
+Requires: %{?scl_prefix}php-igbinary%{?_isa}
%endif
%if %{with msgpack}
-Requires: %{?sub_prefix}php-msgpack%{?_isa}
+Requires: %{?scl_prefix}php-msgpack%{?_isa}
%endif
-%{?_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: php53-pecl-%{pecl_name} <= %{version}
Obsoletes: php53u-pecl-%{pecl_name} <= %{version}
@@ -129,12 +123,6 @@ Obsoletes: php73w-pecl-%{pecl_name} <= %{version}
%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
%if %{move_to_opt}
@@ -158,15 +146,14 @@ Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSIO
%prep
%setup -c -q
-mv %{pecl_name}-%{upstream_version}%{?upstream_prever} 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
-%patch0 -p1
+cd %{sources}
+%patch -P0 -p1
%if %{with fastlz}
rm -r fastlz
@@ -203,10 +190,11 @@ extension=%{pecl_name}.so
EOF
# default options with description from upstream
-cat NTS/memcached.ini >>%{ini_name}
+cat %{sources}/memcached.ini >>%{ini_name}
+mkdir NTS
%if %{with_zts}
-cp -r NTS ZTS
+mkdir ZTS
%endif
@@ -237,15 +225,16 @@ peclconf() {
%endif
--with-php-config=$1
}
-cd NTS
-%{_bindir}/phpize
-peclconf %{_bindir}/php-config
+cd %{sources}
+%{__phpize}
+
+cd ../NTS
+peclconf %{__phpconfig}
make %{?_smp_mflags}
%if %{with_zts}
cd ../ZTS
-%{_bindir}/zts-phpize
-peclconf %{_bindir}/zts-php-config
+peclconf %{__ztsphpconfig}
make %{?_smp_mflags}
%endif
@@ -270,7 +259,7 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
%endif
# Documentation
-cd NTS
+cd %{sources}
for i in $(grep 'role="doc"' ../package.xml | sed -e 's/^.*name="//;s/".*$//')
do install -Dpm 644 $i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
done
@@ -297,12 +286,6 @@ fi
%check
-%if "%{php_version}" < "7.3"
-# ::1:50770 vs [::1]:%s
-rm ?TS/tests/memcachedserver6.phpt
-%endif
-
-
OPT="-n"
[ -f %{php_extdir}/igbinary.so ] && OPT="$OPT -d extension=igbinary.so"
[ -f %{php_extdir}/json.so ] && OPT="$OPT -d extension=json.so"
@@ -321,35 +304,35 @@ OPT="-n"
%endif
%if %{with tests}
+cd %{sources}
ret=0
+%if "%{php_version}" < "7.3"
+# ::1:50770 vs [::1]:%s
+rm tests/memcachedserver6.phpt
+%endif
+
: Launch the Memcached service
port=$(%{__php} -r 'echo 10000 + PHP_MAJOR_VERSION*100 + PHP_MINOR_VERSION*10 + PHP_INT_SIZE + 0%{?scl:1};')
memcached -p $port -U $port -d -P $PWD/memcached.pid
-sed -e "s/11211/$port/" -i ?TS/tests/*
+sed -e "s/11211/$port/" -i tests/*
: Port for MemcachedServer
port=$(%{__php} -r 'echo 11000 + PHP_MAJOR_VERSION*100 + PHP_MINOR_VERSION*10 + PHP_INT_SIZE + 0%{?scl:1};')
-sed -e "s/3434/$port/" -i ?TS/tests/*
+sed -e "s/3434/$port/" -i tests/*
: Run the upstream test Suite for NTS extension
-pushd NTS
TEST_PHP_EXECUTABLE=%{__php} \
-TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
+TEST_PHP_ARGS="$OPT -d extension=$PWD/../NTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
-%{__php} -n run-tests.php -x --show-diff || ret=1
-popd
+%{__php} -n run-tests.php -q -x --show-diff || ret=1
%if %{with_zts}
: Run the upstream test Suite for ZTS extension
-pushd ZTS
TEST_PHP_EXECUTABLE=%{__ztsphp} \
-TEST_PHP_ARGS="$OPT -d extension=$PWD/modules/%{pecl_name}.so" \
-NO_INTERACTION=1 \
+TEST_PHP_ARGS="$OPT -d extension=$PWD/../ZTS/modules/%{pecl_name}.so" \
REPORT_EXIT_STATUS=1 \
-%{__ztsphp} -n run-tests.php -x --show-diff || ret=1
-popd
+%{__ztsphp} -n run-tests.php -q -x --show-diff || ret=1
%endif
# Cleanup
@@ -363,7 +346,7 @@ exit $ret
%files
-%{?_licensedir:%license NTS/LICENSE}
+%{?_licensedir:%license %{sources}/LICENSE}
%doc %{pecl_docdir}/%{pecl_name}
%{pecl_xmldir}/%{name}.xml
@@ -377,6 +360,9 @@ exit $ret
%changelog
+* Wed Jul 12 2023 Remi Collet <remi@remirepo.net> - 3.2.0-6
+- build out of sources tree
+
* Fri Sep 9 2022 Remi Collet <remi@remirepo.net> - 3.2.0-5
- rebuild for PHP 8.2 with msgpack and igbinary