From 461fac51d513a34c07af350be9f79f364826e99c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Wed, 14 Oct 2015 14:39:34 +0200 Subject: php-seld-cli-prompt: add autoloader --- php-seld-cli-prompt.spec | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'php-seld-cli-prompt.spec') diff --git a/php-seld-cli-prompt.spec b/php-seld-cli-prompt.spec index faedd79..e4d8df1 100644 --- a/php-seld-cli-prompt.spec +++ b/php-seld-cli-prompt.spec @@ -13,7 +13,7 @@ Name: php-seld-cli-prompt Version: 1.0.0 -Release: 1%{?dist} +Release: 3%{?dist} Summary: Allows you to prompt for user input on the command line Group: Development/Libraries @@ -21,9 +21,16 @@ 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", @@ -31,6 +38,8 @@ Requires: php(language) >= 5.3.0 # From phpcompatifo report for 1.0.0 Requires: php-pcre Requires: php-spl +# Autoloader +Requires: php-composer(symfony/class-loader) Provides: php-composer(seld/cli-prompt) = %{version} @@ -41,10 +50,15 @@ need to prompt for sensitive information. In these cases, the characters typed in by the user should not be directly visible, and this is quite a pain to do in a cross-platform way. +To use this library, you just have to add, in your project: + require_once '%{_datadir}/php/Seld/CliPrompt/autoload.php'; + %prep %setup -q -n %{gh_project}-%{gh_commit} +cp %{SOURCE1} src/autoload.php + %build # Nothing @@ -57,6 +71,16 @@ mkdir -p %{buildroot}%{_datadir}/php/Seld/CliPrompt cp -pr src/* %{buildroot}%{_datadir}/php/Seld/CliPrompt/ +%check +: Check if our autoloader works +php -r ' +require "%{buildroot}%{_datadir}/php/Seld/CliPrompt/autoload.php"; +$a = new \Seld\CliPrompt\CliPrompt(); +echo "Ok\n"; +exit(0); +' + + %clean rm -rf %{buildroot} @@ -70,5 +94,8 @@ rm -rf %{buildroot} %changelog +* Wed Oct 14 2015 Remi Collet - 1.0.0-3 +- add autoloader + * Mon May 4 2015 Remi Collet - 1.0.0-1 - initial package \ No newline at end of file -- cgit