File horde5-timeobjects.spec of Package horde5-timeobjects
#
# spec file for package horde5-timeobjects
#
# 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
%define pear_name timeobjects
Summary: Horde timeobjects application
License: BSD-2-Clause
Group: Productivity/Networking/Web/Utilities
Name: horde5-timeobjects
Version: 2.0.2
Release: 0
Source0: http://pear.horde.org/get/timeobjects-%{version}.tgz
Source1: timeobjects.conf
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Url: http://pear.horde.org/package/%{pear_name}
Conflicts: horde < 5.0.0
Conflicts: horde > 6.0.0
BuildRequires: horde5
BuildRequires: php-pear >= 1.9.0
BuildRequires: php5-pear-Horde_Role >= 1.0.1
BuildRequires: php5-pear-channel-horde
Requires: horde5 >= 5.0.1
Requires: php-pear >= 1.9.0
Requires: php5-pear-Horde_Core >= 2.0.0
Requires: php5-pear-Horde_Date >= 2.0.0
Requires: php5-pear-Horde_Exception >= 2.0.0
Requires: php5-pear-Horde_Role >= 1.0.1
Requires: php5-pear-Horde_Url >= 2.0.0
Requires: php5-pear-Horde_Util >= 2.0.0
Requires: php5-pear-channel-horde
%if 0%{?sles_version} == 11
BuildRequires: php53-devel
%else
BuildRequires: php-macros
%endif
BuildArch: noarch
BuildRequires: fdupes
%description
The timeobjects application doesn't have an interface but provides streams
of events to any applications that can consume them, notably the Horde
calendar application. It contains drivers for facebook events and weather
forecasts and can easily be extended by custom drivers.
%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=%{peardir}/tests \
-d ext_dir=%{_libdir} \
-d horde_dir=%{hordedir} \
-s
%build
%install
pear -c pearrc install --nodeps --packagingroot %{buildroot} %{SOURCE0}
%{__install} -m 0660 -D %{SOURCE1} %{buildroot}/etc/horde/apache-snippets.d/%{pear_name}.conf
## clean individual .htaccess files as they are incorporated into vhost snippets
%{__rm} %{buildroot}/%{hordedir}/%{pear_name}/locale/.htaccess
%fdupes %buildroot%{hordedir}/%{pear_name}
%find_lang timeobjects
# 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}/%{pear_name}.xml
%clean
rm -rf %{buildroot}
%post
pear install --nodeps --soft --force --register-only %{xmldir}/%{pear_name}.xml
%postun
if [ "$1" -eq "0" ]; then
pear uninstall --nodeps --ignore-errors --register-only pear.horde.org/%{pear_name}
fi
%files -f timeobjects.lang
%defattr(-,root,root)
%doc %{_docdir}/%{name}
%{peardir}/*
%{xmldir}/timeobjects.xml
%{hordedir}/timeobjects
%config /etc/horde/apache-snippets.d/timeobjects.conf
%changelog