%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}} %define pear_name Image_Canvas Name: php-pear-Image-Canvas Version: 0.3.1 Release: 3%{?dist} Summary: Common interface to image drawing Group: Development/Libraries License: LGPLv2+ URL: http://pear.php.net/package/Image_Canvas Source0: http://pear.php.net/get/%{pear_name}-%{version}.tgz BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: php-pear >= 1:1.4.9-1.2 Requires: php-pear(PEAR) Requires: php-pear(Image_Color) >= 1.0.0 #Requires(hint): php-pecl-pdflib Requires(post): %{__pear} Requires(postun): %{__pear} Provides: php-pear(%{pear_name}) = %{version} %description A package providing a common interface to image drawing, making image source code independent on the library used. %prep %setup -qc [ -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 find docdir -type f -exec sed -i 's/\r//' {} \; # Clean up unnecessary files rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??* # Install XML package description install -d $RPM_BUILD_ROOT%{pear_xmldir} install -pm 644 %{pear_name}.xml $RPM_BUILD_ROOT%{pear_xmldir} # Create a README.Fedora file for PDF usage cat > README.Fedora << EOF To use PDF.php in this package, you must install the php-pecl-pdflib package which is available in other 3rd party repositories. The php-pecl-pdflib package is not required to use this package as long as you do not use the PDF features. EOF %clean rm -rf $RPM_BUILD_ROOT %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 %defattr(-,root,root,-) %doc %{pear_name}-%{version}/docdir/%{pear_name}/docs/* %doc %{pear_name}-%{version}/README.Fedora %{pear_xmldir}/%{pear_name}.xml %{pear_testdir}/%{pear_name} %{pear_phpdir}/Image/Canvas* %changelog * Thu Feb 26 2009 Fedora Release Engineering - 0.3.1-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Thu Aug 28 2008 Tom "spot" Callaway - 0.3.1-2 - fix license tag * Mon Jul 02 2007 Christopher Stone 0.3.1-1 - Upstream Sync * Wed Jan 03 2007 Christopher Stone 0.3.0-3 - No longer remove PDF.php file - Add README.Fedora file exlaining requirements for PDF.php - No longer own Image directory * Thu Dec 07 2006 Christopher Stone 0.3.0-2 - Remove PDF.php until php-pecl-pdflib is added to Extras * Sun Dec 03 2006 Christopher Stone 0.3.0-1 - Initial Release