From a597a41d1eb15c46c04d4ff34439c6e50bbfbbcd Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 5 May 2016 08:33:07 +0200 Subject: php-Analog: add an autoloader --- php-Analog.spec | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/php-Analog.spec b/php-Analog.spec index 59bcf5d..b8d9d8b 100644 --- a/php-Analog.spec +++ b/php-Analog.spec @@ -20,7 +20,7 @@ Version: 1.0.7 %if 0%{?gh_date} Release: 5.%{gh_date}git%{gh_short}%{?dist} %else -Release: 1%{?dist} +Release: 2%{?dist} %endif License: MIT Group: Development/Libraries @@ -29,6 +29,7 @@ Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch +BuildRequires: %{_bindir}/phpab # For tests BuildRequires: %{_bindir}/phpunit BuildRequires: php-composer(psr/log) @@ -80,13 +81,24 @@ with examples for each in the examples folder. These include: So while it's a micro class, it's highly extensible and very capable out of the box too. +Autoloader: %{_datadir}/php/%{real_name}/autoload.php + %prep %setup -qn %{gh_project}-%{gh_commit} %build -# empty build section, nothing required +: Generate a simple classmap autoloader +%{_bindir}/phpab \ + --output lib/%{real_name}/autoload.php \ + lib/%{real_name} + +cat << 'EOF' | tee -a lib/%{real_name}/autoload.php + +// Dependencies +require_once '%{_datadir}/php/Psr/Log/autoload.php'; +EOF %install @@ -101,19 +113,16 @@ cp -a lib/%{real_name} %{buildroot}%{_datadir}/php/ : Relax 1 test sed -e 's/0600/%%d/' -i tests/AnalogTest.php -: Generate simple PSR-0 autoloader -cat < - 1.0.7-2 +- generate a simple autoloader (and use it for test suite) + * Thu May 05 2016 Johan Cwiklinski - 1.0.7-1 - Update to 1.0.7 (PHP7 compatible) -- cgit