summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-11-01 15:19:53 +0100
committerRemi Collet <remi@remirepo.net>2017-11-01 15:19:53 +0100
commit6c3b6ecb6651804e6d1daedd83f423eb15444ed2 (patch)
tree33e5299c974ee63d7a4a20e5d13a4e9b1867adec
parent28768db71dba3a4004849a278a6984a365cfd2e3 (diff)
fix FTBFS from Koschei, add patch for PHP 7.2 from https://github.com/pdepend/pdepend/pull/303
provide pdepend allow only a symfony version
-rw-r--r--php-pdepend-PHP-Depend-autoload.php20
-rw-r--r--php-pdepend-PHP-Depend.spec59
2 files changed, 42 insertions, 37 deletions
diff --git a/php-pdepend-PHP-Depend-autoload.php b/php-pdepend-PHP-Depend-autoload.php
deleted file mode 100644
index 947304d..0000000
--- a/php-pdepend-PHP-Depend-autoload.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/* Autoloader for pdepend/pdepend and its dependencies */
-
-require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
-\Fedora\Autoloader\Autoload::addPsr4('PDepend\\', __DIR__);
-\Fedora\Autoloader\Dependencies::required(array(
- array(
- '/usr/share/php/Symfony3/Component/DependencyInjection/autoload.php',
- '/usr/share/php/Symfony/Component/DependencyInjection/autoload.php',
- ),
- array(
- '/usr/share/php/Symfony3/Component/Filesystem/autoload.php',
- '/usr/share/php/Symfony/Component/Filesystem/autoload.php',
- ),
- array(
- '/usr/share/php/Symfony3/Component/Config/autoload.php',
- '/usr/share/php/Symfony/Component/Config/autoload.php',
- ),
-));
-
diff --git a/php-pdepend-PHP-Depend.spec b/php-pdepend-PHP-Depend.spec
index 7b668de..cbb2bb5 100644
--- a/php-pdepend-PHP-Depend.spec
+++ b/php-pdepend-PHP-Depend.spec
@@ -17,9 +17,19 @@
%global php_home %{_datadir}/php/PDepend
%global with_tests 0%{!?_without_tests:1}
+%if 0%{?fedora} >= 27 || "%{?vendor}" == "Remi Collet"
+%global sym_min 3
+%global sym_max 4
+%global sym_path %{_datadir}/php/Symfony3
+%else
+%global sym_min 2.3
+%global sym_max 3
+%global sym_path %{_datadir}/php/Symfony
+%endif
+
Name: php-pdepend-PHP-Depend
Version: 2.5.0
-Release: 4%{?dist}
+Release: 5%{?dist}
Summary: PHP_Depend design quality metrics for PHP package
Group: Development/Libraries
@@ -28,8 +38,8 @@ URL: http://pdepend.org/
# git snashop to get upstream test suite
Source0: %{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
+
# Autoloader
-Source2: %{name}-autoload.php
Patch0: %{name}-rpm.patch
# https://github.com/pdepend/pdepend/pull/303
@@ -43,12 +53,12 @@ BuildArch: noarch
# Test suite pass with PHPUnit 4.8.12 and PHPUnit 5.0.5
BuildRequires: php-composer(phpunit/phpunit) >= 4.0.0
BuildRequires: php(language) >= 5.3.7
-BuildRequires: php-composer(symfony/dependency-injection) < 4
-BuildRequires: php-composer(symfony/dependency-injection) >= 2.3.0
-BuildRequires: php-composer(symfony/filesystem) < 4
-BuildRequires: php-composer(symfony/filesystem) >= 2.3.0
-BuildRequires: php-composer(symfony/config) < 4
-BuildRequires: php-composer(symfony/config) >= 2.3.0
+BuildRequires: php-composer(symfony/dependency-injection) < %{sym_max}
+BuildRequires: php-composer(symfony/dependency-injection) >= %{sym_min}
+BuildRequires: php-composer(symfony/filesystem) < %{sym_max}
+BuildRequires: php-composer(symfony/filesystem) >= %{sym_min}
+BuildRequires: php-composer(symfony/config) < %{sym_max}
+BuildRequires: php-composer(symfony/config) >= %{sym_min}
BuildRequires: php-bcmath
BuildRequires: php-date
BuildRequires: php-dom
@@ -71,12 +81,12 @@ BuildRequires: php-composer(fedora/autoloader)
# "symfony/filesystem": "^2.3.0|^3",
# "symfony/config": "^2.3.0|^3"
Requires: php(language) >= 5.3.7
-Requires: php-composer(symfony/dependency-injection) >= 2.3.0
-Requires: php-composer(symfony/dependency-injection) < 4
-Requires: php-composer(symfony/filesystem) >= 2.3.0
-Requires: php-composer(symfony/filesystem) < 4
-Requires: php-composer(symfony/config) >= 2.3.0
-Requires: php-composer(symfony/config) < 4
+Requires: php-composer(symfony/dependency-injection) >= %{sym_min}
+Requires: php-composer(symfony/dependency-injection) < %{sym_max}
+Requires: php-composer(symfony/filesystem) >= %{sym_min}
+Requires: php-composer(symfony/filesystem) < %{sym_max}
+Requires: php-composer(symfony/config) >= %{sym_min}
+Requires: php-composer(symfony/config) < %{sym_max}
# From phpcompatinfo report for version 2.3.0
Requires: php-bcmath
Requires: php-date
@@ -98,6 +108,7 @@ Obsoletes: php-channel-pdepend <= 1.3
Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
Provides: php-composer(%{gh_owner}/%{gh_project}) = %{version}
+Provides: pdepend = %{version}
%description
@@ -111,7 +122,18 @@ reusability and maintainability.
%patch0 -p0
%patch1 -p1
-cp %{SOURCE2} src/main/php/PDepend/autoload.php
+cat << 'EOF' | tee src/main/php/PDepend/autoload.php
+<?php
+/* Autoloader for %{name} and its dependencies */
+
+require_once '%{_datadir}/php/Fedora/Autoloader/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('PDepend\\', __DIR__);
+\Fedora\Autoloader\Dependencies::required([
+ '%{sym_path}/Component/DependencyInjection/autoload.php',
+ '%{sym_path}/Component/Filesystem/autoload.php',
+ '%{sym_path}/Component/Config/autoload.php',
+]);
+EOF
find src/main/php -name \*php -exec sed -e 's:@package_version@:%{version}:' -i {} \;
find src/test/php -name \*xml -exec sed -e 's:@package_version@:%{version}:' -i {} \;
@@ -172,8 +194,11 @@ fi
%changelog
-* Tue May 16 2017 Remi Collet <remi@fedoraproject.org> - 2.5.0-4
-- open https://github.com/pdepend/pdepend/pull/303 - fix for 7.2
+* Wed Nov 1 2017 Remi Collet <remi@fedoraproject.org> - 2.5.0-5
+- fix FTBFS from Koschei, add patch for PHP 7.2 from
+ https://github.com/pdepend/pdepend/pull/303
+- provide pdepend
+- allow only a symfony version
* Wed May 10 2017 Remi Collet <remi@fedoraproject.org> - 2.5.0-3
- adapt for Symfony v3