%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%global pear_name XML_RSS
Name: php-pear-XML-RSS
Version: 1.0.0
Release: 1%{?dist}
Summary: RSS parser
Group: Development/Libraries
License: PHP
URL: http://pear.php.net/package/XML_RSS
Source0: http://pear.php.net/get/%{pear_name}-%{version}.tgz
Source1: PHP-LICENSE-3.01
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php-pear >= 1:1.4.9-1.2
Requires: php-pear(PEAR)
Requires: php-pear(XML_Parser) > 1.0.1
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides: php-pear(%{pear_name}) = %{version}
%description
Parser for Resource Description Framework (RDF) Site Summary (RSS)
documents.
%prep
%setup -qc
# package.xml is V2
mv package.xml %{pear_name}-%{version}/%{name}.xml
install -pm 644 -c %{SOURCE1} LICENSE
cd %{pear_name}-%{version}
%build
cd %{pear_name}-%{version}
# Empty build section, most likely nothing required.
%install
cd %{pear_name}-%{version}
rm -rf $RPM_BUILD_ROOT docdir
%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
# Clean up unnecessary files
rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*
# Install XML package description
install -d $RPM_BUILD_ROOT%{pear_xmldir}
install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
%check
# For documentation, after install:
# cd /usr/share/pear/test/XML_RSS/tests ; phpunit .
# With PHPUnit 3.4.11 and XML_RSS 1.0.0:
# OK (9 tests, 19 assertions)
%clean
rm -rf $RPM_BUILD_ROOT
%post
%{__pear} install --nodeps --soft --force --register-only \
%{pear_xmldir}/%{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 LICENSE
%{pear_xmldir}/%{name}.xml
%{pear_testdir}/%{pear_name}
%{pear_phpdir}/XML/RSS.php
%changelog
* Sun Mar 28 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.0.0-1
- new upstream stable version
- rename XML_RSS.xml to php-pear-XML-RSS.xml
- add %%check for documentation only
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.10-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.9.10-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
* Thu Oct 23 2008 Christopher Stone <chris.stone@gmail.com> 0.9.10-5
- Update LICENSE to 3.01
* Thu Aug 28 2008 Tom "spot" Callaway <tcallawa@redhat.com> 0.9.10-4
- fix license tag
* Sun Jan 14 2007 Christopher Stone <chris.stone@gmail.com> 0.9.10-3
- Use correct version of PHP License
* Thu Nov 09 2006 Christopher Stone <chris.stone@gmail.com> 0.9.10-2
- Added license file to %%doc
- Added versioned requires
* Sun Oct 29 2006 Christopher Stone <chris.stone@gmail.com> 0.9.10-1
- Initial Release