summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-horde-Horde-Http.spec37
1 files changed, 32 insertions, 5 deletions
diff --git a/php-horde-Horde-Http.spec b/php-horde-Horde-Http.spec
index 85e8735..aa6b404 100644
--- a/php-horde-Horde-Http.spec
+++ b/php-horde-Horde-Http.spec
@@ -3,30 +3,42 @@
%global pear_name Horde_Http
%global pear_channel pear.horde.org
+# Can run test because of circular dependency with Horde_Test
+%global with_tests %{?_with_tests:1}%{!?_with_tests:0}
+
Name: php-horde-Horde-Http
Version: 2.0.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Horde HTTP libraries
Group: Development/Libraries
License: BSD
URL: http://pear.horde.org
-Source0: http://pear.horde.org/get/%{pear_name}-%{version}.tgz
+Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
-BuildRequires: php-pear
+BuildRequires: php-pear(PEAR) >= 1.7.0
BuildRequires: php-channel(%{pear_channel})
+%if %{with_tests}
+# To run unit tests
+BuildRequires: php-pear(%{pear_channel}/Horde_Test) >= 2.0.0
+%endif
Requires(post): %{__pear}
Requires(postun): %{__pear}
+Requires: php(language) >= 5.3.0
+Requires: php-pcre
+BuildRequires: php-pear(PEAR) >= 1.7.0
+Requires: php-channel(%{pear_channel})
Requires: php-pear(%{pear_channel}/Horde_Exception) >= 2.0.0
Conflicts: php-pear(%{pear_channel}/Horde_Exception) >= 3.0.0
Requires: php-pear(%{pear_channel}/Horde_Support) >= 2.0.0
Conflicts: php-pear(%{pear_channel}/Horde_Support) >= 3.0.0
-Requires: php(language) >= 5.3.0
-Requires: php-channel(%{pear_channel})
+# Optionnal
+Requires: php-curl
+Requires: php-pecl-http
Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
@@ -59,6 +71,16 @@ rm -rf %{buildroot}%{pear_metadir}/.??*
mkdir -p %{buildroot}%{pear_xmldir}
install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
+
+%check
+%if %{with_tests}
+cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g)
+phpunit -d date.timezone=UTC AllTests.php
+%else
+: Test disabled, missing '--with tests' option.
+%endif
+
+
%post
%{__pear} install --nodeps --soft --force --register-only \
%{pear_xmldir}/%{name}.xml >/dev/null || :
@@ -69,6 +91,7 @@ if [ $1 -eq 0 ] ; then
%{pear_channel}/%{pear_name} >/dev/null || :
fi
+
%files
%defattr(-,root,root,-)
%doc %{pear_docdir}/%{pear_name}
@@ -77,7 +100,11 @@ fi
%{pear_phpdir}/Horde/Http.php
%{pear_testdir}/Horde_Http
+
%changelog
+* Mon Nov 5 2012 Remi Collet <RPMS@FamilleCollet.com> - 2.0.0-2
+- make test optionnal
+
* Thu Nov 1 2012 Remi Collet <RPMS@FamilleCollet.com> - 2.0.0-1
- Update to 2.0.0 for remi repo