summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2012-11-05 18:45:55 +0100
committerRemi Collet <fedora@famillecollet.com>2012-11-05 18:45:55 +0100
commit04581d8b590f8cd0602d7090627052a9390f954b (patch)
tree4cfb61d2f979d0548d07395eb81bded8271fbc7c
parentea31e9167c8723cc6f000cd1a0b45d22251a8809 (diff)
php-horde-Horde-Log: cleanups + test
-rw-r--r--php-horde-Horde-Log.spec29
1 files changed, 28 insertions, 1 deletions
diff --git a/php-horde-Horde-Log.spec b/php-horde-Horde-Log.spec
index 6731e7d..953fc59 100644
--- a/php-horde-Horde-Log.spec
+++ b/php-horde-Horde-Log.spec
@@ -3,6 +3,9 @@
%global pear_name Horde_Log
%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-Log
Version: 2.0.0
Release: 2%{?dist}
@@ -15,20 +18,33 @@ Source0: http://pear.horde.org/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-date
+Requires: php-pcre
+Requires: php-reflection
+Requires: php-spl
+BuildRequires: php-pear(PEAR) >= 1.7.0
Requires: php-channel(%{pear_channel})
Requires: php-pear(%{pear_channel}/Horde_Constraint) >= 2.0.0
Conflicts: php-pear(%{pear_channel}/Horde_Constraint) >= 3.0.0
Requires: php-pear(%{pear_channel}/Horde_Exception) >= 2.0.0
Conflicts: php-pear(%{pear_channel}/Horde_Exception) >= 3.0.0
+# Optionnal
+Requires: php-dom
+# TODO Horde_Scribe
Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
+
%description
Horde Logging package with configurable handlers, filters, and formatting.
@@ -56,6 +72,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 || :
@@ -75,6 +101,7 @@ fi
%{pear_phpdir}/Horde/Log.php
%{pear_testdir}/Horde_Log
+
%changelog
* Thu Nov 1 2012 Remi Collet <RPMS@FamilleCollet.com> - 2.0.0-1
- Update to 2.0.0 for remi repo