2cc6e83
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
2cc6e83
%define pear_name XML_Parser
2cc6e83
2cc6e83
Summary:      XML parsing class based on PHP's bundled expat
2cc6e83
Summary(fr):  Une classe d'analyse XML utilisant l'extension expat de PHP
b1b65ca
Name:         php-pear-XML-Parser
52e091c
Version:      1.3.2
f16f563
Release:      3%{?dist}
2897f4d
License:      BSD
b1b65ca
Group:        Development/Libraries
2cc6e83
URL:          http://pear.php.net/package/XML_Parser
2cc6e83
Source0:      http://pear.php.net/get/%{pear_name}-%{version}.tgz
2cc6e83
Source2:      xml2changelog
2cc6e83
b1b65ca
BuildRoot:    %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
b1b65ca
b1b65ca
BuildArch:        noarch
2cc6e83
BuildRequires:    php-pear >= 1:1.4.9-1.2
b1b65ca
Requires(post):   %{__pear}
b1b65ca
Requires(postun): %{__pear}
a6fdf79
Requires:         php-pear(PEAR) >= 1.4.9
2cc6e83
Provides:         php-pear(%{pear_name}) = %{version}
b1b65ca
b1b65ca
%description
b1b65ca
This is an XML parser based on PHPs built-in xml extension.
b1b65ca
It supports two basic modes of operation: "func" and "event".  
b1b65ca
In "func" mode, it will look for a function named after each element 
b1b65ca
(xmltag_ELEMENT for start tags and xmltag_ELEMENT_ for end tags), 
b1b65ca
and in "event" mode it uses a set of generic callbacks.
b1b65ca
b1b65ca
Since version 1.2.0 there's a new XML_Parser_Simple class that makes 
b1b65ca
parsing of most XML documents easier, by automatically providing a stack 
b1b65ca
for the elements. Furthermore its now possible to split the parser from 
b1b65ca
the handler object, so you do not have to extend XML_Parser anymore in 
b1b65ca
order to parse a document with it.
b1b65ca
b1b65ca
%description -l fr
b1b65ca
Une analyseur XML utilisant l'extension xml intégrée à PHP.
b1b65ca
Il supporte deux simples modes de fonctionnement : "func" et "event".
b1b65ca
Dans le mode "func", il cherche une fonction nommée après chaque élément
b1b65ca
(xmltag_ELEMENT pour le drapeau de début et xmltag_ELEMENT_ pour celui
b1b65ca
de fin), et dans le mode "event" il utilise en ensemble de fonctions
b1b65ca
"callbacks" génériques.
b1b65ca
b1b65ca
Depuis la version 1.2.0, la nouvelle classe XML_Parser_Simple simplifie
b1b65ca
l'analse de la plupart des documents XML, en fournissant automatiquement
b1b65ca
une pile pour les élements. De plus il est désormais possible de séparer
b1b65ca
l'analyseur du gestionnaire d'objets, il n'est donc plus nécessaire d'étendre
b1b65ca
XML_Parser pour analyser un document.
b1b65ca
52e091c
b1b65ca
%prep
2cc6e83
%setup -q -c
f95a032
# Package2.xml is v2
f95a032
%{_bindir}/php -n %{SOURCE2} package2.xml >CHANGELOG
f95a032
mv package2.xml %{pear_name}-%{version}/%{pear_name}.xml
b1b65ca
52e091c
7606cbc
%build
7606cbc
# Empty build section
7606cbc
52e091c
b1b65ca
%install
7606cbc
rm -rf %{buildroot} docdir
2cc6e83
pushd %{pear_name}-%{version}
7606cbc
2cc6e83
%{__pear} install --nodeps --packagingroot %{buildroot} %{pear_name}.xml
b1b65ca
b1b65ca
# Clean up unnecessary files
b1b65ca
rm -rf %{buildroot}%{pear_phpdir}/.??*
b1b65ca
7606cbc
# Install XML package description
7606cbc
%{__mkdir_p} %{buildroot}%{pear_xmldir}
2cc6e83
%{__install} -pm 644 %{pear_name}.xml %{buildroot}%{pear_xmldir}
7606cbc
7606cbc
popd
b1b65ca
# Sort out documentation
2cc6e83
mv %{buildroot}%{pear_docdir}/%{pear_name} docdir
2cc6e83
for file in  docdir/examples/*; do
2cc6e83
  %{__sed} -i -e 's/\r//' $file
2cc6e83
done
2cc6e83
b1b65ca
b1b65ca
%check
b1b65ca
# Sanity check
b1b65ca
lst=$(find %{buildroot}%{pear_phpdir} -exec grep -q %{buildroot} {} \; -print)
b1b65ca
[ ! -z "$lst" ] && echo "Reference to BUILDROOT in $lst" && exit 1;
b1b65ca
52e091c
b1b65ca
%clean
b1b65ca
rm -rf %{buildroot}
b1b65ca
52e091c
b1b65ca
%post
2cc6e83
%{__pear} install --nodeps --soft --force --register-only %{pear_xmldir}/%{pear_name}.xml >/dev/null || :
b1b65ca
52e091c
b1b65ca
%postun
b1b65ca
if [ "$1" -eq "0" ]; then
2cc6e83
    %{__pear} uninstall --nodeps --ignore-errors --register-only %{pear_name} >/dev/null || :
b1b65ca
fi
b1b65ca
52e091c
b1b65ca
%files
b1b65ca
%defattr(-,root,root,-)
a6fdf79
%doc CHANGELOG docdir/examples
2cc6e83
%{pear_phpdir}/XML/Parser
2cc6e83
%{pear_phpdir}/XML/Parser.php
2cc6e83
%{pear_testdir}/%{pear_name}
2cc6e83
%{pear_xmldir}/%{pear_name}.xml
2cc6e83
b1b65ca
b1b65ca
%changelog
f16f563
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.2-3
f16f563
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
f16f563
278353b
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3.2-2
278353b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
278353b
52e091c
* Thu Jan 22 2009 Remi Collet <Fedora@FamilleCollet.com> 1.3.2-1
52e091c
- update to 1.3.2
52e091c
f95a032
* Tue Sep 30 2008 Remi Collet <Fedora@FamilleCollet.com> 1.3.1-1
52e091c
- update to 1.3.1
f95a032
- fix in package.xml (license)
f95a032
2897f4d
* Fri Aug 29 2008 Remi Collet <Fedora@FamilleCollet.com> 1.3.0-1
2897f4d
- update to 1.3.0
2897f4d
- Switched license to BSD License
2897f4d
a6fdf79
* Fri Aug 24 2007 Remi Collet <Fedora@FamilleCollet.com> 1.2.8-2
a6fdf79
- Fix License
a6fdf79
2cc6e83
* Sat Dec 02 2006 Remi Collet <Fedora@FamilleCollet.com> 1.2.8-1
2cc6e83
- update to 1.2.8
2cc6e83
- remove PEAR from sumnary
2cc6e83
- don't own %%{pear_phpdir}/XML
2cc6e83
- spec cleanning (new template)
2cc6e83
7606cbc
* Fri Sep 08 2006 Remi Collet <Fedora@FamilleCollet.com> 1.2.7-4
7606cbc
- last template.spec
7606cbc
b1b65ca
* Sun Sep 03 2006 Remi Collet <Fedora@FamilleCollet.com> 1.2.7-3
b1b65ca
- new and simpler %%prep and %%install
b1b65ca
b1b65ca
* Sat Sep 02 2006 Remi Collet <Fedora@FamilleCollet.com> 1.2.7-2
b1b65ca
- use new macros from /etc/rpm/macros.pear
b1b65ca
- own /usr/share/pear/XML
b1b65ca
- require php >= 4.2.0
b1b65ca
b1b65ca
* Sun May 21 2006 Remi Collet <Fedora@FamilleCollet.com> 1.2.7-1
b1b65ca
- spec for extras
b1b65ca
- add french description & sumnary