[php-horde-Horde-Stream-Wrapper/epel7] - Update to 2.1.0 - Add tests, only run when build --with tests - License is now BSD - spec cleanups

Remi Collet remi at fedoraproject.org
Tue Feb 11 13:24:32 UTC 2014


commit 92019bf6a5e31f51ed6611b4a91a5efd19068ca3
Author: Remi Collet <remi at fedoraproject.org>
Date:   Tue Feb 11 14:24:37 2014 +0100

    - Update to 2.1.0
    - Add tests, only run when build --with tests
    - License is now BSD
    - spec cleanups

 .gitignore                          |    1 +
 php-horde-Horde-Stream-Wrapper.spec |   79 +++++++++++++++++++++++++---------
 sources                             |    2 +-
 3 files changed, 60 insertions(+), 22 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 005bbd1..fff0752 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 /Horde_Stream_Wrapper-1.0.1.tgz
 /Horde_Stream_Wrapper-2.0.1.tgz
+/Horde_Stream_Wrapper-2.1.0.tgz
diff --git a/php-horde-Horde-Stream-Wrapper.spec b/php-horde-Horde-Stream-Wrapper.spec
index 68ede88..5dafeb2 100644
--- a/php-horde-Horde-Stream-Wrapper.spec
+++ b/php-horde-Horde-Stream-Wrapper.spec
@@ -1,59 +1,87 @@
-%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
+# spec file for php-horde-Horde-Stream-Wrapper
+#
+# Copyright (c) 2012-2014 Nick Bebout, Remi Collet
+#
+# License: MIT
+# https://fedoraproject.org/wiki/Licensing:MIT#Modern_Style_with_sublicense
+#
+# Please, preserve the changelog entries
+#
+%{!?__pear:       %global __pear       %{_bindir}/pear}
 %{!?pear_metadir: %global pear_metadir %{pear_phpdir}}
-%global pear_name Horde_Stream_Wrapper
+%global pear_name    Horde_Stream_Wrapper
 %global pear_channel pear.horde.org
+# Disable because of circular dependency with Horde_Test
+%global with_tests   %{?_with_tests:1}%{!?_with_tests:0}
 
 Name:           php-horde-Horde-Stream-Wrapper
-Version:        2.0.1
-Release:        2%{?dist}
+Version:        2.1.0
+Release:        1%{?dist}
 Summary:        Horde Stream wrappers
 
 Group:          Development/Libraries
-License:        LGPLv2+
+License:        BSD
 URL:            http://pear.horde.org
-Source0:        http://pear.horde.org/get/%{pear_name}-%{version}.tgz
+Source0:        http://%{pear_channel}/get/%{pear_name}-%{version}.tgz
 
 BuildArch:      noarch
-
-Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
-
+BuildRequires:  php(language) >= 5.3.0
 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.1.0
+%endif
 
 Requires(post): %{__pear}
 Requires(postun): %{__pear}
-Requires:       php-channel(%{pear_channel})
-Requires:       php-common >= 5.3.0
+Requires:       php(language) >= 5.3.0
+Requires:       php-spl
 Requires:       php-pear(PEAR) >= 1.7.0
+Requires:       php-channel(%{pear_channel})
+
+Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
+
 
 %description
 This package provides various stream wrappers.
 
 %prep
 %setup -q -c
-[ -f package2.xml ] || mv package.xml package2.xml
-mv package2.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}
+mv ../package.xml %{name}.xml
+
 
 %build
 cd %{pear_name}-%{version}
 # Empty build section, most likely nothing required.
 
+
 %install
 cd %{pear_name}-%{version}
-PHPRC=../php.ini %{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
+%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
 
 # Clean up unnecessary files
-rm -rf $RPM_BUILD_ROOT%{pear_metadir}/.??*
+rm -rf %{buildroot}%{pear_metadir}/.??*
 
 # Install XML package description
-mkdir -p $RPM_BUILD_ROOT%{pear_xmldir}
-install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
+mkdir -p %{buildroot}%{pear_xmldir}
+install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
+
+
+%check
+%if %{with_tests}
+src=$(pwd)/%{pear_name}-%{version}
+cd %{pear_name}-%{version}/test/$(echo %{pear_name} | sed -e s:_:/:g)
+phpunit \
+    -d include_path=$src/lib:.:%{pear_phpdir} \
+    -d date.timezone=UTC \
+    .
+%else
+: Tests disabled, use --with tests to enable them
+%endif
+
 
 %post
 %{__pear} install --nodeps --soft --force --register-only \
@@ -65,12 +93,21 @@ if [ $1 -eq 0 ] ; then
         %{pear_channel}/%{pear_name} >/dev/null || :
 fi
 
+
 %files
 %{pear_xmldir}/%{name}.xml
 %{pear_phpdir}/Horde
 %doc %{pear_docdir}/%{pear_name}
+%{pear_testdir}/%{pear_name}
+
 
 %changelog
+* Tue Feb 11 2014 Remi Collet <remi at fedoraproject.org> - 2.1.0-1
+- Update to 2.1.0
+- Add tests, only run when build --with tests
+- License is now BSD
+- spec cleanups
+
 * Thu Feb 14 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 2.0.1-2
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
 
diff --git a/sources b/sources
index 5a3e71b..b7dd7d2 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-ddc3ebfb474d80d5f1c12ca7fad3f00e  Horde_Stream_Wrapper-2.0.1.tgz
+2fd063c1204e15dad6f5989f75d2e3e3  Horde_Stream_Wrapper-2.1.0.tgz


More information about the scm-commits mailing list