File php5-pear-cache_lite.spec of Package php5-pear-cache_lite

# spec file for package php5-pear-cache_lite
# 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

# norootforbuild

%define peardir %(pear config-get php_dir 2> /dev/null)
%define xmldir  /var/lib/pear

Summary:        Fast and Safe little cache system

Name:           php5-pear-cache_lite
Version:        1.7.2
Release:        1.<RELEASE2>
License:        LGPL
Group:          Development/Libraries/Other
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  php5-pear
PreReq:         php5-pear
BuildArch:      noarch

This package is a little cache system optimized for file containers. It is
fast and safe (because it uses file locking and/or anti-corruption tests).


%setup -c -T

pear -v -c pearrc \
        -d php_dir=%{peardir} \
        -d doc_dir=/docs \
        -d bin_dir=%{_bindir} \
        -d data_dir=%{peardir}/data \
        -d test_dir=%{peardir}/tests \
        -d ext_dir=%{_libdir} \



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

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

mv %{buildroot}/docs .

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


rm -rf %{buildroot}


pear install --nodeps --soft --force --register-only %{xmldir}/Cache_Lite.xml


if [ "$1" -eq "0" ]; then
    pear uninstall --nodeps --ignore-errors --register-only


%doc docs/Cache_Lite/*

openSUSE Build Service is sponsored by