summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json8
-rw-r--r--phpcpd-rpm.patch11
-rw-r--r--phpcpd.spec76
3 files changed, 53 insertions, 42 deletions
diff --git a/composer.json b/composer.json
index 150f806..a7579ea 100644
--- a/composer.json
+++ b/composer.json
@@ -25,10 +25,10 @@
"require": {
"php": "^7.3",
"ext-dom": "*",
- "sebastian/finder-facade": "^2.0",
+ "sebastian/cli-parser": "^1.0",
"sebastian/version": "^3.0",
- "symfony/console": "^4.0|^5.0",
- "phpunit/php-timer": "^3.0"
+ "phpunit/php-file-iterator": "^3.0",
+ "phpunit/php-timer": "^5.0"
},
"autoload": {
"classmap": [
@@ -40,7 +40,7 @@
],
"extra": {
"branch-alias": {
- "dev-master": "5.0-dev"
+ "dev-master": "6.0-dev"
}
}
}
diff --git a/phpcpd-rpm.patch b/phpcpd-rpm.patch
index 0370cfe..98cd3f8 100644
--- a/phpcpd-rpm.patch
+++ b/phpcpd-rpm.patch
@@ -1,8 +1,8 @@
diff -up ./phpcpd.rpm ./phpcpd
---- ./phpcpd.rpm 2015-03-26 19:04:39.896182549 +0100
-+++ ./phpcpd 2015-03-26 19:05:35.300399520 +0100
-@@ -15,23 +15,7 @@ if (ini_get('mbstring.internal_encoding'
- ini_set('mbstring.internal_encoding', NULL);
+--- ./phpcpd.rpm 2020-08-13 11:00:53.656423265 +0200
++++ ./phpcpd 2020-08-13 11:01:28.205352474 +0200
+@@ -23,22 +23,6 @@ if (version_compare('7.3.0', PHP_VERSION
+ die(1);
}
-$loaded = false;
@@ -24,5 +24,4 @@ diff -up ./phpcpd.rpm ./phpcpd
-}
+require '/usr/share/php/SebastianBergmann/PHPCPD/autoload.php';
- $application = new SebastianBergmann\PHPCPD\CLI\Application;
- $application->run();
+ exit((new \SebastianBergmann\PHPCPD\Application)->run($_SERVER['argv']));
diff --git a/phpcpd.spec b/phpcpd.spec
index 905c0de..2819ff6 100644
--- a/phpcpd.spec
+++ b/phpcpd.spec
@@ -6,15 +6,16 @@
# Please, preserve the changelog entries
#
+%bcond_without tests
+
# For compatibility with SCL
%undefine __brp_mangle_shebangs
-%global gh_commit 8724382966b1861df4e12db915eaed2165e10bf3
+%global gh_commit cf724b982a0f28455473867650802fea5cc2a65a
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner sebastianbergmann
%global gh_project phpcpd
%global php_home %{_datadir}/php
-%global with_tests %{?_without_tests:0}%{!?_without_tests:1}
# Packagist
%global pk_vendor sebastian
%global pk_project phpcpd
@@ -23,13 +24,14 @@
%global ns_project PHPCPD
Name: %{pk_project}
-Version: 5.0.2
+Version: 6.0.1
Release: 1%{?dist}
Summary: Copy/Paste Detector (CPD) for PHP code
License: BSD
URL: https://github.com/%{gh_owner}/%{gh_project}
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
+Source0: %{name}-%{version}-%{gh_short}.tgz
+Source1: makesrc.sh
# Fix for RPM, use autoload
Patch0: %{gh_project}-rpm.patch
@@ -37,44 +39,44 @@ Patch0: %{gh_project}-rpm.patch
BuildArch: noarch
BuildRequires: php(language) >= 7.3
BuildRequires: php-fedora-autoloader-devel
-%if %{with_tests}
-BuildRequires: phpunit8
+%if %{with tests}
+BuildRequires: phpunit9
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-BuildRequires: (php-composer(sebastian/finder-facade) >= 2.0 with php-composer(sebastian/finder-facade) < 3)
-BuildRequires: (php-composer(sebastian/version) >= 3.0 with php-composer(sebastian/version) < 4)
-BuildRequires: (php-composer(symfony/console) >= 4.0 with php-composer(symfony/console) < 6)
-BuildRequires: (php-composer(phpunit/php-timer) >= 3.0 with php-composer(phpunit/php-timer) < 4)
+BuildRequires: (php-composer(sebastian/cli-parser) >= 1.0 with php-composer(sebastian/cli-parser) < 2)
+BuildRequires: (php-composer(sebastian/version) >= 3.0 with php-composer(sebastian/version) < 4)
+BuildRequires: (php-composer(phpunit/php-file-iterator) >= 3.0 with php-composer(phpunit/php-file-iterator) < 4)
+BuildRequires: (php-composer(phpunit/php-timer) >= 5.0 with php-composer(phpunit/php-timer) < 6)
# remirepo:6
%else
-BuildRequires: php-sebastian-finder-facade2
+BuildRequires: php-sebastian-cli-parser
BuildRequires: php-sebastian-version3
-BuildRequires: php-symfony4-console
-BuildRequires: php-phpunit-php-timer3
+BuildRequires: php-phpunit-php-file-iterator3
+BuildRequires: php-phpunit-php-timer5
%endif
%endif
# From composer.json, requires
# "php": "^7.3",
# "ext-dom": "*",
-# "sebastian/finder-facade": "^2.0",
+# "sebastian/cli-parser": "^1.0",
# "sebastian/version": "^3.0",
-# "symfony/console": "^4.0|^5.0",
-# "phpunit/php-timer": "^3.0"
+# "phpunit/php-file-iterator": "^3.0",
+# "phpunit/php-timer": "^5.0"
Requires: php(language) >= 7.3
Requires: php-dom
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-Requires: (php-composer(sebastian/finder-facade) >= 2.0 with php-composer(sebastian/finder-facade) < 3)
-Requires: (php-composer(sebastian/version) >= 3.0 with php-composer(sebastian/version) < 4)
-Requires: (php-composer(symfony/console) >= 4.0 with php-composer(symfony/console) < 6)
-Requires: (php-composer(phpunit/php-timer) >= 3.0 with php-composer(phpunit/php-timer) < 4)
+Requires: (php-composer(sebastian/cli-parser) >= 1.0 with php-composer(sebastian/cli-parser) < 2)
+Requires: (php-composer(sebastian/version) >= 3.0 with php-composer(sebastian/version) < 4)
+Requires: (php-composer(phpunit/php-file-iterator) >= 3.0 with php-composer(phpunit/php-file-iterator) < 4)
+Requires: (php-composer(phpunit/php-timer) >= 5.0 with php-composer(phpunit/php-timer) < 6)
# remirepo:6
%else
-Requires: php-sebastian-finder-facade2
+Requires: php-sebastian-cli-parser
Requires: php-sebastian-version3
-Requires: php-symfony4-console
-Requires: php-phpunit-php-timer3
+Requires: php-phpunit-php-file-iterator3
+Requires: php-phpunit-php-timer5
%endif
# From phpcompatinfo report for version 3.0.0
Requires: php-cli
@@ -118,13 +120,10 @@ phpab \
cat << 'EOF' | tee -a src/autoload.php
// Dependencies
\Fedora\Autoloader\Dependencies::required([
- '%{php_home}/%{ns_vendor}/FinderFacade2/autoload.php',
+ '%{php_home}/%{ns_vendor}/CliParser/autoload.php',
+ '%{php_home}/%{ns_vendor}/FileIterator3/autoload.php',
+ '%{php_home}/%{ns_vendor}/Timer5/autoload.php',
'%{php_home}/%{ns_vendor}/Version3/autoload.php',
- [
- '%{php_home}/Symfony5/Component/Console/autoload.php',
- '%{php_home}/Symfony4/Component/Console/autoload.php',
- ],
- '%{php_home}/SebastianBergmann/Timer3/autoload.php',
]);
EOF
@@ -137,14 +136,14 @@ install -D -p -m 755 phpcpd %{buildroot}%{_bindir}/phpcpd
%check
-%if %{with_tests}
+%if %{with tests}
mkdir vendor
ln -s %{buildroot}%{php_home}/%{ns_vendor}/%{ns_project}/autoload.php vendor/autoload.php
ret=0;
-for cmd in php php73 php74; do
+for cmd in php php73 php74 php80; do
if which $cmd; then
- $cmd %{_bindir}/phpunit8 --verbose || ret=1
+ $cmd %{_bindir}/phpunit9 --verbose || ret=1
fi
done
exit $ret
@@ -163,6 +162,19 @@ exit $ret
%changelog
+* Thu Aug 13 2020 Remi Collet <remi@remirepo.net> - 6.0.1-1
+- update to 6.0.1
+
+* Thu Aug 13 2020 Remi Collet <remi@remirepo.net> - 6.0.0-1
+- update to 6.0.0
+- add dependency on phpunit/php-file-iterator
+- add dependency on sebastian/cli-parser
+- raise dependency on phpunit/php-timer 5
+- drop depency on sebastian/finder-facade
+- drop depency on symfony/console
+- sources from git snapshot
+- switch to phpunit9
+
* Sat Feb 22 2020 Remi Collet <remi@remirepo.net> - 5.0.2-1
- update to 5.0.2
- raise depency on phpunit/php-timer 3