From fae6d306f664b25fe15da6fd18cdc988e3a75f83 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mon, 11 Sep 2023 16:24:27 +0200 Subject: cleanup SCL stuff for Fedora review --- php-pecl-redis6.spec | 133 +++++++++++++++++---------------------------------- 1 file changed, 43 insertions(+), 90 deletions(-) diff --git a/php-pecl-redis6.spec b/php-pecl-redis6.spec index c4b880f..32d8632 100644 --- a/php-pecl-redis6.spec +++ b/php-pecl-redis6.spec @@ -1,3 +1,6 @@ +# Fedora spec file for php-pecl-redis6 +# without SCL compatibility from: +# # remirepo spec file for php-pecl-redis6 # # Copyright (c) 2012-2023 Remi Collet @@ -7,18 +10,12 @@ # Please, preserve the changelog entries # -%if 0%{?scl:1} -%scl_package php-pecl-redis -%bcond_with tests -%else %bcond_without tests -%global _root_bindir %{_bindir} -%endif +%bcond_without igbinary +%bcond_without msgpack %global pecl_name redis %global with_zts 0%{!?_without_zts:%{?__ztsphp:1}} -%bcond_without igbinary -%bcond_without msgpack # after 20-json, 40-igbinary and 40-msgpack %global ini_name 50-%{pecl_name}.ini @@ -28,23 +25,23 @@ %global _configure ../%{sources}/configure Summary: Extension for communicating with the Redis key-value store -Name: %{?scl_prefix}php-pecl-redis6 +Name: php-pecl-redis6 Version: %{upstream_version}%{?upstream_prever:~%{upstream_prever}} -Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} +Release: 1%{?dist} License: PHP-3.01 URL: https://pecl.php.net/package/redis -Source0: https://pecl.php.net/get/%{pecl_name}-%{upstream_version}%{?upstream_prever}.tgz +Source0: https://pecl.php.net/get/%{sources}.tgz BuildRequires: make -BuildRequires: %{?dtsprefix}gcc -BuildRequires: %{?scl_prefix}php-devel >= 7.2 -BuildRequires: %{?scl_prefix}php-pear -BuildRequires: %{?scl_prefix}php-json +BuildRequires: gcc +BuildRequires: php-devel >= 7.2 +BuildRequires: php-pear +BuildRequires: php-json %if %{with igbinary} -BuildRequires: %{?scl_prefix}php-pecl-igbinary-devel +BuildRequires: php-pecl-igbinary-devel %endif %if %{with msgpack} -BuildRequires: %{?scl_prefix}php-pecl-msgpack-devel >= 2.0.3 +BuildRequires: php-pecl-msgpack-devel >= 2.0.3 %endif BuildRequires: pkgconfig(liblzf) BuildRequires: pkgconfig(libzstd) >= 1.3.0 @@ -54,56 +51,36 @@ BuildRequires: pkgconfig(liblz4) BuildRequires: redis >= 7 %endif -Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} -Requires: %{?scl_prefix}php(api) = %{php_core_api} -Requires: %{?scl_prefix}php-json%{?_isa} +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} +Requires: php-json%{?_isa} %if %{with igbinary} -Requires: %{?scl_prefix}php-igbinary%{?_isa} +Requires: php-igbinary%{?_isa} %endif %if %{with msgpack} -Requires: %{?scl_prefix}php-msgpack%{?_isa} +Requires: php-msgpack%{?_isa} %endif -Obsoletes: %{?scl_prefix}php-%{pecl_name} < 3 -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} +Provides: php-%{pecl_name} = %{version} +Provides: php-%{pecl_name}%{?_isa} = %{version} +Provides: php-pecl(%{pecl_name}) = %{version} +Provides: php-pecl(%{pecl_name})%{?_isa} = %{version} %if 0%{?fedora} >= 40 || 0%{?rhel} >= 10 || "%{php_version}" > "8.3" -Obsoletes: %{?scl_prefix}php-pecl-%{pecl_name} < 6 -Provides: %{?scl_prefix}php-pecl-%{pecl_name} = %{version}-%{release} -Provides: %{?scl_prefix}php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} -Obsoletes: %{?scl_prefix}php-pecl-%{pecl_name}4 < 6 -Provides: %{?scl_prefix}php-pecl-%{pecl_name}4 = %{version}-%{release} -Provides: %{?scl_prefix}php-pecl-%{pecl_name}4%{?_isa} = %{version}-%{release} -Obsoletes: %{?scl_prefix}php-pecl-%{pecl_name}5 < 6 -Provides: %{?scl_prefix}php-pecl-%{pecl_name}5 = %{version}-%{release} -Provides: %{?scl_prefix}php-pecl-%{pecl_name}5%{?_isa} = %{version}-%{release} +Obsoletes: php-pecl-%{pecl_name} < 6 +Provides: php-pecl-%{pecl_name} = %{version}-%{release} +Provides: php-pecl-%{pecl_name}%{?_isa} = %{version}-%{release} +Obsoletes: php-pecl-%{pecl_name}4 < 6 +Provides: php-pecl-%{pecl_name}4 = %{version}-%{release} +Provides: php-pecl-%{pecl_name}4%{?_isa} = %{version}-%{release} +Obsoletes: php-pecl-%{pecl_name}5 < 6 +Provides: php-pecl-%{pecl_name}5 = %{version}-%{release} +Provides: php-pecl-%{pecl_name}5%{?_isa} = %{version}-%{release} %else # A single version can be installed -Conflicts: %{?scl_prefix}php-pecl-%{pecl_name} < 6 -Conflicts: %{?scl_prefix}php-pecl-%{pecl_name}4 < 6 -Conflicts: %{?scl_prefix}php-pecl-%{pecl_name}5 < 6 -%endif - -%if "%{?packager}" == "Remi Collet" && 0%{!?scl:1} && 0%{?rhel} == 7 -# Other third party repo stuff -%if "%{php_version}" > "7.1" -Obsoletes: php71u-pecl-%{pecl_name} <= %{version} -Obsoletes: php71w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.2" -Obsoletes: php72u-pecl-%{pecl_name} <= %{version} -Obsoletes: php72w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.3" -Obsoletes: php73-pecl-%{pecl_name} <= %{version} -Obsoletes: php73w-pecl-%{pecl_name} <= %{version} -%endif -%if "%{php_version}" > "7.4" -Obsoletes: php74-pecl-%{pecl_name} <= %{version} -%endif +Conflicts: php-pecl-%{pecl_name} < 6 +Conflicts: php-pecl-%{pecl_name}4 < 6 +Conflicts: php-pecl-%{pecl_name}5 < 6 %endif @@ -115,15 +92,13 @@ This Redis client implements most of the latest Redis API. As method only only works when also implemented on the server side, some doesn't work with an old redis server version. -Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl} by %{?scl_vendor}%{!?scl_vendor:rh})}. - %prep %setup -q -c # Don't install/register tests, license, and bundled library sed -e 's/role="test"/role="src"/' \ - %{?_licensedir:-e '/LICENSE/s/role="doc"/role="src"/' } \ + -e '/LICENSE/s/role="doc"/role="src"/' \ -e '/liblzf/d' \ -i package.xml @@ -196,8 +171,6 @@ EOF %build -%{?dtsenable} - peclconf() { %configure \ --enable-redis \ @@ -232,8 +205,6 @@ make %{?_smp_mflags} %install -%{?dtsenable} - # Install the NTS stuff make -C NTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} @@ -277,8 +248,8 @@ cd %{sources}/tests : Launch redis server mkdir -p data pidfile=$PWD/redis.pid -port=$(%{__php} -r 'echo 9000 + PHP_MAJOR_VERSION*100 + PHP_MINOR_VERSION*10 + PHP_INT_SIZE + %{?fedora}%{?rhel} + 0%{?scl:1};') -%{_root_bindir}/redis-server \ +port=$(%{__php} -r 'echo 9000 + PHP_MAJOR_VERSION*100 + PHP_MINOR_VERSION*10 + PHP_INT_SIZE;') +%{_bindir}/redis-server \ --bind 127.0.0.1 \ --port $port \ --daemonize yes \ @@ -298,7 +269,7 @@ $TEST_PHP_EXECUTABLE $TEST_PHP_ARGS TestRedis.php || ret=1 : Cleanup if [ -f $pidfile ]; then - %{_root_bindir}/redis-cli -p $port shutdown nosave + %{_bindir}/redis-cli -p $port shutdown nosave sleep 2 fi cat $PWD/redis.log @@ -308,29 +279,8 @@ exit $ret : Upstream test suite disabled %endif - -%if 0%{?fedora} < 24 && 0%{?rhel} < 8 -# when pear installed alone, after us -%triggerin -- %{?scl_prefix}php-pear -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -# posttrans as pear can be installed after us -%posttrans -if [ -x %{__pecl} ] ; then - %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -fi - -%postun -if [ $1 -eq 0 -a -x %{__pecl} ] ; then - %{pecl_uninstall} %{pecl_name} >/dev/null || : -fi -%endif - - %files -%{?_licensedir:%license %{sources}/LICENSE} +%license %{sources}/LICENSE %doc %{pecl_docdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml @@ -344,6 +294,9 @@ fi %changelog +* Mon Sep 11 2023 Remi Collet - 6.0.0-1 +- cleanup SCL stuff for Fedora review + * Mon Sep 11 2023 Remi Collet - 6.0.0-1 - update to 6.0.0 -- cgit