summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-horde-Horde-Support.spec27
1 files changed, 26 insertions, 1 deletions
diff --git a/php-horde-Horde-Support.spec b/php-horde-Horde-Support.spec
index 72eb7f9..f5dca24 100644
--- a/php-horde-Horde-Support.spec
+++ b/php-horde-Horde-Support.spec
@@ -3,9 +3,12 @@
%global pear_name Horde_Support
%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-Support
Version: 2.0.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Horde support package
Group: Development/Libraries
@@ -17,6 +20,10 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
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}
@@ -27,6 +34,8 @@ Conflicts: php-pear(%{pear_channel}/Horde_Stream_Wrapper) >= 3.0.0
Requires: php(language) >= 5.3.0
Requires: php-channel(%{pear_channel})
Requires: php-date php-pcre php-spl
+# designed to work with php-pecl-uuid, not uuid-php
+Conflicts: uuid-php
Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
@@ -57,6 +66,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 || :
@@ -67,6 +86,7 @@ if [ $1 -eq 0 ] ; then
%{pear_channel}/%{pear_name} >/dev/null || :
fi
+
%files
%defattr(-,root,root,-)
%doc %{pear_docdir}/%{pear_name}
@@ -74,7 +94,12 @@ fi
%{pear_phpdir}/Horde/Support
%{pear_testdir}/%{pear_name}
+
%changelog
+* Sun Nov 4 2012 Remi Collet <RPMS@FamilleCollet.com> - 2.0.0-2
+- conflicts with uuid-php
+- add optionnal %%check
+
* Thu Nov 1 2012 Remi Collet <RPMS@FamilleCollet.com> - 2.0.0-1
- Update to 2.0.0 for remi repo