File php5-pear-ezc-Base.spec of Package php5-pear-ezc-Base

#
# spec file for package php5-pear-ezc-Base
#
# Copyright (c) 2011 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


Summary:        Base package of ezcomponents
License:        BSD-3-Clause
Group:          Development/Libraries/PHP

Name:           php5-pear-ezc-Base
Version:        1.8
Release:        0
Source0:        http://components.ez.no/get/Base-%{version}.tgz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            http://components.ez.no/package/Base
BuildRequires:  php-macros
BuildRequires:  php5-pear-channel-ezno
PreReq:         php5-pear-channel-ezno
Requires:       php5-posix
BuildArch:      noarch
%define pear_name  Base
%define pear_sname base

%description
The Base package provides the basic infrastructure that all packages rely
on.
Therefore every component relies on this package.

%prep
%setup -c -T
pear -v -c pearrc \
        -d php_dir=%{php_peardir} \
        -d doc_dir=/%{_docdir} \
        -d bin_dir=%{_bindir} \
        -d data_dir=%{php_peardir}/data \
        -d test_dir=%{php_peardir}/tests \
        -d ext_dir=%{_libdir} \
        -s

%build

%install

pear -c pearrc install --nodeps --packagingroot %{buildroot} %{SOURCE0}

# Clean up unnecessary files
rm pearrc
rm %{buildroot}/%{php_peardir}/.filemap
rm %{buildroot}/%{php_peardir}/.lock
rm -rf %{buildroot}/%{php_peardir}/.registry
rm -rf %{buildroot}%{php_peardir}/.channels
rm %{buildroot}%{php_peardir}/.depdb
rm %{buildroot}%{php_peardir}/.depdblock

# Install XML package description
mkdir -p %{buildroot}%{php_pearxmldir}
tar -xzf %{SOURCE0} package.xml
cp -p package.xml %{buildroot}%{php_pearxmldir}/Base.xml

%php_pear_gen_filelist

%clean
rm -rf %{buildroot}

%post
pear install --nodeps --soft --force --register-only %{php_pearxmldir}/Base.xml

%postun
if [ "$1" -eq "0" ]; then
    pear uninstall --nodeps --ignore-errors --register-only components.ez.no/Base
fi

%files -f %{name}.files
%defattr(-,root,root)
%{_docdir}/%{pear_name}/
%{php_peardir}/ezc/Base/*
%{php_peardir}/ezc/autoload/base_autoload.php
%{php_peardir}/data/Base
%{php_pearxmldir}/Base.xml

%changelog