%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}} %define ClassName Date Name: php-pear-Date Version: 1.4.7 Release: 4%{?dist} Summary: Date and Time Zone Classes Group: Development/Libraries License: BSD URL: http://pear.php.net/package/Date Source0: http://pear.php.net/get/%{ClassName}-%{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(post): %{__pear} Requires(postun): %{__pear} Provides: php-pear(%{ClassName}) = %{version} %description Generic classes for representation and manipulation of dates, times and time zones without the need of timestamps, which is a huge limitation for php programs. Includes time zone data, time zone conversions and many date/time conversions. It does not rely on 32-bit system date stamps, so you can display calendars and compare dates that date pre 1970 and post 2038. This package also provides a class to convert date strings between Gregorian and Human calendar formats. %prep %setup -qc [ -f package2.xml ] || mv package.xml package2.xml mv package2.xml %{ClassName}-%{version}/%{ClassName}.xml cd %{ClassName}-%{version} %build cd %{ClassName}-%{version} # Empty build section, most likely nothing required. %install cd %{ClassName}-%{version} rm -rf $RPM_BUILD_ROOT docdir %{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{ClassName}.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 install -d $RPM_BUILD_ROOT%{pear_xmldir} install -pm 644 %{ClassName}.xml $RPM_BUILD_ROOT%{pear_xmldir} # Fix end of line encoding sed -i 's/\r//' docdir/%{ClassName}/docs/TODO %clean rm -rf $RPM_BUILD_ROOT %post %{__pear} install --nodeps --soft --force --register-only \ %{pear_xmldir}/%{ClassName}.xml >/dev/null ||: %postun if [ "$1" -eq "0" ]; then %{__pear} uninstall --nodeps --ignore-errors --register-only \ %{ClassName} >/dev/null ||: fi %files %defattr(-,root,root,-) %doc %{ClassName}-%{version}/docdir/%{ClassName}/docs/* %{pear_xmldir}/%{ClassName}.xml %{pear_testdir}/%{ClassName} %{pear_phpdir}/%{ClassName} %{pear_phpdir}/Date.php %changelog * Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.4.7-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.7-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild * Sat Apr 21 2007 Christopher Stone <chris.stone@gmail.com> 1.4.7-2 - Use sed instead of dos2unix - Some other minor spec file cleanups * Thu Nov 23 2006 Christopher Stone <chris.stone@gmail.com> 1.4.7-1 - Upstream Sync - Fix end-of-line encoding for TODO - Remove docs dir from %doc * Fri Jun 30 2006 Christopher Stone <chris.stone@gmail.com> 1.4.6-1 - Initial Release