[php-pecl-raphf/f19] Update to 1.0.4 (stable)

Remi Collet remi at fedoraproject.org
Tue Nov 26 13:04:14 UTC 2013


commit b837b719825fdc7def9569e3f12dcdcf408faccf
Author: Remi Collet <remi at fedoraproject.org>
Date:   Tue Nov 26 14:03:59 2013 +0100

    Update to 1.0.4 (stable)

 .gitignore          |    3 ++
 php-pecl-raphf.spec |   82 ++++++++++++++++++++++++++++++++++++++++++---------
 sources             |    2 +-
 3 files changed, 72 insertions(+), 15 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 19c1629..7c55167 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,6 @@
+clog
 *spec~
 /raphf-0.1.0.tgz
 /raphf-1.0.2.tgz
+/raphf-1.0.3.tgz
+/raphf-1.0.4.tgz
diff --git a/php-pecl-raphf.spec b/php-pecl-raphf.spec
index 7781022..bf9bc3d 100644
--- a/php-pecl-raphf.spec
+++ b/php-pecl-raphf.spec
@@ -6,16 +6,20 @@
 #
 # Please, preserve the changelog entries
 #
-%{!?php_inidir:  %{expand: %%global php_inidir  %{_sysconfdir}/php.d}}
-%{!?php_incldir: %{expand: %%global php_incldir %{_includedir}/php}}
-%{!?__pecl:      %{expand: %%global __pecl      %{_bindir}/pecl}}
+%{!?php_inidir:  %global php_inidir  %{_sysconfdir}/php.d}
+%{!?php_incldir: %global php_incldir %{_includedir}/php}
+%{!?__pecl:      %global __pecl      %{_bindir}/pecl}
+%{!?__php:       %global __php       %{_bindir}/php}
 
-%global with_zts  0%{?__ztsphp:1}
-%global pecl_name raphf
+%global with_zts   0%{?__ztsphp:1}
+%global pecl_name  raphf
+# tests disabled because of circular dependency on pecl/http
+# tests requires not yet release pecl/http 2.0.0beta6
+%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
 
 Summary:        Resource and persistent handles factory
 Name:           php-pecl-%{pecl_name}
-Version:        1.0.2
+Version:        1.0.4
 Release:        1%{?dist}
 License:        BSD
 Group:          Development/Languages
@@ -24,6 +28,9 @@ Source0:        http://pecl.php.net/get/%{pecl_name}-%{version}.tgz
 
 BuildRequires:  php-devel > 5.3
 BuildRequires:  php-pear
+%if %{with_tests}
+BuildRequires:  php-pecl-http
+%endif
 
 Requires(post): %{__pecl}
 Requires(postun): %{__pecl}
@@ -35,9 +42,12 @@ 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
 A reusable split-off of pecl_http's persistent handle and resource
@@ -73,9 +83,12 @@ cp -pr NTS ZTS
 %endif
 
 # Create configuration file
-cat > %{pecl_name}.ini << 'EOF'
+cat << 'EOF' | tee %{pecl_name}.ini
 ; Enable %{pecl_name} extension module
 extension=%{pecl_name}.so
+
+; Configuration
+;raphf.persistent_handle.limit = -1
 EOF
 
 
@@ -112,6 +125,14 @@ make -C ZTS \
 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 || :
@@ -124,23 +145,49 @@ fi
 
 
 %check
-# Minimal load test for NTS extension
+cd NTS
+: Minimal load test for NTS extension
 php --no-php-ini \
-    --define extension_dir=NTS/modules \
-    --define extension=%{pecl_name}.so \
+    --define extension=modules/%{pecl_name}.so \
     --modules | grep %{pecl_name}
 
+%if %{with_tests}
+for mod in json hash iconv propro; do
+  if [ -f %{php_extdir}/${mod}.so ]; then
+    modules="$modules -d extension=${mod}.so"
+  fi
+done
+
+: Upstream test suite for NTS extension
+TEST_PHP_EXECUTABLE=%{_bindir}/php \
+TEST_PHP_ARGS="-n $modules -d extension=$PWD/modules/%{pecl_name}.so -d extension=http.so" \
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+%{_bindir}/php -n run-tests.php
+%endif
+
 %if %{with_zts}
-# Minimal load test for ZTS extension
+cd ../ZTS
+: Minimal load test for ZTS extension
 %{__ztsphp} --no-php-ini \
-    --define extension_dir=ZTS/modules \
-    --define extension=%{pecl_name}.so \
+    --define extension=modules/%{pecl_name}.so \
     --modules | grep %{pecl_name}
+
+%if %{with_tests}
+: Upstream test suite for ZTS extension
+TEST_PHP_EXECUTABLE=%{__ztsphp} \
+TEST_PHP_ARGS="-n $modules -d extension=$PWD/modules/%{pecl_name}.so -d extension=http.so" \
+NO_INTERACTION=1 \
+REPORT_EXIT_STATUS=1 \
+%{__ztsphp} -n run-tests.php
+%endif
 %endif
 
 
+
+
 %files
-%doc NTS/{CREDITS,LICENSE}
+%doc %{pecl_docdir}/%{pecl_name}
 %{pecl_xmldir}/%{name}.xml
 %config(noreplace) %{php_inidir}/%{pecl_name}.ini
 %{php_extdir}/%{pecl_name}.so
@@ -151,6 +198,7 @@ php --no-php-ini \
 %endif
 
 %files devel
+%doc %{pecl_testdir}/%{pecl_name}
 %{php_incldir}/ext/%{pecl_name}
 
 %if %{with_zts}
@@ -159,6 +207,12 @@ php --no-php-ini \
 
 
 %changelog
+* Tue Nov 26 2013 Remi Collet <remi at fedoraproject.org> - 1.0.4-1
+- Update to 1.0.4 (stable)
+- install doc in pecl doc_dir
+- install tests in pecl test_dir
+- add --with tests option (not enabled, need pecl/http)
+
 * Tue Aug 20 2013 Remi Collet <remi at fedoraproject.org> - 1.0.2-1
 - Update to 1.0.2 (stable)
 
diff --git a/sources b/sources
index e649b61..b1a3a47 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-ff4e8237dfd6885439940a10b53515de  raphf-1.0.2.tgz
+e5e7e5c3954a5fd31c034c347f22c4a5  raphf-1.0.4.tgz


More information about the scm-commits mailing list