%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%global channel pear.doctrine-project.org
Name: php-channel-doctrine
Version: 1.3
Release: 3%{?dist}.1
Summary: Adds doctrine project channel to PEAR
Group: Development/Languages
License: LGPLv2+
URL: http://www.doctrine-project.org/
Source0: http://pear.doctrine-project.org/channel.xml
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
BuildRequires: php-pear >= 1:1.4.9-1.2
Requires: php-cli
Requires: php-pear(PEAR)
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides: php-channel(%{channel})
%description
This package adds the doctrine channel which allows
PEAR packages from this channel to be installed.
%prep
%setup -q -c -T
%build
# Empty build section, nothing to build
%install
%{__rm} -rf $RPM_BUILD_ROOT
%{__mkdir_p} $RPM_BUILD_ROOT%{pear_xmldir}
%{__install} -pm 644 %{SOURCE0} $RPM_BUILD_ROOT%{pear_xmldir}/%{name}.xml
%clean
%{__rm} -rf $RPM_BUILD_ROOT
%post
# always add (handle update from old pear.phpdoctrine.org)
%{__pear} channel-add %{pear_xmldir}/%{name}.xml > /dev/null || :
if [ $1 -gt 1 ] ; then
%{__pear} channel-update %{pear_xmldir}/%{name}.xml > /dev/null ||:
# will fail in most case (if installed packages)
%{__pear} channel-delete pear.phpdoctrine.org > /dev/null || :
fi
%postun
%{__pear} channel-delete pear.phpdoctrine.org > /dev/null || :
if [ $1 -eq 0 ] ; then
%{__pear} channel-delete %{channel} > /dev/null || :
fi
%files
%defattr(-,root,root,-)
%{pear_xmldir}/%{name}.xml
%changelog
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-3.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.3-2.1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Mon Apr 5 2010 Remi Collet <fedora@famillecollet.com> - 1.3-1.1
- fix xml filename
* Fri Apr 2 2010 Christof Damian <christof@damian.net> - 1.3-1
- new url and channel file
- changed version to use rest version
* Thu Aug 20 2009 Christof Damian <christof@damian.net> - 1.0.0-2
- changed license to LGPLv2+
* Sat Aug 15 2009 Christof Damian <christof@damian.net> - 1.0.0-1
- initial release