From 1e8124c5f883fab05f915cabfe72b1f0442acc55 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 24 Aug 2014 17:53:34 +0200 Subject: php-pecl-zip: allow SCL build --- php-pecl-zip.spec | 58 +++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 41 insertions(+), 17 deletions(-) (limited to 'php-pecl-zip.spec') diff --git a/php-pecl-zip.spec b/php-pecl-zip.spec index 34abdad..5633f6f 100644 --- a/php-pecl-zip.spec +++ b/php-pecl-zip.spec @@ -6,6 +6,9 @@ # # Please, preserve the changelog entries # +%{?scl: %scl_package php-pecl-zip} + +%global with_zts 0%{?__ztsphp:1} %global pecl_name zip %if 0%{?fedora} >= 20 @@ -22,7 +25,7 @@ Summary: A ZIP archive management extension Summary(fr): Une extension de gestion des ZIP -Name: php-pecl-zip +Name: %{?scl_prefix}php-pecl-zip Version: 1.12.4 Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} %if %{with_libzip} @@ -37,31 +40,37 @@ URL: http://pecl.php.net/package/zip Source: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) -BuildRequires: php-devel +BuildRequires: %{?scl_prefix}php-devel %if %{with_libzip} BuildRequires: pkgconfig(libzip) >= 0.11.1 %endif BuildRequires: zlib-devel -BuildRequires: php-pear +BuildRequires: %{?scl_prefix}php-pear Requires(post): %{_bindir}/pecl Requires(postun): %{_bindir}/pecl -Requires: php(zend-abi) = %{php_zend_api} -Requires: php(api) = %{php_core_api} +Requires: %{?scl_prefix}php(zend-abi) = %{php_zend_api} +Requires: %{?scl_prefix}php(api) = %{php_core_api} -Provides: php-pecl(%{pecl_name}) = %{version} -Provides: php-pecl(%{pecl_name})%{?_isa} = %{version} -Provides: php-%{pecl_name} = %{version}-%{release} -Provides: php-%{pecl_name}%{?_isa} = %{version}-%{release} +Provides: %{?scl_prefix}php-pecl(%{pecl_name}) = %{version} +Provides: %{?scl_prefix}php-pecl(%{pecl_name})%{?_isa} = %{version} +Provides: %{?scl_prefix}php-%{pecl_name} = %{version}-%{release} +Provides: %{?scl_prefix}php-%{pecl_name}%{?_isa} = %{version}-%{release} +%if "%{?vendor}" == "Remi Collet" && 0%{!?scl:1} # Other third party repo stuff -%if "%{php_version}" > "5.4" -Obsoletes: php53-pecl-%{pecl_name} +Obsoletes: php53-pecl-%{pecl_name} Obsoletes: php53u-pecl-%{pecl_name} -Obsoletes: php54-pecl-%{pecl_name} -%endif +Obsoletes: php54-pecl-%{pecl_name} +Obsoletes: php54w-pecl-%{pecl_name} %if "%{php_version}" > "5.5" Obsoletes: php55u-pecl-%{pecl_name} +Obsoletes: php55w-pecl-%{pecl_name} +%endif +%if "%{php_version}" > "5.6" +Obsoletes: php56u-pecl-%{pecl_name} +Obsoletes: php56w-pecl-%{pecl_name} +%endif %endif %if 0%{?fedora} < 20 && 0%{?rhel} < 7 @@ -96,8 +105,10 @@ cat >%{ini_name} << 'EOF' extension=%{pecl_name}.so EOF +%if %{with_zts} : Duplicate sources tree for ZTS build cp -pr %{pecl_name}-%{version} %{pecl_name}-zts +%endif %build @@ -112,6 +123,7 @@ cd %{pecl_name}-%{version} make %{?_smp_mflags} +%if %{with_zts} cd ../%{pecl_name}-zts %{_bindir}/zts-phpize %configure \ @@ -122,6 +134,7 @@ cd ../%{pecl_name}-zts --with-php-config=%{_bindir}/zts-php-config make %{?_smp_mflags} +%endif %install @@ -133,8 +146,10 @@ install -D -m 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name} # Install XML package description install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml +%if %{with_zts} make -C %{pecl_name}-zts install INSTALL_ROOT=%{buildroot} install -D -m 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name} +%endif # Test & Documentation cd %{pecl_name}-%{version} @@ -159,9 +174,10 @@ TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ NO_INTERACTION=1 \ TEST_PHP_EXECUTABLE=%{_bindir}/php \ -%{_bindir}/php \ - run-tests.php +%{_bindir}/php -n \ + run-tests.php --show-diff +%if %{with_zts} cd ../%{pecl_name}-zts : minimal load test of ZTS extension %{_bindir}/zts-php --no-php-ini \ @@ -174,8 +190,9 @@ TEST_PHP_ARGS="-n -d extension_dir=$PWD/modules -d extension=%{pecl_name}.so" \ REPORT_EXIT_STATUS=1 \ NO_INTERACTION=1 \ TEST_PHP_EXECUTABLE=%{_bindir}/zts-php \ -%{_bindir}/zts-php \ - run-tests.php +%{_bindir}/zts-php -n \ + run-tests.php --show-diff +%endif %clean @@ -197,13 +214,20 @@ fi %doc %{pecl_docdir}/%{pecl_name} %doc %{pecl_testdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml + %config(noreplace) %{php_inidir}/%{ini_name} %{php_extdir}/%{pecl_name}.so + +%if %{with_zts} %config(noreplace) %{php_ztsinidir}/%{ini_name} %{php_ztsextdir}/%{pecl_name}.so +%endif %changelog +* Sun Aug 24 2014 Remi Collet 1.12.1-2 +- allow SCL build + * Wed Apr 9 2014 Remi Collet - 1.12.4-2 - add numerical prefix to extension configuration file -- cgit