diff options
author | Remi Collet <fedora@famillecollet.com> | 2017-02-17 17:23:45 +0100 |
---|---|---|
committer | Remi Collet <fedora@famillecollet.com> | 2017-02-17 17:23:45 +0100 |
commit | f5fe6edc1bfb8ad4bd8a25df3cb7dc029fdcd592 (patch) | |
tree | 5577537cd10c8cd44a4433e0497889f90d6153aa /php-hamcrest.spec | |
parent | c113e48d8776866d0da1fcd88d9f7af9914289ed (diff) |
Diffstat (limited to 'php-hamcrest.spec')
-rw-r--r-- | php-hamcrest.spec | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/php-hamcrest.spec b/php-hamcrest.spec index 673893b..3742c53 100644 --- a/php-hamcrest.spec +++ b/php-hamcrest.spec @@ -14,7 +14,7 @@ Name: php-hamcrest Version: 1.2.2 -Release: 1%{?dist} +Release: 4%{?dist} Summary: PHP port of Hamcrest Matchers Group: Development/Libraries @@ -24,10 +24,12 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit # Use generated autoloader instead of composer one Patch0: bootstrap-autoload.patch +# Upstream patch for PHP 7+ +Patch1: %{name}-upstream.patch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch -BuildRequires: php-composer(theseer/autoload) +BuildRequires: php-fedora-autoloader-devel %if %{with_tests} BuildRequires: php-composer(phpunit/phpunit) # composer.json @@ -44,6 +46,8 @@ Requires: php(language) >= 5.3.2 Requires: php-dom Requires: php-pcre Requires: php-spl +# Autoloader +Requires: php-composer(fedora/autoloader) Provides: php-composer(hamcrest/hamcrest-php) = %{version} @@ -64,6 +68,8 @@ To use this library, you just have to add, in your project: %setup -q -n %{gh_project}-%{gh_commit} %patch0 -p0 -b .rpm +%patch1 -p1 -b .upstream +find . -name \*.upstream -exec rm {} \; # Move to Library tree mv hamcrest/Hamcrest.php hamcrest/Hamcrest/Hamcrest.php @@ -72,6 +78,7 @@ mv hamcrest/Hamcrest.php hamcrest/Hamcrest/Hamcrest.php %build # Library autoloader %{_bindir}/phpab \ + --template fedora \ --output hamcrest/Hamcrest/autoload.php \ hamcrest/Hamcrest @@ -97,7 +104,13 @@ cp -pr hamcrest/* %{buildroot}%{_datadir}/php %check %if %{with_tests} cd tests -%{_bindir}/phpunit --verbose +ret=0 +for cmd in php56 php70 php71 php; do + if which $cmd; then + $cmd %{_bindir}/phpunit --verbose || ret=1 + fi +done +exit $ret %else : Test suite disabled %endif @@ -117,8 +130,12 @@ rm -rf %{buildroot} %changelog +* Fri Feb 17 2017 Remi Collet <remi@fedoraproject.org> - 1.2.2-4 +- add upstream patch for PHP 7, fix FTBFS +- switch to fedora/autoloader + * Thu Oct 15 2015 Remi Collet <remi@fedoraproject.org> - 1.2.2-1 - update to 1.2.2 * Mon Jan 5 2015 Remi Collet <remi@fedoraproject.org> - 1.2.0-1 -- initial package
\ No newline at end of file +- initial package |