From 8e436a56c8a11a2ed31d32c30e39e13344009784 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 14 Jan 2016 14:19:28 +0100 Subject: php-ircmaxell-security-lib: add autoloader --- php-ircmaxell-random-lib.spec | 44 ++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/php-ircmaxell-random-lib.spec b/php-ircmaxell-random-lib.spec index 476707d..0748d2b 100644 --- a/php-ircmaxell-random-lib.spec +++ b/php-ircmaxell-random-lib.spec @@ -14,7 +14,7 @@ Name: php-ircmaxell-random-lib Version: 1.1.0 -Release: 1%{?dist} +Release: 3%{?dist} Summary: A Library For Generating Secure Random Numbers Group: Development/Libraries @@ -37,6 +37,9 @@ BuildRequires: php-spl BuildRequires: php-composer(ircmaxell/security-lib) >= 1.0 # "mikey179/vfsStream": "1.1.*", ignore max version on purpose BuildRequires: php-composer(mikey179/vfsStream) >= 1.1 +# For autoloader +BuildRequires: php-mikey179-vfsstream >= 1.6.0 +BuildRequires: php-ircmaxell-security-lib >= 1.1.0-3 %endif # From composer.json @@ -49,6 +52,8 @@ Requires: php-hash Requires: php-openssl Requires: php-posix Requires: php-spl +# For autoloader +Requires: php-ircmaxell-security-lib >= 1.1.0-3 Provides: php-composer(ircmaxell/random-lib) = %{version} @@ -58,6 +63,8 @@ A library for generating random numbers and strings of various strengths. This library is useful in security contexts. +Autoloader: %{_datadir}/php/RandomLib/autoload.php + %prep %setup -q -n %{gh_project}-%{gh_commit} @@ -66,7 +73,13 @@ chmod -x lib/RandomLib/Generator.php %build -# Nothing +: Generate library autoloader +%{_bindir}/phpab --output lib/RandomLib/autoload.php lib + +cat << EOF | tee -a lib/RandomLib/autoload.php +// Dependency +require_once '%{_datadir}/php/SecurityLib/autoload.php'; +EOF %install @@ -77,17 +90,23 @@ cp -pr lib/* %{buildroot}%{_datadir}/php %check %if %{with_tests} -: Generate autoloader -%{_bindir}/phpab \ - --basedir $PWD \ - --output autoload.php \ - %{_datadir}/php/org/bovigo/vfs \ - %{_datadir}/php/SecurityLib \ - lib test +: Generate test suite autoloader +%{_bindir}/phpab --output test/autoload.php test + +mkdir vendor +cat << 'EOF' | tee vendor/autoload.php + - 1.1.0-3 +- add autoloader + * Fri Jan 16 2015 Remi Collet - 1.1.0-1 - update to 1.1.0 -- cgit