1 |
%define peardir %(pear config-get php_dir 2> /dev/null || echo %{_datadir}/pear) |
2 |
%define xmldir /var/lib/pear |
3 |
%global pear_name Console_GetoptPlus |
4 |
%define name php-pear-Console-GetoptPlus |
5 |
%define version 1.0.0RC1 |
6 |
%define release 3 |
7 |
|
8 |
Name: %{name} |
9 |
Version: %{version} |
10 |
Release: %{release}%{?dist} |
11 |
Summary: Command-line option parser - Console Getopt+ (Getopt Plus) |
12 |
License: The BSD License |
13 |
Group: Development/Libraries |
14 |
Source0: http://pear.php.net/get/Console_GetoptPlus-%{version}.tgz |
15 |
BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%{__id_u} -n) |
16 |
URL: http://pear.php.net/package/Console_GetoptPlus |
17 |
|
18 |
BuildRequires: php-pear(PEAR) >= 1.4.7 |
19 |
Provides: php-pear(%{pear_name}) = %{version} |
20 |
|
21 |
#BuildRequires: PEAR::PEAR >= 1.4.7 |
22 |
|
23 |
BuildArch: noarch |
24 |
|
25 |
%description |
26 |
This package is (1) a PHP5 port/rewrite of Console_Getopt, (2) with added |
27 |
functionalities, and (3) with a Web interface to run getopt-like shell |
28 |
commands through a browser (not implemented yet). |
29 |
|
30 |
(1) Console_getoptPlus:getopt() is a replacement for |
31 |
Console_getopt:getopt(). |
32 |
Same for getopt2() and readPHPArgv(). It returns PEAR_Exception instead of |
33 |
PEAR_Error. Error messages are the same. |
34 |
|
35 |
(2) GetoptPlus:getoptplus uses an array-based description of the command. |
36 |
It can generates the command usage/help automaticly. It can return the |
37 |
parsed options and parameters in an associative array. It can be set to |
38 |
accept option shortcut names. |
39 |
|
40 |
Fully tested with phpUnit. Code coverage test close to 100%. |
41 |
|
42 |
Usage is fully documented in docs/examples files. |
43 |
|
44 |
%prep |
45 |
%setup -c -T |
46 |
pear -v -c pearrc \ |
47 |
-d php_dir=%{peardir} \ |
48 |
-d doc_dir=/docs \ |
49 |
-d bin_dir=%{_bindir} \ |
50 |
-d data_dir=%{peardir}/data \ |
51 |
-d test_dir=%{peardir}/tests \ |
52 |
-d ext_dir=%{_libdir} \ |
53 |
-s |
54 |
|
55 |
%build |
56 |
|
57 |
%install |
58 |
rm -rf %{buildroot} |
59 |
pear -c pearrc install --nodeps --packagingroot %{buildroot} %{SOURCE0} |
60 |
|
61 |
# Clean up unnecessary files |
62 |
rm pearrc |
63 |
rm %{buildroot}/%{peardir}/.filemap |
64 |
rm %{buildroot}/%{peardir}/.lock |
65 |
rm -rf %{buildroot}/%{peardir}/.registry |
66 |
rm -rf %{buildroot}%{peardir}/.channels |
67 |
rm %{buildroot}/%{xmldir}/.filemap |
68 |
rm %{buildroot}/%{xmldir}/.lock |
69 |
rm -rf %{buildroot}/%{xmldir}/.registry |
70 |
rm -rf %{buildroot}/%{xmldir}/.channels |
71 |
if [[ -f %{buildroot}%{xmldir}/.depdb ]] ;then |
72 |
rm %{buildroot}%{xmldir}/.depdb |
73 |
fi |
74 |
if [[ -f %{buildroot}{xmldir}/.depdblock ]] ;then |
75 |
rm %{buildroot}%{xmldir}/.depdblock |
76 |
fi |
77 |
mv %{buildroot}/docs . |
78 |
|
79 |
|
80 |
# Install XML package description |
81 |
mkdir -p %{buildroot}%{xmldir} |
82 |
tar -xzf %{SOURCE0} package.xml |
83 |
cp -p package.xml %{buildroot}%{xmldir}/Console_GetoptPlus.xml |
84 |
|
85 |
%clean |
86 |
rm -rf %{buildroot} |
87 |
|
88 |
%post |
89 |
pear install --nodeps --soft --force --register-only %{xmldir}/Console_GetoptPlus.xml >/dev/null || : |
90 |
|
91 |
%postun |
92 |
if [ "$1" -eq "0" ]; then |
93 |
pear uninstall --nodeps --ignore-errors --register-only pear.php.net/Console_GetoptPlus >/dev/null || : |
94 |
fi |
95 |
|
96 |
%files |
97 |
%defattr(-,root,root) |
98 |
%doc docs/Console_GetoptPlus/* |
99 |
%{peardir}/* |
100 |
%{xmldir}/Console_GetoptPlus.xml |
101 |
|
102 |
%changelog |
103 |
* Thu Jun 16 2016 Jean-Philipe Pialasse <tests@pialasse.com> 1.0.0RC1-3.sme |
104 |
- importing to buildsys pear packages for Horde [SME: 9600] |
105 |
|
106 |
* Mon May 6 2013 John H. Bennett III <bennettj@johnbennettservices.com> - 1.0.0RC1-2 |
107 |
- updated spec file requires section, and left original info remarked. |
108 |
|
109 |
* Sun May 5 2013 John H. Bennett III <bennettj@johnbennettservices.com> - 1.0.0RC1-1 |
110 |
- Original from pear-make-rpm-spec. |
111 |
|