xulchris 49ce9c4
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
xulchris 061b29e
%define ClassName MDB2
xulchris 49ce9c4
xulchris 49ce9c4
Name:           php-pear-MDB2
xulchris 934f002
Version:        2.4.1
xulchris d0683a0
Release:        1%{?dist}
xulchris 49ce9c4
Summary:        Database Abstraction Layer
xulchris 49ce9c4
xulchris 49ce9c4
Group:          Development/Libraries
xulchris 49ce9c4
License:        BSD
xulchris 49ce9c4
URL:            http://pear.php.net/package/MDB2
xulchris 061b29e
Source0:        http://pear.php.net/get/%{ClassName}-%{version}.tgz
xulchris 49ce9c4
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
xulchris 49ce9c4
xulchris 49ce9c4
BuildArch:      noarch
xulchris 49ce9c4
BuildRequires:  php-pear >= 1:1.4.9-1.2
xulchris 061b29e
Requires:       php-pear(PEAR) >= 1.3.6
xulchris 49ce9c4
Requires(post): %{__pear}
xulchris 49ce9c4
Requires(postun): %{__pear}
xulchris 061b29e
Provides:       php-pear(%{ClassName}) = %{version}
xulchris 49ce9c4
xulchris 49ce9c4
%description
xulchris 49ce9c4
PEAR::MDB2 is a merge of the PEAR::DB and Metabase php database abstraction
xulchris 49ce9c4
layers.
xulchris 49ce9c4
xulchris 49ce9c4
It provides a common API for all supported RDBMS. The main difference to most
xulchris 49ce9c4
other DB abstraction packages is that MDB2 goes much further to ensure
xulchris 49ce9c4
portability.
xulchris 49ce9c4
xulchris 49ce9c4
xulchris 49ce9c4
%prep
xulchris 4ea8bab
%setup -qc
xulchris 49ce9c4
[ -f package2.xml ] || mv package.xml package2.xml
xulchris 061b29e
mv package2.xml %{ClassName}-%{version}/%{ClassName}.xml
xulchris 061b29e
cd %{ClassName}-%{version}
xulchris 49ce9c4
xulchris 49ce9c4
xulchris 49ce9c4
%build
xulchris 061b29e
cd %{ClassName}-%{version}
xulchris 49ce9c4
# Empty build section, most likely nothing required.
xulchris 49ce9c4
xulchris 49ce9c4
xulchris 49ce9c4
%install
xulchris 061b29e
cd %{ClassName}-%{version}
xulchris 49ce9c4
rm -rf $RPM_BUILD_ROOT docdir
xulchris 061b29e
%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{ClassName}.xml
xulchris 49ce9c4
xulchris 49ce9c4
# Move documentation
xulchris 49ce9c4
mkdir -p docdir
xulchris 49ce9c4
mv $RPM_BUILD_ROOT%{pear_docdir}/* docdir
xulchris d0683a0
mv $RPM_BUILD_ROOT%{pear_datadir}/%{ClassName}/LICENSE docdir/%{ClassName}/docs
xulchris 49ce9c4
xulchris 49ce9c4
# Clean up unnecessary files
xulchris 49ce9c4
rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*
xulchris 49ce9c4
xulchris 49ce9c4
# Install XML package description
xulchris 4ea8bab
install -d $RPM_BUILD_ROOT%{pear_xmldir}
xulchris 061b29e
install -pm 644 %{ClassName}.xml $RPM_BUILD_ROOT%{pear_xmldir}
xulchris 49ce9c4
xulchris 49ce9c4
xulchris 49ce9c4
%clean
xulchris 49ce9c4
rm -rf $RPM_BUILD_ROOT
xulchris 49ce9c4
xulchris 49ce9c4
xulchris 49ce9c4
%post
xulchris 49ce9c4
%{__pear} install --nodeps --soft --force --register-only \
xulchris 061b29e
    %{pear_xmldir}/%{ClassName}.xml >/dev/null ||:
xulchris 49ce9c4
xulchris 49ce9c4
%postun
xulchris 49ce9c4
if [ "$1" -eq "0" ]; then
xulchris 49ce9c4
    %{__pear} uninstall --nodeps --ignore-errors --register-only \
xulchris 061b29e
        %{ClassName} >/dev/null ||:
xulchris 49ce9c4
fi
xulchris 49ce9c4
xulchris 49ce9c4
xulchris 49ce9c4
%files
xulchris 49ce9c4
%defattr(-,root,root,-)
xulchris 061b29e
%doc %{ClassName}-%{version}/docdir/%{ClassName}/docs/*
xulchris 061b29e
%{pear_xmldir}/%{ClassName}.xml
xulchris 061b29e
%{pear_testdir}/%{ClassName}
xulchris 061b29e
%{pear_phpdir}/%{ClassName}
xulchris 49ce9c4
%{pear_phpdir}/MDB2.php
xulchris 49ce9c4
xulchris 49ce9c4
xulchris 49ce9c4
%changelog
xulchris 934f002
* Sat May 05 2007 Christopher Stone <chris.stone@gmail.com> 2.4.1-1
xulchris 934f002
- Upstream sync
xulchris 934f002
xulchris 4ea8bab
* Tue Mar 13 2007 Christopher Stone <chris.stone@gmail.com> 2.4.0-1
xulchris 4ea8bab
- Upstream sync
xulchris 4ea8bab
xulchris d0683a0
* Tue Nov 21 2006 Christopher Stone <chris.stone@gmail.com> 2.3.0-1
xulchris d0683a0
- Upstream sync
xulchris d0683a0
- Move LICENSE file from %%{pear_datadir} to %%doc
xulchris d0683a0
xulchris 061b29e
* Thu Sep 07 2006 Christopher Stone <chris.stone@gmail.com> 2.2.2-2
xulchris 061b29e
- Sync up with latest pear template
xulchris 061b29e
xulchris 49ce9c4
* Wed Sep 06 2006 Christopher Stone <chris.stone@gmail.com> 2.2.2-1
xulchris 49ce9c4
- Upstream sync
xulchris 49ce9c4
- Update spec to latest template
xulchris 49ce9c4
xulchris 49ce9c4
* Sun Sep 03 2006 Christopher Stone <chris.stone@gmail.com> 2.1.0-4
xulchris 49ce9c4
- Update to latest template
xulchris 49ce9c4
xulchris 49ce9c4
* Thu Jun 29 2006 Christopher Stone <chris.stone@gmail.com> 2.1.0-3
xulchris 49ce9c4
- Remove some hacks, clean up spec file
xulchris 49ce9c4
xulchris 49ce9c4
* Wed Jun 28 2006 Christopher Stone <chris.stone@gmail.com> 2.1.0-2
xulchris 49ce9c4
- Remove %%build section since it is not used
xulchris 49ce9c4
xulchris 49ce9c4
* Mon Jun 26 2006 Christopher Stone <chris.stone@gmail.com> 2.1.0-1
xulchris 49ce9c4
- Initial Release