Blob Blame History Raw
%{!?pear_metadir: %global pear_metadir %{pear_phpdir}}
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%global pear_name HTTP

Summary:     Miscellaneous HTTP utilities
Summary(fr): Divers utilitaires HTTP
Name:        php-pear-HTTP
Version:     1.4.1
Release:     12%{?dist}
License:     PHP
Group:       Development/Libraries
URL:         http://pear.php.net/package/HTTP
Source:      http://pear.php.net/get/HTTP-%{version}.tgz
Source2:     xml2changelog
BuildRoot:   %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

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

%description
The HTTP class is a class with static methods for doing 
miscellaneous HTTP related stuff like date formatting,
language negotiation or HTTP redirection.
 
%description -l fr
La classe HTTP contient des méthodes statiques pour
réaliser diverses tâches concernant HTTP, comme la mise
en forme des dates, la négociation de la langue ou les
redirections HTTP.


%prep
%setup -c -q
%{_bindir}/php -n %{SOURCE2} package.xml | tee CHANGELOG | head -n 10

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


%build
# Empty build section


%install
rm -rf %{buildroot}

cd %{pear_name}-%{version}
%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml

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

# Install XML package description
%{__mkdir_p} %{buildroot}%{pear_xmldir}
%{__install} -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}


%check
cd %{pear_name}-%{version}
PHPRC=../php.ini %{__pear} \
   run-tests \
   -i "-d include_path=%{buildroot}%{pear_phpdir}:%{pear_phpdir}" \
   tests | tee ../tests.log
grep "FAILED TESTS" ../tests.log && exit 1


%clean
rm -rf %{buildroot}


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


%postun
# if refcount = 0 then package has been removed (not upgraded)
if [ "$1" -eq "0" ]; then
    %{__pear} uninstall --nodeps --ignore-errors --register-only %{pear_name}  >/dev/null || :
fi


%files
%defattr(-,root,root,-)
%doc CHANGELOG
%{pear_phpdir}/HTTP.php
%{pear_xmldir}/%{name}.xml
%{pear_testdir}/HTTP


%changelog
* Tue Feb 19 2013 Remi Collet <remi@fedoraproject.org> - 1.4.1-12
- fix metadata location

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

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

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.1-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

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

* Sat Apr 16 2011 Remi Collet <Fedora@FamilleCollet.com> 1.4.1-7
- run test suite in %%check
- define timezone during build

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Sat May 22 2010 Remi Collet <Fedora@FamilleCollet.com> 1.4.1-5
- spec cleanup
- rename HTTP.xml to php-pear-HTTP.xml

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Sat Sep 13 2008 Remi Collet <Fedora@FamilleCollet.com> 1.4.1-2
- Fix BR for PEAR >= 1.7.1

* Mon Sep  1 2008 Remi Collet <Fedora@FamilleCollet.com> 1.4.1-1
- update to 1.4.1 
- add tests

* Wed Aug 22 2007 Remi Collet <Fedora@FamilleCollet.com> 1.4.0-8
- remove PEAR from sumnary
- SPEC Cleanups - Fix License
- convert package.xml to package2.xml

* Thu Sep 07 2006 Remi Collet <Fedora@FamilleCollet.com> 1.4.0-7
- last template.spec

* Mon Sep 04 2006 Remi Collet <Fedora@FamilleCollet.com> 1.4.0-6
- new and simpler %%prep and %%install

* Mon Aug 28 2006 Remi Collet <Fedora@FamilleCollet.com> 1.4.0-5
- FE6 rebuild

* Sat May 20 2006 Remi Collet <Fedora@FamilleCollet.com> 1.4.0-4
- install Licence in prep
- use new macros from /etc/rpm/macros.pear

* Sat May 20 2006 Remi Collet <Fedora@FamilleCollet.com> 1.4.0-3
- Require pear >= 1.4.9
- bundle the v3.01 PHP LICENSE file
- use --packagingroot (instead of -R)
- check from install to check (as in php-pear)

* Sat May 06 2006 Remi Collet <Fedora@FamilleCollet.com> 1.4.0-2
- use %%{_datadir}/pear/.pkgxml for XML (Bug #190252)

* Fri Apr 28 2006 Remi Collet <Fedora@FamilleCollet.com> 1.4.0-1
- spec for extras
- add french summary & description

* Thu Apr 06 2006 Remi Collet <rpms@FamilleCollet.com> 1.4.0-2.fc{3,4,5}.remi
- change /var/lib/pear to %%{_libdir}/php/pear for XML (as in extras for FC5)
- spec cleanning

* Sat Jan  7 2006 Remi Collet <remi.collet@univ-reims.fr> 1.4.0-1.fc{3,4}.remi
- initial RPM