%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%global pear_name XML_RSS
Name: php-pear-XML-RSS
Version: 1.0.2
Release: 2%{?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
Source2: xml2changelog
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php-pear >= 1:1.4.9-1.2
# For test suite
BuildRequires: php-pear(pear.phpunit.de/PHPUnit)
BuildRequires: php-pear(XML_Parser)
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
%{_bindir}/php -n %{SOURCE2} package.xml | tee CHANGELOG | head -n 10
# Create a "localized" php.ini to avoid build warning
cp /etc/php.ini .
echo "date.timezone=UTC" >>php.ini
cd %{pear_name}-%{version}
# package.xml is V2
mv ../package.xml %{name}.xml
%build
cd %{pear_name}-%{version}
# Empty build section, most likely nothing required.
%install
rm -rf $RPM_BUILD_ROOT
cd %{pear_name}-%{version}
PHPRC=../php.ini %{__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
cd %{pear_name}-%{version}
phpunit \
-d date.timezone=UTC \
-d include_path=.:$RPM_BUILD_ROOT%{pear_phpdir}:%{pear_phpdir} \
tests
%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 CHANGELOG
%{pear_xmldir}/%{name}.xml
%{pear_testdir}/%{pear_name}
%{pear_phpdir}/XML/RSS.php
%changelog
* Wed Jul 6 2011 Remi Collet <Fedora@FamilleCollet.com> - 1.0.2-2
- fix includepacth in test (FTBFS #715645)
* Tue May 3 2011 Remi Collet <Fedora@FamilleCollet.com> - 1.0.2-1
- Version 1.0.2 (stable) - API 1.0.0 (stable)
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Oct 25 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.0.1-1
- Version 1.0.1 (stable) - API 1.0.0 (stable)
- add generated Changelog
- define timezone during build
- run tests in %%check
* 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