File php5-pear-ezc-ConsoleTools.spec of Package php5-pear-ezc-ConsoleTools
#
# spec file for package php5-pear-ezc-ConsoleTools
#
# Copyright (c) 2012 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: ConsoleTools package of ezcomponents
License: BSD-3-Clause
Group: Development/Libraries/PHP
Name: php5-pear-ezc-ConsoleTools
Version: 1.6.1
Release: 0
Source0: http://components.ez.no/get/ConsoleTools-%{version}.tgz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Url: http://components.ez.no/package/ConsoleTools
BuildRequires: php-macros
BuildRequires: php5-pear-channel-ezno
BuildRequires: php5-pear-ezc-Base
PreReq: php5-pear-channel-ezno
Requires: php5-posix
Requires: php5-pear-ezc-Base
BuildArch: noarch
%define pear_name ConsoleTools
%define pear_sname ConsoleTools
%description
The ConsoleTools package provides Console handling.
%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
%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