File php5-pear-ezc-Graph.spec of Package php5-pear-ezc-Graph
#
# spec file for package php5-pear-ezc-Graph
#
# 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: Graph package of ezcomponents
Name: php5-pear-ezc-Graph
Version: 1.5
Release: 1
License: New BSD
Group: Development/Libraries/PHP
Source0: http://components.ez.no/get/Graph-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Url: http://components.ez.no/package/Graph
BuildRequires: php5-pear-channel-ezno
BuildRequires: php5-pear-ezc-Base
BuildRequires: php-macros
BuildRequires: fdupes
PreReq: php5-pear-channel-ezno
Requires: php5-posix
Requires: php5-pear-ezc-Base
BuildArch: noarch
%define pear_name Graph
%define pear_sname graph
%description
The Graph package provides the basic infrastructure for graphs.
%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}/%{pear_name}.xml
%fdupes %{buildroot}/%{_docdir}/%{pear_name}/docs/img/
%fdupes %{buildroot}/%{php_peardir}/ezc/
%php_pear_gen_filelist
%clean
rm -rf %{buildroot}
%post
pear install --nodeps --soft --force --register-only %{php_pearxmldir}/%{pear_name}.xml
%postun
if [ "$1" -eq "0" ]; then
pear uninstall --nodeps --ignore-errors --register-only components.ez.no/%{pear_name}
fi
%files -f %{name}.files
%defattr(-,root,root)
%{_docdir}/%{pear_name}/
%changelog