summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--php-horde-Horde-Exception.spec35
1 files changed, 28 insertions, 7 deletions
diff --git a/php-horde-Horde-Exception.spec b/php-horde-Horde-Exception.spec
index 62483c0..f9286c8 100644
--- a/php-horde-Horde-Exception.spec
+++ b/php-horde-Horde-Exception.spec
@@ -3,36 +3,48 @@
%global pear_name Horde_Exception
%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-Exception
Version: 2.0.0
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Horde Exception Handler
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: gettext
BuildRequires: php-pear(PEAR) >= 1.7.0
BuildRequires: php-channel(%{pear_channel})
-BuildRequires: gettext
+%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-spl
Requires: php-pear(PEAR) >= 1.7.0
+Requires: php-channel(%{pear_channel})
Requires: php-pear(%{pear_channel}/Horde_Translation) >= 2.0.0
Conflicts: php-pear(%{pear_channel}/Horde_Translation) >= 3.0.0
Provides: php-pear(%{pear_channel}/Horde_Exception) = %{version}
+
%description
This class provides the default exception handlers for the Horde
Application Framework.
+
%prep
%setup -q -c -T
tar xif %{SOURCE0}
@@ -45,6 +57,7 @@ sed -e '/%{pear_name}.po/d' \
-e '/%{pear_name}.mo/s/md5sum=.*name=/name=/' \
../package.xml >%{name}.xml
+
%build
cd %{pear_name}-%{version}
# Empty build section, most likely nothing required.
@@ -55,8 +68,8 @@ do
msgfmt $po -o $(dirname $po)/$(basename $po .po).mo
done
+
%install
-rm -rf %{buildroot}
cd %{pear_name}-%{version}
%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
@@ -72,11 +85,15 @@ install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
%else
sh %{SOURCE1} %{buildroot} %{pear_name}
%endif
-cat %{pear_name}.lang
-%clean
-rm -rf %{buildroot}
+%check
+%if %{with_tests}
+cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g)
+phpunit AllTests.php
+%else
+: Test disabled, missing '--with tests' option.
+%endif
%post
@@ -103,7 +120,11 @@ fi
%dir %{pear_datadir}/Horde_Exception/locale/*/LC_MESSAGES
%{pear_testdir}/Horde_Exception
+
%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