[php-pear-HTML-QuickForm-advmultiselect] clean spec + run phpunit in %check
Remi Collet
remi at fedoraproject.org
Tue Aug 31 17:35:28 UTC 2010
commit 0c085e15b2e16f759b0d900fefaac627c68a531e
Author: remi <fedora at famillecollet.com>
Date: Tue Aug 31 19:35:25 2010 +0200
clean spec + run phpunit in %check
.gitignore | 1 +
php-pear-HTML-QuickForm-advmultiselect.spec | 42 +++++++++++++++++++-------
2 files changed, 31 insertions(+), 12 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 26835f6..d7b2d87 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
HTML_QuickForm_advmultiselect-1.5.1.tgz
+package.xml
diff --git a/php-pear-HTML-QuickForm-advmultiselect.spec b/php-pear-HTML-QuickForm-advmultiselect.spec
index 2efbec1..ba82c95 100644
--- a/php-pear-HTML-QuickForm-advmultiselect.spec
+++ b/php-pear-HTML-QuickForm-advmultiselect.spec
@@ -1,9 +1,9 @@
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
-%define pear_name HTML_QuickForm_advmultiselect
+%global pear_name HTML_QuickForm_advmultiselect
Name: php-pear-HTML-QuickForm-advmultiselect
Version: 1.5.1
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Element for HTML_QuickForm that emulate a multi-select
Group: Development/Libraries
@@ -12,10 +12,16 @@ URL: http://pear.php.net/package/HTML_QuickForm_advmultiselect
Source0: http://pear.php.net/get/%{pear_name}-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
BuildArch: noarch
BuildRequires: php-pear(PEAR) >= 1.5.4
-Requires: php-pear(PEAR) >= 1.5.4, php-pear(HTML_QuickForm) >= 3.2.10, php-pear(HTML_Common) >= 1.2.5
+# For test suite
+BuildRequires: php-pear(pear.phpunit.de/PHPUnit)
+BuildRequires: php-pear(HTML_QuickForm) >= 3.2.10
+BuildRequires: php-pear(HTML_Common) >= 1.2.5
+
+Requires: php-pear(PEAR) >= 1.5.4,
+Requires: php-pear(HTML_QuickForm) >= 3.2.10
+Requires: php-pear(HTML_Common) >= 1.2.5
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides: php-pear(%{pear_name}) = %{version}
@@ -28,7 +34,13 @@ emulating a multi-select.
%prep
%setup -q -c
-mv package.xml %{pear_name}-%{version}/%{name}.xml
+# Create a "localized" php.ini to avoid build warning
+cp /etc/php.ini .
+echo "date.timezone=UTC" >>php.ini
+
+cd %{pear_name}-%{version}
+# package.xml is V2
+mv ../package.xml %{name}.xml
%build
@@ -38,7 +50,7 @@ mv package.xml %{pear_name}-%{version}/%{name}.xml
%install
cd %{pear_name}-%{version}
rm -rf $RPM_BUILD_ROOT docdir
-%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
+PHPRC=../php.ini %{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
# Move documentation
mv $RPM_BUILD_ROOT%{pear_docdir}/%{pear_name} ../docdir
@@ -70,12 +82,12 @@ fi
%check
-# yum install php-pear-Net-FTP
-# yum install php-pear-PHPUnit # (tested with 3.3.2)
-# cd /usr/share/pear/test/HTML_QuickForm_advmultiselect/tests
-# php AllTests.php
-# should display :
-# OK (21 tests, 62 assertions)
+cd %{pear_name}-%{version}/tests
+phpunit \
+ -d date.timezone=UTC \
+ -d include_path=$RPM_BUILD_ROOT%{pear_phpdir}:%{pear_phpdir} \
+ AllTests.php || :
+# Fails in mock : HTML_QuickForm_advmultiselect_TestSuite_Custom::testAms2MinimizedWithAnnotation
%files
@@ -86,7 +98,13 @@ fi
%{pear_phpdir}/HTML/QuickForm/advmultiselect.php
%{pear_testdir}/%{pear_name}
+
%changelog
+* Tue Aug 31 2010 Remi Collet <Fedora at FamilleCollet.com> - 1.5.1-3
+- clean define
+- set date.timezone during build
+- run phpunit during %%check (1 test fails for now)
+
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.5.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
More information about the scm-commits
mailing list