diff options
-rw-r--r-- | .gitignore | 7 | ||||
-rw-r--r-- | php-phpseclib-autoload.php | 17 | ||||
-rw-r--r-- | php-phpseclib.spec | 49 |
3 files changed, 31 insertions, 42 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-phpseclib-autoload.php b/php-phpseclib-autoload.php index 4367aa0..93e0f67 100644 --- a/php-phpseclib-autoload.php +++ b/php-phpseclib-autoload.php @@ -3,22 +3,9 @@ /** * Autoloader for phpseclib/phpseclib. */ -$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'; - } - - $fedoraClassLoader = new \Symfony\Component\ClassLoader\ClassLoader(); - $fedoraClassLoader->register(); -} +require_once "/usr/share/php/Fedora/Autoloader/autoload.php"; // composer.json: "autoload": { "files": [ "phpseclib/bootstrap.php" ], "psr-4": { "phpseclib\\": "phpseclib/" } require_once __DIR__ . '/bootstrap.php'; - -$fedoraClassLoader->addPrefixes(array( - 'phpseclib' => dirname(__DIR__), -)); +\Fedora\Autoloader\Autoload::addPsr4('phpseclib\\', __DIR__); diff --git a/php-phpseclib.spec b/php-phpseclib.spec index 05462ec..f0d6fca 100644 --- a/php-phpseclib.spec +++ b/php-phpseclib.spec @@ -3,16 +3,12 @@ %global github_owner phpseclib %global github_name phpseclib -%global github_commit ab8028c93c03cc8d9c824efa75dc94f1db2369bf +%global github_commit f8dd0e18d2328c447dd4190fecd11ef52680d968 %global github_short %(c=%{github_commit}; echo ${c:0:7}) -%if 0%{?rhel} == 5 -%global with_tests 0%{?_with_tests:1} -%else %global with_tests 0%{!?_without_tests:1} -%endif Name: php-%{composer_vendor} -Version: 2.0.4 +Version: 2.0.5 Release: 1%{?dist} Summary: PHP Secure Communications Library @@ -25,10 +21,9 @@ Source1: %{name}-autoload.php Source2: makesrc.sh BuildArch: noarch -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %if %{with_tests} -BuildRequires: php-composer(symfony/class-loader) +BuildRequires: php-composer(fedora/autoloader) BuildRequires: %{_bindir}/phpunit BuildRequires: %{_bindir}/phpab # Optional at runtime, to avoid too muck skipped tests @@ -47,7 +42,8 @@ Requires: php-pcre Requires: php-session Requires: php-standard Requires: php-xml -Requires: php-composer(symfony/class-loader) +# Autoloader +Requires: php-composer(fedora/autoloader) Provides: php-composer(%{composer_vendor}/%{composer_project}) = %{version} @@ -57,45 +53,39 @@ MIT-licensed pure-PHP implementations of an arbitrary-precision integer arithmetic library, fully PKCS#1 (v2.1) compliant RSA, DES, 3DES, RC4, Rijndael, AES, Blowfish, Twofish, SSH-1, SSH-2, SFTP, and X.509 + %prep %setup -qn %{github_name}-%{github_commit} cp %{SOURCE1} %{composer_vendor}/autoload.php +# https://github.com/phpseclib/phpseclib/pull/1121 +chmod -x phpseclib/Net/SCP.php + + %build + %install -rm -rf %{buildroot} mkdir -p %{buildroot}%{_datadir}/php cp -pr %{composer_vendor} %{buildroot}%{_datadir}/php + %if %{with_tests} %check %{_bindir}/phpab --output tests/bootstrap.php tests echo 'require "%{buildroot}%{_datadir}/php/%{composer_vendor}/autoload.php";' >> tests/bootstrap.php -# remirepo:11 ret=0 -run=0 -if which php56; then - php56 %{_bindir}/phpunit || ret=1 - run=1 -fi -if which php71; then - php71 %{_bindir}/phpunit || ret=1 - run=1 -fi -if [ $run -eq 0 ]; then -%{_bindir}/phpunit --verbose -# remirepo:2 -fi +for cmd in php php70 php71 php72; do + if which $cmd; then + $cmd %{_bindir}/phpunit || ret=1 + fi +done exit $ret %endif -%clean -rm -rf %{buildroot} %files -%defattr(-,root,root,-) %{_datadir}/php/%{composer_vendor} %doc AUTHORS CHANGELOG.md composer.json README.md %{!?_licensedir:%global license %%doc} @@ -103,6 +93,11 @@ rm -rf %{buildroot} %changelog +* Mon May 8 2017 Remi Collet <remi@remirepo.net> - 2.0.5-1 +- Update to 2.0.5 +- switch to fedora/autoloader +- use SCL of PHP when available for test suite + * Tue Oct 4 2016 Remi Collet <remi@fedoraproject.org> - 2.0.4-1 - update to 2.0.4 |