%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}} %define pear_name %(echo %{name} | sed -e 's/^php-sabredav-//' -e 's/-/_/g') %global channelname pear.sabredav.org Name: php-sabredav-Sabre Version: 1.0.0 Release: 1%{?dist} Summary: Sabre_DAV is a WebDAV framework for PHP License: BSD URL: http://code.google.com/p/sabredav Source0: http://pear.sabredav.org/get/%{pear_name}-%{version}.tgz BuildArch: noarch BuildRequires: php-pear >= 1:1.4.9-1.2 Requires: php-pear(PEAR) BuildRequires: php-channel(%{channelname}) Requires(post): %{__pear} Requires(postun): %{__pear} Provides: php-pear(%{pear_name}) = %{version} Requires: php-channel(%{channelname}) Provides: php-pear(%{channelname}/%{pear_name}) = %{version} %description SabreDAV allows you to easily add WebDAV support to a PHP application. SabreDAV is meant to cover the entire standard, and attempts to allow integration using an easy to understand API. The base package provides some functionality used by all packages. Currently this is only an autoloader %prep %setup -q -c [ -f package2.xml ] || mv package.xml package2.xml mv package2.xml %{pear_name}-%{version}/%{pear_name}.xml cd %{pear_name}-%{version} %build cd %{pear_name}-%{version} # Empty build section, most likely nothing required. %install cd %{pear_name}-%{version} rm -rf $RPM_BUILD_ROOT docdir %{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{pear_name}.xml # Move documentation mkdir -p docdir mv $RPM_BUILD_ROOT%{pear_docdir}/* docdir # Clean up unnecessary files rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??* # Install XML package description mkdir -p $RPM_BUILD_ROOT%{pear_xmldir} install -pm 644 %{pear_name}.xml $RPM_BUILD_ROOT%{pear_xmldir} %post %{__pear} install --nodeps --soft --force --register-only \ %{pear_xmldir}/%{pear_name}.xml >/dev/null || : %postun if [ $1 -eq 0 ] ; then %{__pear} uninstall --nodeps --ignore-errors --register-only \ %{pear_name} >/dev/null || : fi %files %doc %{pear_name}-%{version}/docdir/%{pear_name}/* %{pear_xmldir}/%{pear_name}.xml %{pear_phpdir}/%{pear_name} %changelog * Fri Apr 06 2012 Felix Kaechele - 1.0.0-1 - initial package