c0893ee
# remirepo/fedora spec file for php-doctrine-instantiator
2f68846
#
16f9dfb
# Copyright (c) 2014-2015 Remi Collet
2f68846
# License: CC-BY-SA
c0893ee
# http://creativecommons.org/licenses/by-sa/4.0/
2f68846
#
2f68846
# Please, preserve the changelog entries
2f68846
#
2f68846
2f68846
# bootstrap needed when rebuilding PHPUnit for new major version
2f68846
%global bootstrap    0
c0893ee
%global gh_commit    8e884e78f9f0eb1329e445619e04456e64d8051d
2f68846
%global gh_short     %(c=%{gh_commit}; echo ${c:0:7})
2f68846
%global gh_owner     doctrine
2f68846
%global gh_project   instantiator
2f68846
%if %{bootstrap}
2f68846
%global with_tests   %{?_with_tests:1}%{!?_with_tests:0}
2f68846
%else
2f68846
%global with_tests   %{?_without_tests:0}%{!?_without_tests:1}
2f68846
%endif
2f68846
2f68846
Name:           php-doctrine-instantiator
c0893ee
Version:        1.0.5
6bcdd77
Release:        2%{?dist}
2f68846
Summary:        Instantiate objects in PHP without invoking their constructors
2f68846
2f68846
Group:          Development/Libraries
2f68846
License:        MIT
2f68846
URL:            https://github.com/%{gh_owner}/%{gh_project}
c0893ee
Source0:        https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
2f68846
2f68846
BuildArch:      noarch
16f9dfb
BuildRequires:  %{_bindir}/phpab
2f68846
%if %{with_tests}
4f6900b
BuildRequires:  php(language) >= 5.3
2f68846
BuildRequires:  php-phar
2f68846
BuildRequires:  php-pdo
2f68846
BuildRequires:  php-reflection
16f9dfb
BuildRequires:  %{_bindir}/phpunit
2f68846
%endif
2f68846
2f68846
# From composer.json
c0893ee
#        "php": ">=5.3,<8.0-DEV"
4f6900b
Requires:       php(language) >= 5.3
c0893ee
# From phpcompatinfo report for version 1.0.5
2f68846
Requires:       php-reflection
2f68846
2f68846
Provides:       php-composer(doctrine/instantiator) = %{version}
2f68846
2f68846
2f68846
%description
2f68846
This library provides a way of avoiding usage of constructors when
2f68846
instantiating PHP classes.
2f68846
2f68846
2f68846
%prep
2f68846
%setup -q -n %{gh_project}-%{gh_commit}
2f68846
2f68846
2f68846
%build
16f9dfb
: Generate a simple autoloader
16f9dfb
%{_bindir}/phpab \
16f9dfb
    --output src/Doctrine/Instantiator/autoload.php \
16f9dfb
    src/Doctrine/Instantiator
2f68846
2f68846
2f68846
%install
2f68846
mkdir -p     %{buildroot}%{_datadir}/php
2f68846
cp -pr src/* %{buildroot}%{_datadir}/php
2f68846
2f68846
2f68846
%check
2f68846
%if %{with_tests}
c0893ee
# "src" directory only needed for EPEL-6
2f68846
: Generate autoloader
2f68846
%{_bindir}/phpab \
2f68846
    --basedir $PWD \
2f68846
    --output autoload.php \
2f68846
    src tests
2f68846
16f9dfb
sed -e '/log/d' phpunit.xml.dist >phpunit.xml
2f68846
c0893ee
# "pear" directory only needed for EPEL-6
2f68846
: Run test suite
c0893ee
%{_bindir}/php \
c0893ee
    -d include_path=".:%{buildroot}%{_datadir}/php:%{_datadir}/pear:%{_datadir}/php" \
c0893ee
    %{_bindir}/phpunit \
c0893ee
        --include-path=%{buildroot}%{_datadir}/php \
c0893ee
        --bootstrap autoload.php \
c0893ee
        --verbose
2f68846
%else
2f68846
: Test suite disabled
2f68846
%endif
2f68846
2f68846
2f68846
%files
2f68846
%{!?_licensedir:%global license %%doc}
2f68846
%license LICENSE
2f68846
%doc *.md composer.json
2f68846
%dir %{_datadir}/php/Doctrine
c0893ee
     %{_datadir}/php/Doctrine/Instantiator
2f68846
2f68846
2f68846
%changelog
6bcdd77
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.5-2
6bcdd77
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
6bcdd77
c0893ee
* Mon Jun 15 2015 Remi Collet <remi@fedoraproject.org> - 1.0.5-1
c0893ee
- update to 1.0.5
c0893ee
- improve test suite during the build
c0893ee
16f9dfb
* Fri Feb 13 2015 Remi Collet <remi@fedoraproject.org> - 1.0.4-1
16f9dfb
- update to 1.0.4 (no change)
16f9dfb
- add autoloader
16f9dfb
4f6900b
* Sun Oct  5 2014 Remi Collet <remi@fedoraproject.org> - 1.0.3-1
4f6900b
- update to 1.0.3
4f6900b
2f68846
* Mon Aug 25 2014 Remi Collet <remi@fedoraproject.org> - 1.0.2-1
2f68846
- initial package, version 1.0.2