summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--composer.json33
-rw-r--r--php-phpunit-diff.spec63
3 files changed, 76 insertions, 27 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..1ab5c4f
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,7 @@
+package-*.xml
+*.tgz
+*.tar.gz
+*.tar.xz
+*.tar.xz.asc
+*.src.rpm
+*/*rpm
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..8f2bcf3
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,33 @@
+{
+ "name": "sebastian/diff",
+ "description": "Diff implementation",
+ "keywords": ["diff"],
+ "homepage": "https://github.com/sebastianbergmann/diff",
+ "license": "BSD-3-Clause",
+ "authors": [
+ {
+ "name": "Sebastian Bergmann",
+ "email": "sebastian@phpunit.de"
+ },
+ {
+ "name": "Kore Nordmann",
+ "email": "mail@kore-nordmann.de"
+ }
+ ],
+ "require": {
+ "php": "^5.3.3 || ^7.0"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
+ },
+ "autoload": {
+ "classmap": [
+ "src/"
+ ]
+ },
+ "extra": {
+ "branch-alias": {
+ "dev-master": "1.4-dev"
+ }
+ }
+}
diff --git a/php-phpunit-diff.spec b/php-phpunit-diff.spec
index d987ecc..a4cf508 100644
--- a/php-phpunit-diff.spec
+++ b/php-phpunit-diff.spec
@@ -7,7 +7,7 @@
# Please, preserve the changelog entries
#
%global bootstrap 0
-%global gh_commit 13edfd8706462032c2f52b4b862974dd46b71c9e
+%global gh_commit 3c7d21999e815cdfac70c6c7d79d3a9cb1bc7bc2
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner sebastianbergmann
%global gh_project diff
@@ -21,32 +21,39 @@
%endif
Name: php-phpunit-diff
-Version: 1.4.1
+Version: 1.4.2
Release: 1%{?dist}
Summary: Diff implementation
Group: Development/Libraries
License: BSD
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
+Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php(language) >= 5.3.3
-BuildRequires: %{_bindir}/phpab
+BuildRequires: php-fedora-autoloader-devel
%if %{with_tests}
# from composer.json, "require-dev": {
-# "phpunit/phpunit": "~4.8"
+# "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0"
# min version ignored
-BuildRequires: php-composer(phpunit/phpunit)
+BuildRequires: php(language) >= %{php_min_ver}
+%if 0%{?fedora} >= 26
+%global phpunit %{_bindir}/phpunit6
+%else
+%global phpunit %{_bindir}/phpunit
+%endif
+BuildRequires: %{phpunit}
%endif
# from composer.json
-# "php": ">=5.3.3"
+# "php": "^5.3.3 || ^7.0"
Requires: php(language) >= 5.3.3
# from phpcompatinfo report for version 1.1.0
Requires: php-pcre
Requires: php-spl
+# Autoloader
+Requires: php-composer(fedora/autoloader) >= 1.0.0
Provides: php-composer(sebastian/diff) = %{version}
@@ -63,37 +70,35 @@ Diff implementation.
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-# Restore PSR-0 tree
-mkdir SebastianBergmann
-mv src SebastianBergmann/Diff
-
%build
phpab \
- --output SebastianBergmann/Diff/autoload.php \
- SebastianBergmann/Diff
+ --template fedora2 \
+ --output src/autoload.php \
+ src
%install
-rm -rf %{buildroot}
-mkdir -p %{buildroot}%{php_home}/SebastianBergmann
-cp -pr SebastianBergmann/Diff \
- %{buildroot}%{php_home}/SebastianBergmann/Diff
+mkdir -p %{buildroot}%{php_home}/SebastianBergmann
+cp -pr src %{buildroot}%{php_home}/SebastianBergmann/Diff
%if %{with_tests}
%check
-%{_bindir}/phpunit --bootstrap SebastianBergmann/Diff/autoload.php
-
-if which php70; then
- php70 %{_bindir}/phpunit --bootstrap SebastianBergmann/Diff/autoload.php
-fi
+ret=0
+for cmd in "php %{phpunit}" %{?rhel:php54 php55} php56 php70 "php71 %{_bindir}/phpunit6" "php72 %{_bindir}/phpunit6"; do
+ set $cmd
+ if which $cmd; then
+ $1 -d include_path=.:%{buildroot}%{phpdir}:%{phpdir}:%{_datadir}/pear \
+ ${2:-%{_bindir}/phpunit} \
+ --bootstrap %{buildroot}%{php_home}/SebastianBergmann/Diff/autoload.php \
+ --verbose || ret=1
+ fi
+done
+exit $ret
%endif
-%clean
-rm -rf %{buildroot}
-
%post
if [ -x %{_bindir}/pear ]; then
%{_bindir}/pear uninstall --nodeps --ignore-errors --register-only \
@@ -102,7 +107,6 @@ fi
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc README.md composer.json
@@ -112,6 +116,11 @@ fi
%changelog
+* Mon May 22 2017 Remi Collet <remi@remirepo.net> - 1.4.2-1
+- Update to 1.4.2
+- switch to fedora/autoloader
+- use PHPUnit 6 when available
+
* Sun Dec 6 2015 Remi Collet <remi@fedoraproject.org> - 1.4.0-1
- update to 1.4.1 (no change)
- run test suite with both php 5 and 7 when available