[php-pecl-raphf] - Update to 1.0.3 (stable) - install doc in pecl doc_dir - install tests in pecl test_dir - add --wi
Remi Collet
remi at fedoraproject.org
Sat Nov 16 06:35:53 UTC 2013
commit 43d8a4c123129a8666a10e8969389fe750a945df
Author: Remi Collet <remi at fedoraproject.org>
Date: Sat Nov 16 07:36:10 2013 +0100
- Update to 1.0.3 (stable)
- install doc in pecl doc_dir
- install tests in pecl test_dir
- add --with tests option (not enabled, need pecl/http)
.gitignore | 2 +
php-pecl-raphf.spec | 82 ++++++++++++++++++++++++++++++++++++++++++---------
sources | 2 +-
3 files changed, 71 insertions(+), 15 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 19c1629..79b6eda 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
+clog
*spec~
/raphf-0.1.0.tgz
/raphf-1.0.2.tgz
+/raphf-1.0.3.tgz
diff --git a/php-pecl-raphf.spec b/php-pecl-raphf.spec
index 22012e2..242e931 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.3
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
+* Fri Nov 15 2013 Remi Collet <remi at fedoraproject.org> - 1.0.3-1
+- Update to 1.0.3 (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..31e4f48 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-ff4e8237dfd6885439940a10b53515de raphf-1.0.2.tgz
+ab74a66c0981dc223e5cc98e49bdc70e raphf-1.0.3.tgz
More information about the scm-commits
mailing list