summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2016-11-22 10:09:57 +0100
committerRemi Collet <fedora@famillecollet.com>2016-11-22 10:09:57 +0100
commitd05e5bcdba05f533f930fec1b84365f1972b81db (patch)
tree834247ca0eaf0250184b1604b5a58e62eb4b626f
parent14d46a5eb0ca7a1758d1a142c6bdd0d789064dfe (diff)
php-pdepend-PHP-Depend: 2.2.6
-rw-r--r--composer.json19
-rwxr-xr-xmakesrc.sh2
-rw-r--r--php-pdepend-PHP-Depend-autoload.php20
-rw-r--r--php-pdepend-PHP-Depend.spec33
4 files changed, 44 insertions, 30 deletions
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..d5738cf
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,19 @@
+{
+ "name": "pdepend/pdepend",
+ "description": "Official version of pdepend to be handled with Composer",
+ "license": "BSD-3-Clause",
+ "require": {
+ "php": ">=5.3.7",
+ "symfony/dependency-injection": "^2.3.0|^3",
+ "symfony/filesystem": "^2.3.0|^3",
+ "symfony/config": "^2.3.0|^3"
+ },
+ "require-dev": {
+ "phpunit/phpunit": "^4.4.0,<4.8",
+ "squizlabs/php_codesniffer": "^2.0.0"
+ },
+ "bin": ["src/bin/pdepend"],
+ "autoload": {
+ "psr-4": {"PDepend\\": "src/main/php/PDepend"}
+ }
+}
diff --git a/makesrc.sh b/makesrc.sh
index bde65fc..c047df5 100755
--- a/makesrc.sh
+++ b/makesrc.sh
@@ -15,7 +15,7 @@ git clone https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
echo "Getting commit..."
pushd $PROJECT-$COMMIT
git checkout $COMMIT
-cp composer.json ../composer-$VERSION.json
+cp composer.json ../composer.json
popd
echo "Archiving..."
diff --git a/php-pdepend-PHP-Depend-autoload.php b/php-pdepend-PHP-Depend-autoload.php
index 77ae7b1..2064dfa 100644
--- a/php-pdepend-PHP-Depend-autoload.php
+++ b/php-pdepend-PHP-Depend-autoload.php
@@ -1,19 +1,9 @@
<?php
/* Autoloader for pdepend/pdepend and its dependencies */
-$vendorDir = '/usr/share/php';
-// Use Symfony autoloader
-if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
- if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
- require_once $vendorDir . '/Symfony/Component/ClassLoader/ClassLoader.php';
- }
+require_once '/usr/share/php/Fedora/Autoloader/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('PDepend\\', __DIR__);
+\Fedora\Autoloader\Dependencies::required([
+ '/usr/share/php/Symfony/Component/autoload.php',
+]);
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
-
-/* PDepend */
-$fedoraClassLoader->addPrefix('PDepend\\', dirname(__DIR__));
-
-/* for symfony/dependency-injection, filesystem and config */
-$fedoraClassLoader->addPrefix('Symfony\\Component\\', $vendorDir);
diff --git a/php-pdepend-PHP-Depend.spec b/php-pdepend-PHP-Depend.spec
index 656fed9..a8b34a6 100644
--- a/php-pdepend-PHP-Depend.spec
+++ b/php-pdepend-PHP-Depend.spec
@@ -7,7 +7,7 @@
#
# Please, preserve the changelog entries
#
-%global gh_commit b086687f3a01dc6bb92d633aef071d2c5dd0db06
+%global gh_commit ea3cae1f7abb1141be94ad0a35970169a122df54
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner pdepend
%global gh_project pdepend
@@ -18,7 +18,7 @@
%global with_tests 0%{!?_without_tests:1}
Name: php-pdepend-PHP-Depend
-Version: 2.2.4
+Version: 2.2.6
Release: 1%{?dist}
Summary: PHP_Depend design quality metrics for PHP package
@@ -53,7 +53,7 @@ BuildRequires: php-reflection
BuildRequires: php-simplexml
BuildRequires: php-spl
BuildRequires: php-tokenizer
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-composer(fedora/autoloader)
%endif
# From composer.json, "require": {
@@ -79,7 +79,7 @@ Requires: php-simplexml
Requires: php-spl
Requires: php-tokenizer
# Autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
# Single package in this channel
Obsoletes: php-channel-pdepend <= 1.3
@@ -134,24 +134,25 @@ rm src/test/php/PDepend/Report/Jdepend/ChartTest.php
cat << 'EOF' | tee src/test/php/PDepend/bootstrap.php
<?php
require '%{buildroot}%{php_home}/autoload.php';
-$fedoraClassLoader->addPrefix('PDepend\\', dirname(__DIR__));
+\Fedora\Autoloader\Autoload::addPsr4('PDepend\\', __DIR__);
EOF
+# remirepo=11
+ret=0
run=0
-if which php70; then
- php70 %{_bindir}/phpunit -d memory_limit=1G --verbose
- run=1
+if which php71; then
+ php71 %{_bindir}/phpunit -d memory_limit=1G --verbose || ret=1
+ run=1
fi
-
if which php56; then
- php56 %{_bindir}/phpunit -d memory_limit=1G --verbose
- run=1
+ php56 %{_bindir}/phpunit -d memory_limit=1G --verbose || ret=1
+ run=1
fi
-
if [ $run -eq 0 ]; then
- # No SCL available, run using with default PHP
- %{_bindir}/phpunit -d memory_limit=1G --verbose
+%{_bindir}/phpunit -d memory_limit=1G --verbose
+# remirepo:2
fi
+exit $ret
%else
: Test suite disabled
%endif
@@ -180,6 +181,10 @@ rm -rf %{buildroot}
%changelog
+* Tue Nov 22 2016 Remi Collet <remi@fedoraproject.org> - 2.2.6-1
+- update to 2.2.6
+- switch to fedora/autoloader
+
* Thu Mar 10 2016 Remi Collet <remi@fedoraproject.org> - 2.2.4-1
- update to 2.2.4