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

%global channel pear.doctrine-project.org

Name:		php-channel-doctrine
Version:	1.3
Release:	1%{?dist}
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}/%{channel}.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}/*


%changelog
* 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