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

#
# spec file for package php5-pear-Horde_SyncMl
#
# 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 http://bugs.opensuse.org/
#


%define peardir %(pear config-get php_dir 2> /dev/null || echo %{_datadir}/pear)
%define xmldir  /var/lib/pear

Summary:        PEAR: Horde_SyncMl provides an API for processing SyncML requests

Name:           php5-pear-Horde_SyncMl
Version:        1.0.4
Release:        1
License:        LGPLv2.1
Group:          Development/Libraries/PHP
Source0:        http://pear.horde.org/get/Horde_SyncMl-%{version}.tgz
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Url:            http://pear.horde.org/package/Horde_SyncMl
BuildRequires:  php5-pear >= 1.4.7
Requires:       php5-pear-Horde_Date < 2.0.0, php5-pear-Horde_Icalendar < 2.0.0, php5-pear-Horde_Log < 2.0.0, php5-pear-Horde_Support < 2.0.0, php5-pear-Horde_Util < 2.0.0, php5-pear-Horde_Xml_Wbxml < 2.0.0, php5-pear-Horde_Translation < 2.0.0, php5-pear >= 1.7.0
BuildRequires:  php5-pear-channel-horde
Requires:       php5-pear-channel-horde
BuildArch:      noarch
%define pear_name  Horde_SyncMl
%define pear_sname horde_syncml
# Fix for renaming (package convention)
Provides:       php5-pear-%{pear_sname} = %{version}
Provides:       php-pear-%{pear_sname} = %{version}
Provides:       pear-%{pear_sname} = %{version}
Obsoletes:      php5-pear-%{pear_sname} < %{version}
Obsoletes:      php-pear-%{pear_sname} < %{version}
Obsoletes:      pear-%{pear_sname} < %{version}

%description
This package provides classes for implementing a SyncML server.
SyncML is an OMA standard for synchronizing contacts, notes, calendar and tasks of mobile devices similar to ActiveSync
It is advisable to use it together with other components from the Horde Framework
%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} \
        -s

%build

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

%clean
rm -rf %{buildroot}

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

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

%files -f %{pear_name}.lang
%defattr(-,root,root)
%doc %{_docdir}/%{name}
%{peardir}/*
%{xmldir}/Horde_SyncMl.xml

%changelog
openSUSE Build Service is sponsored by