summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2017-05-10 16:54:06 +0200
committerRemi Collet <remi@remirepo.net>2017-05-10 16:54:06 +0200
commiteb55db57cb3f380285ed069fb6b2e77c66329c47 (patch)
tree0708fd8e2f62f59026d0230a52cf147ad50400e9
parentb22e17754905173132458d4101fa876fdec2e2b4 (diff)
sync with fedora
-rw-r--r--.gitignore7
-rw-r--r--php-di-phpdoc-reader.spec49
2 files changed, 23 insertions, 33 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/php-di-phpdoc-reader.spec b/php-di-phpdoc-reader.spec
index a795dde..ab45462 100644
--- a/php-di-phpdoc-reader.spec
+++ b/php-di-phpdoc-reader.spec
@@ -2,7 +2,7 @@
#
# Fedora spec file for php-di-phpdoc-reader
#
-# Copyright (c) 2016 Shawn Iwinski <shawn@iwin.ski>
+# Copyright (c) 2016-2017 Shawn Iwinski <shawn@iwin.ski>
#
# License: MIT
# http://opensource.org/licenses/MIT
@@ -28,7 +28,7 @@
Name: %{composer_vendor}-%{composer_project}
Version: %{github_version}
-Release: 1%{?github_release}%{?dist}
+Release: 4%{?github_release}%{?dist}
Summary: Parses @var and @param values in PHP docblocks
Group: Development/Libraries
@@ -40,7 +40,6 @@ URL: https://github.com/%{github_owner}/%{github_name}
Source0: %{name}-%{github_version}-%{github_commit}.tar.gz
Source1: %{name}-get-source.sh
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
# Tests
%if %{with_tests}
@@ -53,7 +52,7 @@ BuildRequires: php-reflection
BuildRequires: php-spl
BuildRequires: php-tokenizer
## Autoloader
-BuildRequires: php-composer(symfony/class-loader)
+BuildRequires: php-composer(fedora/autoloader)
%endif
# composer.json
@@ -63,7 +62,7 @@ Requires: php-pcre
Requires: php-spl
Requires: php-tokenizer
# Autoloader
-Requires: php-composer(symfony/class-loader)
+Requires: php-composer(fedora/autoloader)
# php-{COMPOSER_VENDOR}-{COMPOSER_PROJECT}
Provides: php-%{composer_vendor}-%{composer_project} = %{version}-%{release}
@@ -86,21 +85,12 @@ cat <<'AUTOLOAD' | tee src/PhpDocReader/autoload.php
* Autoloader for %{name} and its' dependencies
* (created by %{name}-%{version}-%{release}).
*
- * @return \Symfony\Component\ClassLoader\ClassLoader
*/
-if (!isset($fedoraClassLoader) || !($fedoraClassLoader instanceof \Symfony\Component\ClassLoader\ClassLoader)) {
- if (!class_exists('Symfony\\Component\\ClassLoader\\ClassLoader', false)) {
- require_once '%{phpdir}/Symfony/Component/ClassLoader/ClassLoader.php';
- }
+require_once '%{phpdir}/Fedora/Autoloader/autoload.php';
- $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader();
- $fedoraClassLoader->register();
-}
+\Fedora\Autoloader\Autoload::addPsr4('PhpDocReader\\', __DIR__);
-$fedoraClassLoader->addPrefix('PhpDocReader\\', dirname(__DIR__));
-
-return $fedoraClassLoader;
AUTOLOAD
@@ -109,41 +99,31 @@ AUTOLOAD
%install
-rm -rf %{buildroot}
mkdir -p %{buildroot}%{phpdir}
cp -rp src/* %{buildroot}%{phpdir}/
%check
%if %{with_tests}
-: Make PSR-0 tests
-mkdir -p tests-psr0/UnitTest
-ln -s ../../tests tests-psr0/UnitTest/PhpDocReader
-
: Create tests bootstrap
cat <<'BOOTSTRAP' | tee bootstrap.php
<?php
-$fedoraClassLoader = require '%{buildroot}%{phpdir}/PhpDocReader/autoload.php';
-$fedoraClassLoader->addPrefix('UnitTest\\PhpDocReader\\', __DIR__.'/tests-psr0');
+require_once '%{buildroot}%{phpdir}/PhpDocReader/autoload.php';
+\Fedora\Autoloader\Autoload::addPsr4('UnitTest\\PhpDocReader\\', __DIR__.'/tests');
BOOTSTRAP
: Run tests
-%{_bindir}/phpunit --verbose --bootstrap bootstrap.php
-
-if which php70; then
- php70 %{_bindir}/phpunit --verbose --bootstrap bootstrap.php
-fi
+for cmd in php php56 php70 php71 php72; do
+ if which $cmd; then
+ $cmd %{_bindir}/phpunit --verbose --bootstrap bootstrap.php
+ fi
+done
%else
: Tests skipped
%endif
-%clean
-rm -rf %{buildroot}
-
-
%files
-%defattr(-,root,root,-)
%{!?_licensedir:%global license %%doc}
%license LICENSE
%doc *.md
@@ -152,6 +132,9 @@ rm -rf %{buildroot}
%changelog
+* Wed May 10 2017 Valentin Collet <valentin@famillecollet.com> - 2.0.1-4
+- Switch to fedora/autoloader
+
* Mon Jan 04 2016 Remi Collet <remi@remirepo.net> - 2.0.1-1
- backport for #remirepo