Blob Blame History Raw
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%define pear_name Console_Getargs

Name:           php-pear-Console-Getargs
Version:        1.3.4
Release:        1%{?dist}.1
Summary:        Command-line arguments and parameters parser
Summary(fr):    Analyseur des arguments et paramètres en ligne de commande

Group:          Development/Libraries
License:        PHP
URL:            http://pear.php.net/package/Console_Getargs
Source0:        http://pear.php.net/get/%{pear_name}-%{version}.tgz
Source2:        xml2changelog

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  php-pear >= 1:1.4.9-1.2
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides:       php-pear(%{pear_name}) = %{version}
Requires:       php >= 4.1.0 php-pear(PEAR)

%description
The Console_Getargs package implements a Command Line arguments and
parameters parser for your CLI applications. It performs some basic
arguments validation and automatically creates a formatted help text,
based on the given configuration.
 
%description -l fr
L'extension Console_Getargs fournit un analyseur des arguments et des
paramètres passés à vos applications sur la ligne de commande. 
Il réalise quelques validations simples des arguments et crée 
automatiquement un texte d'aide à partir de la configuration fournie.

%prep
%setup -q -c
[ -f package2.xml ] || mv package.xml package2.xml
%{_bindir}/php -n %{SOURCE2} package2.xml >CHANGELOG
mv package2.xml %{pear_name}-%{version}/%{pear_name}.xml

%build
cd %{pear_name}-%{version}
# Empty build section, most likely nothing required.

%install
rm -rf $RPM_BUILD_ROOT docdir
cd %{pear_name}-%{version}
%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{pear_name}.xml

# Move documentation
mv $RPM_BUILD_ROOT%{pear_docdir}/%{pear_name} ../docdir

# Clean up unnecessary files
rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*

# Install XML package description
mkdir -p $RPM_BUILD_ROOT%{pear_xmldir}
install -pm 644 %{pear_name}.xml $RPM_BUILD_ROOT%{pear_xmldir}

%clean
rm -rf $RPM_BUILD_ROOT

%post
%{__pear} install --nodeps --soft --force --register-only \
    %{pear_xmldir}/%{pear_name}.xml >/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    %{__pear} uninstall --nodeps --ignore-errors --register-only \
        %{pear_name} >/dev/null || :
fi

%files
%defattr(-,root,root,-)
%doc CHANGELOG docdir/examples
%{pear_xmldir}/%{pear_name}.xml
%{pear_phpdir}/Console/Getargs.php
%{pear_testdir}/%{pear_name}

%changelog
* Tue Aug 21 2007 Remi Collet <Fedora@FamilleCollet.com> 1.3.4-1.fc8.1
- bump release (missing sources)

* Tue Aug 21 2007 Remi Collet <Fedora@FamilleCollet.com> 1.3.4-1
- update to 1.3.4
- fix license and Remove file

* Tue Oct  7 2006 Remi Collet <Fedora@FamilleCollet.com> 1.3.3-1
- update to 1.3.3

* Wed Oct  4 2006 Remi Collet <Fedora@FamilleCollet.com> 1.3.2-1
- update to 1.3.2

* Thu Sep 28 2006 Remi Collet <Fedora@FamilleCollet.com> 1.3.1-1
- generated specfile (pear make-rpm-spec) + cleaning
- generated CHANGELOG
- add LICENSE, french summary and description