summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2012-11-05 18:26:00 +0100
committerRemi Collet <fedora@famillecollet.com>2012-11-05 18:26:00 +0100
commita51ed5b3a9af8f2cca72301a02ad482b754a382a (patch)
tree0fb4bea7d9bab85f4dc36635c6a471f15e9107b6
parentafb11b521e7c35317172ba2299673907d8baf496 (diff)
php-horde-Horde-Date: cleanups + tests
-rw-r--r--php-horde-Horde-Date.spec38
1 files changed, 33 insertions, 5 deletions
diff --git a/php-horde-Horde-Date.spec b/php-horde-Horde-Date.spec
index ed6b53b..c053e44 100644
--- a/php-horde-Horde-Date.spec
+++ b/php-horde-Horde-Date.spec
@@ -3,28 +3,39 @@
%global pear_name Horde_Date
%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-Date
Version: 2.0.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Horde Date package
Group: Development/Libraries
License: LGPLv2+
URL: http://pear.horde.org
-Source0: http://pear.horde.org/get/%{pear_name}-%{version}.tgz
+Source0: http://%{pear_channel}/get/%{pear_name}-%{version}.tgz
# /usr/lib/rpm/find-lang.sh from fedora 16
Source1: find-lang.sh
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildArch: noarch
-
-BuildRequires: php-pear
-BuildRequires: php-channel(%{pear_channel})
BuildRequires: gettext
+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-date
+Requires: php-pcre
+Requires: php-spl
+BuildRequires: php-pear(PEAR) >= 1.7.0
+Requires: php-channel(%{pear_channel})
Requires: php-pear(%{pear_channel}/Horde_Nls) >= 2.0.0
Conflicts: php-pear(%{pear_channel}/Horde_Nls) >= 3.0.0
Requires: php-pear(%{pear_channel}/Horde_Translation) >= 2.0.0
@@ -33,9 +44,14 @@ 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_Util) >= 2.0.0
Conflicts: php-pear(%{pear_channel}/Horde_Util) >= 3.0.0
+# Optionnal
+Requires: php-calendar
+Requires: php-pear(%{pear_channel}/Horde_Icalendar) >= 2.0.0
+Conflicts: php-pear(%{pear_channel}/Horde_Icalendar) >= 3.0.0
Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
+
%description
Package for creating and manipulating dates.
@@ -80,6 +96,15 @@ sh %{SOURCE1} %{buildroot} %{pear_name}
%endif
+%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 || :
@@ -105,6 +130,9 @@ fi
%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