Blob Blame History Raw
%{!?pear_metadir: %global pear_metadir %{pear_phpdir}}
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%global pear_name   XML_RSS
%global with_tests  %{?_with_tests:1}%{!?_with_tests:0}

Name:           php-pear-XML-RSS
Version:        1.0.2
Release:        10%{?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

# https://github.com/pear/XML_RSS/commit/528439f58b15aea71f8932e51b96ce63407cfc20
Patch1:         XML_RSS-git.patch

BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
BuildRequires:  php-pear >= 1:1.4.9-1.2
%if %{with_tests}
# For test suite
BuildRequires:  php-pear(pear.phpunit.de/PHPUnit)
BuildRequires:  php-pear(XML_Parser)
%endif

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

cd %{pear_name}-%{version}
# package.xml is V2
mv ../package.xml %{name}.xml

%patch1 -p1 -b .orig

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


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

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

# Install XML package description
install -d $RPM_BUILD_ROOT%{pear_xmldir}
install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}


%check
%if %{with_tests}
# error_reporting = E_ALL & ~E_STRICT & ~E_DEPRECATED = 22527
cd %{pear_name}-%{version}
phpunit \
   -d date.timezone=UTC \
   -d error_reporting=22527 \
   -d include_path=.:$RPM_BUILD_ROOT%{pear_phpdir}:%{pear_phpdir} \
   tests
%endif


%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
* Fri Jan 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-10
- run tests only when build with --with tests (circular dep.)

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

* Tue Feb 19 2013 Remi Collet <remi@fedoraproject.org> - 1.0.2-8
- fix metadata location

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Tue Aug 14 2012 Remi Collet <remi@fedoraproject.org> - 1.0.2-6
- rebuilt for new pear_testdir

* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Mon Jan 16 2012 Remi Collet <remi@fedoraproject.org> - 1.0.2-4
- fix from GIT for test suite

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.0.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* 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