[php-phpunit-exporter] - update to 1.0.1 - get sources from github - run test suite when build --with tests

Remi Collet remi at fedoraproject.org
Wed Apr 23 07:33:14 UTC 2014


commit ef40a949ad5382d3f1bd3cd5415282021ea2d48a
Author: Remi Collet <remi at fedoraproject.org>
Date:   Wed Apr 23 09:33:04 2014 +0200

    - update to 1.0.1
    - get sources from github
    - run test suite when build --with tests

 .gitignore                |    1 +
 php-phpunit-exporter.spec |   85 ++++++++++++++++++++++-----------------------
 sources                   |    2 +-
 3 files changed, 44 insertions(+), 44 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index aad0fd7..a29527d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
 clog
 php-phpunit-exporter.spec~
 /Exporter-1.0.0.tgz
+/exporter-1.0.1.tar.gz
diff --git a/php-phpunit-exporter.spec b/php-phpunit-exporter.spec
index 1dd4db9..63d046a 100644
--- a/php-phpunit-exporter.spec
+++ b/php-phpunit-exporter.spec
@@ -1,46 +1,52 @@
 # spec file for php-phpunit-exporter
 #
-# Copyright (c) 2013 Remi Collet
+# Copyright (c) 2013-2014 Remi Collet
 # License: CC-BY-SA
 # http://creativecommons.org/licenses/by-sa/3.0/
 #
 # Please, preserve the changelog entries
 #
-%{!?pear_metadir: %global pear_metadir %{pear_phpdir}}
-%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
+%global gh_commit    1f9a98e6f5dfe0524cb8c6166f7c82f3e9ae1529
+%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
+%global gh_owner     sebastianbergmann
+%global gh_project   exporter
+%global php_home     %{_datadir}/php/SebastianBergmann/
 %global pear_name    Exporter
 %global pear_channel pear.phpunit.de
+# Circular dependency with phpunit
+%global with_tests   %{?_with_tests:1}%{!?_with_tests:0}
 
 Name:           php-phpunit-exporter
-Version:        1.0.0
-Release:        2%{?dist}
+Version:        1.0.1
+Release:        1%{?dist}
 Summary:        Export PHP variables for visualization
 
 Group:          Development/Libraries
 License:        BSD
-URL:            https://github.com/sebastianbergmann/exporter
-Source0:        http://%{pear_channel}/get/%{pear_name}-%{version}.tgz
+URL:            https://github.com/%{gh_owner}/%{gh_project}
+Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz
 
 BuildArch:      noarch
 BuildRequires:  php(language) >= 5.3.3
-BuildRequires:  php-pear(PEAR) >= 1.9.4
-BuildRequires:  php-channel(%{pear_channel})
+BuildRequires:  %{_bindir}/phpab
+%if %{with_tests}
+BuildRequires:  %{_bindir}/phpunit
+%endif
 
-Requires(post): %{__pear}
-Requires(postun): %{__pear}
 # from package.xml
 Requires:       php(language) >= 5.3.3
-Requires:       php-pear(PEAR) >= 1.9.4
-Requires:       php-channel(%{pear_channel})
-# from phpcompatinfo report for version 1.1.0
+# from phpcompatinfo report for version 1.0.0
 Requires:       php-hash
 Requires:       php-pcre
 Requires:       php-spl
 
+# For compatibility, to drop when no more required
+# Currently used by phpcpd and phploc
 Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
+
 # Package have be renamed
 Obsoletes:      php-phpunit-Exporter < 1.0.0-2
-Provides:       php-phpunit-Exporter = %{name}-%{version}
+Provides:       php-phpunit-Exporter = %{version}
 
 
 %description
@@ -48,50 +54,43 @@ Provides the functionality to export PHP variables for visualization.
 
 
 %prep
-%setup -q -c
-
-cd %{pear_name}-%{version}
-mv ../package.xml %{name}.xml
+%setup -q -n %{gh_project}-%{gh_commit}
 
 
 %build
-cd %{pear_name}-%{version}
-# Empty build section, most likely nothing required.
+# Generate the Autoloader (which was part of the Pear package)
+phpab --output src/autoload.php src
 
 
 %install
-cd %{pear_name}-%{version}
-%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
-
-# Clean up unnecessary files
-rm -rf %{buildroot}%{pear_metadir}/.??*
+mkdir -p   %{buildroot}%{php_home}
+cp -pr src %{buildroot}%{php_home}/%{pear_name}
 
-# Install XML package description
-mkdir -p %{buildroot}%{pear_xmldir}
-install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
 
+%if %{with_tests}
+%check
+phpunit \
+  --bootstrap src/autoload.php \
+  -d date.timezone=UTC
+%endif
 
-%post
-%{__pear} install --nodeps --soft --force --register-only \
-    %{pear_xmldir}/%{name}.xml >/dev/null || :
-
-%postun
-if [ $1 -eq 0 ] ; then
-    %{__pear} uninstall --nodeps --ignore-errors --register-only \
-        %{pear_channel}/%{pear_name} >/dev/null || :
-fi
 
 
 %files
-%doc %{pear_docdir}/%{pear_name}
-%{pear_xmldir}/%{name}.xml
-%dir %{pear_phpdir}/SebastianBergmann
-%{pear_phpdir}/SebastianBergmann/%{pear_name}
+%doc LICENSE README.md composer.json
+
+%dir %{php_home}
+%{php_home}/%{pear_name}
 
 
 %changelog
+* Sun Apr  6 2014 Remi Collet <remi at fedoraproject.org> - 1.0.1-1
+- update to 1.0.1
+- get sources from github
+- run test suite when build --with tests
+
 * Sun Oct 20 2013 Remi Collet <remi at fedoraproject.org> - 1.0.0-2
 - rename to lowercase
 
 * Thu Sep 12 2013 Remi Collet <remi at fedoraproject.org> - 1.0.0-1
-- initial package
+- initial package
\ No newline at end of file
diff --git a/sources b/sources
index 7d6dfca..6d616c4 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-4bda9081c7470985b2d7a7107b42af08  Exporter-1.0.0.tgz
+f354f3bd9f5bb220d74e34fe390c91ee  exporter-1.0.1.tar.gz


More information about the scm-commits mailing list