From 4e8dc5fefe4995315bac3468b00e47e1c7b2cdd8 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 7 Nov 2013 10:01:44 +0100 Subject: php-pecl-scrypt: - cleanups for Copr - install doc in /usr/share/doc/pecl - install tests in /usr/share/tests/pecl --- php-pecl-scrypt.spec | 44 ++++++++++++++++++++++++++++++++++---------- 1 file changed, 34 insertions(+), 10 deletions(-) diff --git a/php-pecl-scrypt.spec b/php-pecl-scrypt.spec index d0f352c..c0d1618 100644 --- a/php-pecl-scrypt.spec +++ b/php-pecl-scrypt.spec @@ -6,8 +6,9 @@ # # Please, preserve the changelog entries # -%{!?php_inidir: %{expand: %%global php_inidir %{_sysconfdir}/php.d}} -%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} +%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d} +%{!?__pecl: %global __pecl %{_bindir}/pecl} +%{!?__php: %global __php %{_bindir}/php} %global with_zts 0%{?__ztsphp:1} %global pecl_name scrypt @@ -15,7 +16,7 @@ Summary: Scrypt hashing function Name: php-pecl-%{pecl_name} Version: 1.2 -Release: 1%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} +Release: 2%{?dist}%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')} License: BSD Group: Development/Languages URL: http://pecl.php.net/package/%{pecl_name} @@ -32,16 +33,24 @@ Requires(post): %{__pecl} Requires(postun): %{__pecl} Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} +%if "%{php_version}" < "5.4" +# php 5.3.3 in EL-6 don't use arched virtual provides +# so only requires real packages instead +Requires: php-common%{?_isa} +%else Requires: php-hash%{?_isa} +%endif 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} < 20 # Filter shared private %{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} %{?filter_setup} +%endif %description @@ -52,12 +61,13 @@ A PHP wrapper to Colin Percival's scrypt implementation. %setup -q -c mv %{pecl_name}-%{version} NTS +sed -e '/README/s/role="src"/role="doc"/' \ + -e '/CREDITS/s/role="src"/role="doc"/' \ + -i package.xml + cd NTS %patch0 -p1 -# https://github.com/DomBlack/php-scrypt/issues/19 -sed -n '/BSD/,$p' README.md >LICENSE - # Sanity check, really often broken extver=$(sed -n '/#define PHP_SCRYPT_VERSION/{s/.* "//;s/".*$//;p}' php_scrypt.h) if test "x${extver}" != "x%{version}%{?prever:-%{prever}}"; then @@ -115,6 +125,14 @@ make -C ZTS install INSTALL_ROOT=%{buildroot} install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini %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 +for i in $(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 || : @@ -129,16 +147,16 @@ fi %check : Minimal load test for NTS extension cd NTS -%{_bindir}/php --no-php-ini \ +%{__php} --no-php-ini \ --define extension=modules/%{pecl_name}.so \ --modules | grep %{pecl_name} : Upstream test suite for NTS extension -TEST_PHP_EXECUTABLE=%{_bindir}/php \ +TEST_PHP_EXECUTABLE=%{__php} \ TEST_PHP_ARGS="-n -d extension=$PWD/modules/%{pecl_name}.so" \ NO_INTERACTION=1 \ REPORT_EXIT_STATUS=1 \ -%{_bindir}/php -n run-tests.php +%{__php} -n run-tests.php %if %{with_zts} @@ -163,7 +181,8 @@ rm -rf %{buildroot} %files %defattr(-,root,root,-) -%doc NTS/{LICENSE,CREDITS} +%doc %{pecl_docdir}/%{pecl_name} +%doc %{pecl_testdir}/%{pecl_name} %{pecl_xmldir}/%{name}.xml %config(noreplace) %{php_inidir}/%{pecl_name}.ini %{php_extdir}/%{pecl_name}.so @@ -175,5 +194,10 @@ rm -rf %{buildroot} %changelog +* Thu Nov 7 2013 Remi Collet - 1.2-2 +- cleanups for Copr +- install doc in /usr/share/doc/pecl +- install tests in /usr/share/tests/pecl + * Sun Oct 6 2013 Remi Collet - 1.2-1 - initial package -- cgit