diff options
author | Remi Collet <remi@remirepo.net> | 2017-05-31 07:03:22 +0200 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2017-05-31 07:03:22 +0200 |
commit | b8291d74bef94e2ad118c8c3e31d932744e31344 (patch) | |
tree | 75566f51cab612dac322c530f6bec7beff35db43 | |
parent | e5fc90bde9d87931104fc6e991100a7c52d0f3c2 (diff) |
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | php-robrichards-xmlseclibs.spec | 62 |
2 files changed, 28 insertions, 41 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-robrichards-xmlseclibs.spec b/php-robrichards-xmlseclibs.spec index 2864a94..89c5a6c 100644 --- a/php-robrichards-xmlseclibs.spec +++ b/php-robrichards-xmlseclibs.spec @@ -2,7 +2,7 @@ # # Fedora spec file for php-robrichards-xmlseclibs # -# 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: php-%{composer_vendor}-%{composer_project} Version: %{github_version} -Release: 2%{?github_release}%{?dist} +Release: 4%{?github_release}%{?dist} Summary: A PHP library for XML Security Group: Development/Libraries @@ -36,7 +36,6 @@ License: BSD URL: https://github.com/%{github_owner}/%{github_name} Source0: %{url}/archive/%{github_commit}/%{name}-%{github_version}-%{github_commit}.tar.gz -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch # Tests %if %{with_tests} @@ -46,22 +45,22 @@ BuildRequires: php(language) >= %{php_min_ver} ## composer.json: optional BuildRequires: php-mcrypt BuildRequires: php-openssl -## phpcompatinfo (computed from version 2.0.0) +## phpcompatinfo (computed from version 2.0.1) BuildRequires: php-dom BuildRequires: php-hash ## Autoloader -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) %endif # composer.json Requires: php(language) >= %{php_min_ver} # composer.json: suggest Requires: php-openssl -# phpcompatinfo (computed from version 2.0.0) +# phpcompatinfo (computed from version 2.0.1) Requires: php-dom Requires: php-hash # Autoloader -Requires: php-composer(symfony/class-loader) +Requires: php-composer(fedora/autoloader) # Weak dependencies %if 0%{?fedora} >= 21 @@ -99,28 +98,14 @@ cat <<'AUTOLOAD' | tee src/autoload.php /** * Autoloader for %{name} and its' dependencies * (created by %{name}-%{version}-%{release}). - * - * @return \Symfony\Component\ClassLoader\ClassLoader */ +require_once '%{phpdir}/Fedora/Autoloader/autoload.php'; -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'; - } - - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->register(); -} - -$fedoraClassLoader->addPrefix('RobRichards\\XMLSecLibs\\', dirname(dirname(__DIR__))); - -return $fedoraClassLoader; +\Fedora\Autoloader\Autoload::addPsr4('RobRichards\\XMLSecLibs\\', __DIR__); AUTOLOAD %install -rm -rf %{buildroot} - mkdir -p %{buildroot}%{phpdir}/RobRichards/XMLSecLibs cp -rp src/* %{buildroot}%{phpdir}/RobRichards/XMLSecLibs/ @@ -139,30 +124,21 @@ for test in tests/*phpt; do echo -e "\n--INI--\nerror_reporting=24575" >>$test done -: Run tests -run=0 -if which php56; then - php56 %{_bindir}/phpunit tests - run=1 -fi -if which php71; then - php71 %{_bindir}/phpunit tests - run=1 -fi -if [ $run -eq 0 ]; then -%{_bindir}/phpunit --verbose tests -fi +: Upstream tests +RETURN_CODE=0 +PHPUNIT=$(which phpunit) +for PHP_EXEC in "" %{?rhel:php54 php55} php56 php70 php71 php72; do + if [ -z "$PHP_EXEC" ] || which $PHP_EXEC; then + $PHP_EXEC $PHPUNIT --verbose tests || RETURN_CODE=1 + fi +done +exit $RETURN_CODE %else : Tests skipped %endif -%clean -rm -rf %{buildroot} - - %files -%defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE %doc CHANGELOG.txt @@ -173,6 +149,10 @@ rm -rf %{buildroot} %changelog +* Tue May 30 2017 Shawn Iwinski <shawn@iwin.ski> - 2.0.1-4 +- Switch autoloader to php-composer(fedora/autoloader) +- Test with SCLs if available + * Fri Nov 25 2016 Remi Collet <remi@fedoraproject.org> - 2.0.1-2 - fix FTBFS, disable deprecation messages |