summaryrefslogtreecommitdiffstats
path: root/php-mock-integration/php-mock-integration.spec
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-05-11 07:29:07 +0200
committerRemi Collet <remi@remirepo.net>2017-05-11 07:29:07 +0200
commit1fd4a038b3ffb546cbd395b7ccea918875dbe605 (patch)
tree2b375a44cac682bd05dd495c15bac63090dc3692 /php-mock-integration/php-mock-integration.spec
parent7360e1427a7917692cc64c6dd1a7159fbf281d6f (diff)
switch to fedora/autoloaderHEADmaster
Diffstat (limited to 'php-mock-integration/php-mock-integration.spec')
-rw-r--r--php-mock-integration/php-mock-integration.spec33
1 files changed, 18 insertions, 15 deletions
diff --git a/php-mock-integration/php-mock-integration.spec b/php-mock-integration/php-mock-integration.spec
index 6ad3362..845ee0d 100644
--- a/php-mock-integration/php-mock-integration.spec
+++ b/php-mock-integration/php-mock-integration.spec
@@ -14,7 +14,7 @@
Name: php-mock-integration
Version: 1.0.0
-Release: 2%{?dist}
+Release: 4%{?dist}
Summary: Integration package for PHP-Mock
Group: Development/Libraries
@@ -22,15 +22,18 @@ License: WTFPL
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php(language) >= 5.5
%if %{with_tests}
# from composer.json, "require-dev": {
# "phpunit/phpunit": "^4|^5"
+BuildRequires: php-composer(php-mock/php-mock) < 2
BuildRequires: php-composer(php-mock/php-mock) >= 1
+BuildRequires: php-composer(phpunit/php-text-template) < 2
BuildRequires: php-composer(phpunit/php-text-template) >= 1
BuildRequires: php-composer(phpunit/phpunit) > 4
+# For autoloader
+BuildRequires: php-composer(fedora/autoloader)
%endif
# from composer.json, "require": {
@@ -63,7 +66,6 @@ This is a support package for PHP-Mock integration into other frameworks.
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{_datadir}/php/
mkdir -p %{buildroot}%{_datadir}/php/phpmock
cp -pr classes %{buildroot}%{_datadir}/php/phpmock/integration
@@ -74,26 +76,24 @@ cp -pr classes %{buildroot}%{_datadir}/php/phpmock/integration
mkdir vendor
cat << 'EOF' | tee vendor/autoload.php
<?php
+require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
require_once '%{_datadir}/tests/phpmock/autoload.php';
-$fedoraClassLoader->addPrefix('phpmock\\', '%{buildroot}%{_datadir}/php');
+\Fedora\Autoloader\Autoload::addPsr4('phpmock\\', '%{buildroot}%{_datadir}/php/phpmock');
EOF
-%{_bindir}/phpunit
-
-if which php70; then
- php70 %{_bindir}/phpunit
-fi
+ret=0
+for cmd in php php56 php70 php71 php72; do
+ if which $cmd; then
+ %{_bindir}/phpunit --verbose || ret=1
+ fi
+done
+exit $ret
%else
: bootstrap build with test suite disabled
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc composer.json
@@ -102,8 +102,11 @@ rm -rf %{buildroot}
%changelog
+* Thu May 11 2017 Remi Collet <remi@remirepo.net> - 1.0.0-4
+- switch to fedora/autoloader
+
* Mon Feb 22 2016 Remi Collet <remi@fedoraproject.org> - 1.0.0-2
- Fix: license is WTFPL
* Fri Feb 12 2016 Remi Collet <remi@fedoraproject.org> - 1.0.0-1
-- initial package \ No newline at end of file
+- initial package