File horde4-nag.spec of Package horde4-nag

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

%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:        A web based tasklist manager with sync options
License:        GPL-2.0
Group:          Productivity/Networking/Web/Utilities

Name:           horde4-nag
Version:        3.0.7
Release:        0
Source0:        http://pear.horde.org/get/nag-%{version}.tgz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            http://pear.horde.org/package/nag
BuildRequires:  php5-pear >= 1.4.7
Requires:       horde4 < 5.0.0, php5-pear >= 1.7.0
Conflicts:      horde4 = 5.0.0
BuildRequires:  fdupes
BuildRequires:  php5-pear-Horde_Role
BuildRequires:  php5-pear-channel-horde
Requires:       php5-pear-channel-horde, php5-pear-Horde_Role, php5-pear-Horde_Auth, php5-pear-Horde_Core, php5-pear-Horde_Data, php5-pear-Horde_Date, php5-pear-Horde_Date_Parser, php5-pear-Horde_Exception, php5-pear-Horde_Form 
Requires:       php5-pear-Horde_Group, php5-pear-Horde_History, php5-pear-Horde_Icalendar, php5-pear-Horde_Db, php5-pear-Horde_Pdf, php5-pear-Horde_Crypt, php5-pear-Horde_Cli, php5-pear-Horde_Mime
Requires:       php5-pear-Horde_Prefs, php5-pear-Horde_Perms, php5-pear-Horde_Share, php5-pear-Horde_Support, php5-pear-Horde_Text_Filter, php5-pear-Horde_View, php5-pear-Horde_ActiveSync  
Requires:       php5-pear-Horde_Db
Requires:       php5-gettext
BuildArch:      noarch

%description
Nag is a web-based application built upon the Horde Application Framework which provides a simple, 
clean interface for managing online task lists (i.e., todo lists). 
It also includes strong integration with the other Horde applications and allows 
users to share task lists or enable light-weight project management.

%prep
%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=%{testdir} \
        -d ext_dir=%{_libdir} \
        -d horde_dir=%{hordedir} \
        -s

%build

%install
pear -c pearrc install --nodeps --packagingroot %{buildroot} %{SOURCE0}
%fdupes %buildroot%{hordedir}/nag
%find_lang nag 
# 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}/nag.xml

%clean
rm -rf %{buildroot}

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

%postun
if [ "$1" -eq "0" ]; then
    pear uninstall --nodeps --ignore-errors --register-only pear.horde.org/nag
fi

%files -f nag.lang
%defattr(-,root,root)
%doc %{_docdir}/%{name}
%{peardir}/*
%{xmldir}/nag.xml
%{hordedir}/nag
%attr(0775,root,www) %dir %{hordedir}/nag/config
/usr/bin/nag-convert-datatree-shares-to-sql
/usr/bin/nag-convert-sql-shares-to-sqlng
/usr/bin/nag-create-missing-add-histories-sql
/usr/bin/nag-import-vtodos

%changelog
openSUSE Build Service is sponsored by