File horde4-content.spec of Package horde4-content

# spec file for package horde4-content
# 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

%define peardir %(pear config-get php_dir 2> /dev/null || echo %{_datadir}/pear)
%define xmldir  /var/lib/pear
%define hordedir /usr/share/php5/PEAR/www/horde

Summary:        PEAR: Horde tagging application
License:        BSD-3-Clause
Group:          Productivity/Networking/Web/Utilities

Name:           horde4-content
Version:        1.0.3
Release:        0
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  php5-pear >= 1.7.0
Requires:       horde4 < 5.0.0, php5-pear >= 1.7.0
BuildRequires:  horde4
BuildRequires:  php5-pear-Horde_Role
BuildRequires:  php5-pear-channel-horde
Requires:       php5-pear-channel-horde, php5-pear-Horde_Role, php5-pear-Horde_Core <= 2.0.0, php5-pear-Horde_Date, php5-pear-Horde_Exception
Requires:       php5-pear-Horde_Util,  php5-pear-Horde_Db,  php5-pear-Horde_Injector, php5-pear-Horde_Rdo, php5-pear-Horde_Argv, php5-pear-Horde_Controller
Requires:       php5-gettext, php5-json
BuildArch:      noarch
BuildRequires:  fdupes

This application provides tagging support for the other Horde applications.

%setup -c -T
pear -v -c pearrc \
        -d php_dir=%{peardir} \
        -d doc_dir=%{_docdir}/%{name} \
        -d bin_dir=%{_bindir} \
        -d data_dir=%{peardir}/data \
        -d test_dir=%{peardir}/tests \
        -d ext_dir=%{_libdir} \
        -d horde_dir=%{hordedir} \


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

%fdupes %buildroot%{hordedir}/content

# 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

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

rm -rf %{buildroot}

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

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

%doc %{_docdir}/%{name}