From b7a4e0c4c60778e9b78d7e8a9d5a57dd28643cce Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Tue, 23 Jun 2015 14:59:19 +0200 Subject: php-pecl-solr: allow build against rh-php56 (as more-php56) --- php-pecl-solr.spec | 74 ++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/php-pecl-solr.spec b/php-pecl-solr.spec index 6247dc8..77f3d6f 100644 --- a/php-pecl-solr.spec +++ b/php-pecl-solr.spec @@ -1,4 +1,7 @@ -# spec file for php-pecl-solr +# remirepo spec file for php-pecl-solr +# with SCL compatibility, from Fedora: +# +# Fedora spec file for php-pecl-solr # # Copyright (c) 2011-2015 Remi Collet # Copyright (c) 2010 Johan Cwiklinski @@ -7,6 +10,14 @@ # # Please, preserve the changelog entries # +%if 0%{?scl:1} +%if "%{scl}" == "rh-php56" +%global sub_prefix more-php56- +%else +%global sub_prefix %{scl_prefix} +%endif +%endif + %{?scl: %scl_package php-pecl-solr} %{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d} %{!?__pecl: %global __pecl %{_bindir}/pecl} @@ -24,9 +35,9 @@ Summary: Object oriented API to Apache Solr Summary(fr): API orientée objet pour Apache Solr -Name: %{?scl_prefix}php-pecl-solr +Name: %{?sub_prefix}php-pecl-solr Version: 1.1.1 -Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}.1 +Release: 3%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}} License: PHP Group: Development/Languages URL: http://pecl.php.net/package/solr @@ -41,8 +52,6 @@ BuildRequires: %{?scl_prefix}php-json BuildRequires: curl-devel BuildRequires: libxml2-devel -Requires(post): %{__pecl} -Requires(postun): %{__pecl} Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} Requires: %{?scl_prefix}php(api) = %{php_core_api} %if "%{php_version}" < "5.4" @@ -62,17 +71,21 @@ Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} %if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} # Other third party repo stuff -Obsoletes: php53-pecl-%{pecl_name} -Obsoletes: php53u-pecl-%{pecl_name} -Obsoletes: php54-pecl-%{pecl_name} -Obsoletes: php54w-pecl-%{pecl_name} +Obsoletes: php53-pecl-%{pecl_name} <= %{version} +Obsoletes: php53u-pecl-%{pecl_name} <= %{version} +Obsoletes: php54-pecl-%{pecl_name} <= %{version} +Obsoletes: php54w-pecl-%{pecl_name} <= %{version} %if "%{php_version}" > "5.5" -Obsoletes: php55u-pecl-%{pecl_name} -Obsoletes: php55w-pecl-%{pecl_name} +Obsoletes: php55u-pecl-%{pecl_name} <= %{version} +Obsoletes: php55w-pecl-%{pecl_name} <= %{version} %endif %if "%{php_version}" > "5.6" -Obsoletes: php56u-pecl-%{pecl_name} -Obsoletes: php56w-pecl-%{pecl_name} +Obsoletes: php56u-pecl-%{pecl_name} <= %{version} +Obsoletes: php56w-pecl-%{pecl_name} <= %{version} +%endif +%if "%{php_version}" > "7.0" +Obsoletes: php70u-pecl-%{pecl_name} <= %{version} +Obsoletes: php70w-pecl-%{pecl_name} <= %{version} %endif %endif @@ -106,6 +119,8 @@ http://www.php.net/manual/en/book.solr.php Warning: PECL Solr 1 is not compatible with Solr Server >= 4.0. PECL Solr 2 is available in php-pecl-solr2 package. +Package built for PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: as Software Collection (%{scl})}. + %description -l fr Bibliothèque riche en fonctionnalités qui permet aux développeurs PHP @@ -132,11 +147,16 @@ http://www.php.net/manual/fr/book.solr.php Attention: PECL Solr 1 n'est pas compatible avec un serveur Solr >= 4.0. PECL Solr 2 est disponible dans le paquet php-pecl-solr2. +Paquet construit pour PHP %(%{__php} -r 'echo PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')%{?scl: en Software Collection (%{scl})}. + %prep %setup -c -q - mv %{pecl_name}-%{version}%{?prever} NTS + +# Don't install/register tests +sed -e 's/role="test"/role="src"/' -i package.xml + cd NTS # Check version @@ -189,21 +209,26 @@ make -C ZTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} %endif -# Test & Documentation -for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//') -do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i -done +# Documentation for i in LICENSE $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i done -%post -%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : +# 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 ] ; then +if [ $1 -eq 0 -a -x %{__pecl} ] ; then %{pecl_uninstall} %{pecl_name} >/dev/null || : fi @@ -247,8 +272,8 @@ rm -rf %{buildroot} %files %defattr(-, root, root, -) +%{?_licensedir:%license NTS/LICENSE} %doc %{pecl_docdir}/%{pecl_name} -%doc %{pecl_testdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{ini_name} @@ -261,6 +286,11 @@ rm -rf %{buildroot} %changelog +* Tue Jun 23 2015 Remi Collet - 1.1.1-3 +- allow build against rh-php56 (as more-php56) +- drop runtime dependency on pear, new scriptlets +- don't install/register tests + * Wed Dec 24 2014 Remi Collet - 1.1.1-2.1 - Fedora 21 SCL mass rebuild -- cgit