summaryrefslogtreecommitdiffstats
path: root/php-seld-cli-prompt.spec
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2015-10-14 14:39:34 +0200
committerRemi Collet <fedora@famillecollet.com>2015-10-14 14:39:34 +0200
commit461fac51d513a34c07af350be9f79f364826e99c (patch)
treebaa99356a2eae4b8718a51c9a6beabb29b978f85 /php-seld-cli-prompt.spec
parent86f09d7be4666093aee7595e775de93e0d18272d (diff)
php-seld-cli-prompt: add autoloader
Diffstat (limited to 'php-seld-cli-prompt.spec')
-rw-r--r--php-seld-cli-prompt.spec29
1 files changed, 28 insertions, 1 deletions
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 <remi@fedoraproject.org> - 1.0.0-3
+- add autoloader
+
* Mon May 4 2015 Remi Collet <remi@fedoraproject.org> - 1.0.0-1
- initial package \ No newline at end of file