f3d4388
# spec file for php-phpunit-exporter
f3d4388
#
b89d4d7
# Copyright (c) 2013-2015 Remi Collet
f3d4388
# License: CC-BY-SA
f3d4388
# http://creativecommons.org/licenses/by-sa/3.0/
f3d4388
#
f3d4388
# Please, preserve the changelog entries
f3d4388
#
f480bd0
%global bootstrap    0
b89d4d7
%global gh_commit    35ab8d385eef068186c83e23ae83c96b0288b3ee
ef40a94
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
ef40a94
%global gh_owner     sebastianbergmann
ef40a94
%global gh_project   exporter
ef40a94
%global php_home     %{_datadir}/php/SebastianBergmann/
f3d4388
%global pear_name    Exporter
f3d4388
%global pear_channel pear.phpunit.de
f480bd0
%if %{bootstrap}
ef40a94
%global with_tests   %{?_with_tests:1}%{!?_with_tests:0}
f480bd0
%else
f480bd0
%global with_tests   %{?_without_tests:0}%{!?_without_tests:1}
f480bd0
%endif
f3d4388
f3d4388
Name:           php-phpunit-exporter
b89d4d7
Version:        1.1.0
f480bd0
Release:        1%{?dist}
f3d4388
Summary:        Export PHP variables for visualization
f3d4388
f3d4388
Group:          Development/Libraries
f3d4388
License:        BSD
ef40a94
URL:            https://github.com/%{gh_owner}/%{gh_project}
ef40a94
Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}.tar.gz
f3d4388
f3d4388
BuildArch:      noarch
f3d4388
BuildRequires:  php(language) >= 5.3.3
ef40a94
BuildRequires:  %{_bindir}/phpab
ef40a94
%if %{with_tests}
ef40a94
BuildRequires:  %{_bindir}/phpunit
b89d4d7
BuildRequires:  php-composer(sebastian/recursion-context) >= 1.0
ef40a94
%endif
f3d4388
1cbf579
# from composer.json
b89d4d7
#         "php": ">=5.3.3"
b89d4d7
#         "sebastian/recursion-context": "~1.0"
f3d4388
Requires:       php(language) >= 5.3.3
b89d4d7
Requires:       php-composer(sebastian/recursion-context) >= 1.0
b89d4d7
Requires:       php-composer(sebastian/recursion-context) <  2
ef40a94
# from phpcompatinfo report for version 1.0.0
f3d4388
Requires:       php-hash
f3d4388
Requires:       php-pcre
f3d4388
Requires:       php-spl
f3d4388
1cbf579
Provides:       php-composer(sebastian/exporter) = %{version}
1cbf579
ef40a94
# For compatibility, to drop when no more required
ef40a94
# Currently used by phpcpd and phploc
f3d4388
Provides:       php-pear(%{pear_channel}/%{pear_name}) = %{version}
ef40a94
f3d4388
# Package have be renamed
f3d4388
Obsoletes:      php-phpunit-Exporter < 1.0.0-2
ef40a94
Provides:       php-phpunit-Exporter = %{version}
f3d4388
f3d4388
f3d4388
%description
f3d4388
Provides the functionality to export PHP variables for visualization.
f3d4388
f3d4388
f3d4388
%prep
ef40a94
%setup -q -n %{gh_project}-%{gh_commit}
f3d4388
f3d4388
f3d4388
%build
ef40a94
# Generate the Autoloader (which was part of the Pear package)
ef40a94
phpab --output src/autoload.php src
f3d4388
b89d4d7
# Add dependency
b89d4d7
echo "require_once 'SebastianBergmann/RecursionContext/autoload.php';" \
b89d4d7
    >> src/autoload.php
b89d4d7
f3d4388
f3d4388
%install
ef40a94
mkdir -p   %{buildroot}%{php_home}
b89d4d7
cp -pr src %{buildroot}%{php_home}/Exporter
f3d4388
f3d4388
ef40a94
%if %{with_tests}
ef40a94
%check
ef40a94
phpunit \
b89d4d7
  --include-path %{buildroot}%{_datadir}/php \
b89d4d7
  --bootstrap %{buildroot}%{php_home}/Exporter/autoload.php
ef40a94
%endif
f3d4388
f3d4388
1254219
%post
1254219
if [ -x %{_bindir}/pear ]; then
1254219
   %{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \
1254219
      %{pear_channel}/%{pear_name} >/dev/null || :
1254219
fi
1254219
f3d4388
f3d4388
%files
1cbf579
%doc README.md composer.json
1cbf579
%{!?_licensedir:%global license %%doc}
1cbf579
%license LICENSE
b89d4d7
%{php_home}/Exporter
f3d4388
f3d4388
f3d4388
%changelog
b89d4d7
* Sat Jan 24 2015 Remi Collet <remi@fedoraproject.org> - 1.1.0-1
b89d4d7
- update to 1.1.0
b89d4d7
- add dependency on sebastian/recursion-context
b89d4d7
f480bd0
* Sun Oct  5 2014 Remi Collet <remi@fedoraproject.org> - 1.0.2-1
f480bd0
- update to 1.0.2
f480bd0
- enable test suite
f480bd0
1cbf579
* Fri Jul 18 2014 Remi Collet <remi@fedoraproject.org> - 1.0.1-4
1cbf579
- add composer dependencies
1cbf579
d95cb7a
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-3
d95cb7a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
d95cb7a
1254219
* Wed Apr 30 2014 Remi Collet <remi@fedoraproject.org> - 1.0.1-2
1254219
- cleanup pear registry
1254219
ef40a94
* Sun Apr  6 2014 Remi Collet <remi@fedoraproject.org> - 1.0.1-1
ef40a94
- update to 1.0.1
ef40a94
- get sources from github
ef40a94
- run test suite when build --with tests
ef40a94
f3d4388
* Sun Oct 20 2013 Remi Collet <remi@fedoraproject.org> - 1.0.0-2
f3d4388
- rename to lowercase
f3d4388
f3d4388
* Thu Sep 12 2013 Remi Collet <remi@fedoraproject.org> - 1.0.0-1
1254219
- initial package