From ce258176f85be1583f630edeea96c2c25e4c8ace Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 14 Oct 2015 10:55:23 +0200 Subject: php-seld-phar-utils: 1.0.1 --- phar-utils-autoload.php | 15 +++++++++++++++ php-seld-phar-utils.spec | 37 +++++++++++++++++++++++++++++++++---- 2 files changed, 48 insertions(+), 4 deletions(-) create mode 100644 phar-utils-autoload.php diff --git a/phar-utils-autoload.php b/phar-utils-autoload.php new file mode 100644 index 0000000..0b8dbac --- /dev/null +++ b/phar-utils-autoload.php @@ -0,0 +1,15 @@ +register(); +} + +$fedoraClassLoader->addPrefix('Seld\\PharUtils\\', dirname(dirname(__DIR__))); diff --git a/php-seld-phar-utils.spec b/php-seld-phar-utils.spec index 2fdf41c..8551258 100644 --- a/php-seld-phar-utils.spec +++ b/php-seld-phar-utils.spec @@ -6,13 +6,13 @@ # # Please, preserve the changelog entries # -%global gh_commit 336bb5ee20de511f3c1a164222fcfd194afcab3a +%global gh_commit 7009b5139491975ef6486545a39f3e6dad5ac30a %global gh_short %(c=%{gh_commit}; echo ${c:0:7}) %global gh_owner Seldaek %global gh_project phar-utils Name: php-seld-phar-utils -Version: 1.0.0 +Version: 1.0.1 Release: 1%{?dist} Summary: PHAR file format utilities @@ -21,18 +21,27 @@ License: MIT URL: https://github.com/%{gh_owner}/%{gh_project} Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{gh_project}-%{version}-%{gh_short}.tar.gz +# Autoloader +Source1: %{gh_project}-autoload.php + BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: php(language) >= 5.3 +# For test +BuildRequires: php-cli +# Autoloader +BuildRequires: php-composer(symfony/class-loader) # From composer.json # "php": ">=5.3.0", Requires: php(language) >= 5.3.0 -# From phpcompatifo report for 1.0.0 +# From phpcompatifo report for 1.0.1 Requires: php-date Requires: php-hash Requires: php-pcre Requires: php-spl +# Autoloader +Requires: php-composer(symfony/class-loader) Provides: php-composer(seld/phar-utils) = %{version} @@ -40,10 +49,15 @@ Provides: php-composer(seld/phar-utils) = %{version} %description PHAR file format utilities, for when PHP phars you up. +To use this library, you just have to add, in your project: + require_once '%{_datadir}/php/Seld/PharUtils/autoload.php'; + %prep %setup -q -n %{gh_project}-%{gh_commit} +cp %{SOURCE1} src/autoload.php + %build # Nothing @@ -56,6 +70,16 @@ mkdir -p %{buildroot}%{_datadir}/php/Seld/PharUtils/ cp -pr src/* %{buildroot}%{_datadir}/php/Seld/PharUtils/ +%check +: Check if our autoloader works +php -r ' +require "%{buildroot}%{_datadir}/php/Seld/PharUtils/autoload.php"; +$a = new \Seld\PharUtils\Timestamps("%{SOURCE1}"); +echo "Ok\n"; +exit(0); +' + + %clean rm -rf %{buildroot} @@ -64,10 +88,15 @@ rm -rf %{buildroot} %defattr(-,root,root,-) %{!?_licensedir:%global license %%doc} %license LICENSE -%doc README.md composer.json +%doc README.md +%doc composer.json %{_datadir}/php/Seld %changelog +* Wed Oct 14 2015 Remi Collet - 1.0.1-1 +- update to 1.0.1 +- add autoloader + * Mon May 4 2015 Remi Collet - 1.0.0-1 - initial package \ No newline at end of file -- cgit