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

Name:           php-pear-Date-Holidays
Version:        0.21.4
Release:        1%{?dist}.1
Summary:        Driver based class to calculate holidays

Group:          Development/Libraries
License:        PHP
URL:            http://pear.php.net/package/Date_Holidays
Source0:        http://pear.php.net/get/%{pear_name}-%{version}.tgz
Source1:        PHP-LICENSE-3.01
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  php-pear >= 1:1.4.9-1.2
Requires:       php-pear(PEAR) php-pear(Date) php-pear(XML_Serializer)
Requires(hint): php-pear(Console_Getargs)
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides:       php-pear(%{pear_name}) = %{version}

%description
Date_Holidays helps you calculating the dates and titles of holidays and
other special celebrations. The calculation is driver-based so it is easy
to add new drivers that calculate a country's holidays. The methods of the
class can be used to get a holiday's date and title in various languages.


%prep
%setup -qc
[ -f package2.xml ] || mv package.xml package2.xml
mv package2.xml %{pear_name}-%{version}/%{pear_name}.xml
install -pm 644 -c %{SOURCE1} LICENSE
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
install -d $RPM_BUILD_ROOT%{pear_xmldir}
install -pm 644 %{pear_name}.xml $RPM_BUILD_ROOT%{pear_xmldir}


%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 LICENSE %{pear_name}-%{version}/docdir/%{pear_name}/*
%{_bindir}/pear-dh-*
%{pear_xmldir}/%{pear_name}.xml
%{pear_testdir}/%{pear_name}
%{pear_datadir}/%{pear_name}
%{pear_phpdir}/Date/Holidays*


%changelog
* Sun Aug 30 2009 Christopher Stone <chris.stone@gmail.com> 0.21.4-1.1
- Upstream sync

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.20.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.20.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Fri Sep 12 2008 Christopher Stone <chris.stone@gmail.com> 0.20.1-1
- Upstream sync

* Thu May 22 2008 Christopher Stone <chris.stone@gmail.com> 0.19.1-1
- Upstream sync

* Thu Feb 07 2008 Christopher Stone <chris.stone@gmail.com> 0.17.4-1
- Upstream sync

* Mon Jul 02 2007 Christopher Stone <chris.stone@gmail.com> 0.17.1-2
- Add files to %%{_bindir}

* Mon Jul 02 2007 Christopher Stone <chris.stone@gmail.com> 0.17.1-1
- Upstream Sync
- Update license file

* Sun Jan 14 2007 Christopher Stone <chris.stone@gmail.com> 0.17.0-1
- Upstream sync
- Remove %%{_bindir} files from %%files

* Sun Jan 14 2007 Christopher Stone <chris.stone@gmail.com> 0.16.1-2
- Add LICENSE

* Sat Oct 14 2006 Christopher Stone <chris.stone@gmail.com> 0.16.1-1
- Initial release