summaryrefslogtreecommitdiffstats
path: root/php-phpunit-exporter.spec
diff options
context:
space:
mode:
Diffstat (limited to 'php-phpunit-exporter.spec')
-rw-r--r--php-phpunit-exporter.spec84
1 files changed, 41 insertions, 43 deletions
diff --git a/php-phpunit-exporter.spec b/php-phpunit-exporter.spec
index 9c6135b..139b2ea 100644
--- a/php-phpunit-exporter.spec
+++ b/php-phpunit-exporter.spec
@@ -6,39 +6,45 @@
#
# 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
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
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}
@@ -49,56 +55,48 @@ 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
-rm -rf %{buildroot}
-cd %{pear_name}-%{version}
-%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
+rm -rf %{buildroot}
+mkdir -p %{buildroot}%{php_home}
+cp -pr src %{buildroot}%{php_home}/%{pear_name}
-# Clean up unnecessary files
-rm -rf %{buildroot}%{pear_metadir}/.??*
-# 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
%clean
rm -rf %{buildroot}
-%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
%defattr(-,root,root,-)
-%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@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@fedoraproject.org> - 1.0.0-2
- rename to lowercase
* Thu Sep 12 2013 Remi Collet <remi@fedoraproject.org> - 1.0.0-1
-- initial package
+- initial package \ No newline at end of file