File libopensync.spec of Package libopensync

#
# spec file for package libopensync (Version 0.39_SVN6166)
#
# Copyright (c) 2010 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/
#

# norootforbuild

# set libname
%define libname libopensync1
# enable(1) / disable(0) python wrapper
%if 0%{?suse_version} > 1130
%define python_wrapper 0
%else
%define python_wrapper 1
%endif
# debug opensync modules
%define debug_modules 0

Name:           libopensync
BuildRequires:  cmake glib2-devel libxslt-devel python-devel sqlite3-devel
%if %{python_wrapper}
BuildRequires:  swig
%endif
Url:            http://www.opensync.org
Version:        0.39_SVN6166
Release:        1
Summary:        A Platform and Distribution Independent Synchronization Framework
License:        LGPL v2.1 or later
Group:          Productivity/Other
AutoReqProv:    on
Source:         %{name}-%{version}.tar.bz2
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%define prefix   /usr

%description
OpenSync is a synchronization framework that is platform and
distribution independent. It consists of several plug-ins that can be
used to connect to devices, a powerful sync engine, and the framework
itself. The synchronization framework is kept very flexible and is
capable of synchronizing any type of data, including contacts,
calendar, tasks, notes, and files.

To sync various sources, additionally install the plug-ins.



Authors:
--------
    Armin Bauer <armin.bauer@desscon.com>
    Daniel Gollub <gollub@b1-systems.de>

%package -n libopensync1
License:        LGPL v2.1 or later
Summary:        A Platform and Distribution Independent Synchronization Framework
Group:          Productivity/Other
# package was called libopensync in openSUSE <= 11.3
Provides:       libopensync = %{version}
Obsoletes:      libopensync < %{version}

%description -n libopensync1
OpenSync is a synchronization framework that is platform and
distribution independent. It consists of several plug-ins that can be
used to connect to devices, a powerful sync engine, and the framework
itself. The synchronization framework is kept very flexible and is
capable of synchronizing any type of data, including contacts,
calendar, tasks, notes, and files.

To sync various sources, additionally install the plug-ins.



Authors:
--------
    Armin Bauer <armin.bauer@desscon.com>
    Daniel Gollub <gollub@b1-systems.de>

%package -n libopensync-devel
License:        LGPL v2.1 or later
Summary:        Header files, libraries and development documentation for libopensync
Group:          Development/Libraries/C and C++
Requires:       %{libname} = %{version} libxml2-devel libxslt-devel glib2-devel sqlite3-devel python-devel

%description -n libopensync-devel
This package contains the header files, static libraries and
development documentation for libopensync. If you like to develop
programs using libopensync, you will need to install this package.



Authors:
--------
    Armin Bauer <armin.bauer@desscon.com>
    Daniel Gollub <gollub@b1-systems.de>

%package -n opensync-ipc
License:        LGPL v2.1 or later
Summary:        OpenSync IPC Plugin
Group:          Productivity/Other
Requires:       %{libname} = %{version}

%description -n opensync-ipc
OpenSync IPC Plugin.



Authors:
--------
    Armin Bauer <armin.bauer@desscon.com>
    Daniel Gollub <gollub@b1-systems.de>

%package -n opensync-tools
License:        LGPL v2.1 or later
Summary:        Tools for libopensync
Group:          Productivity/Other
Requires:       %{libname} = %{version}
# packages was called libopensync-tools in openSUSE <= 11.3
Provides:       libopensync-tools = %{version}
Obsoletes:      libopensync-tools < %{version}

%description -n opensync-tools
OpenSync is a synchronization framework that is platform and
distribution independent. This package contains some tools needed for
testing and debugging it.



Authors:
--------
    Armin Bauer <armin.bauer@desscon.com>
    Daniel Gollub <gollub@b1-systems.de>

%if %{python_wrapper}
%package -n python-opensync
License:        LGPL v2.1 or later
Summary:        Python bindings for OpenSync
Group:          Productivity/Other
Requires:       %{libname} = %{version}
%py_requires

%description -n python-opensync
OpenSync is a synchronization framework that is platform and
distribution independent. It consists of several plug-ins that can be
used to connect to devices, a powerful sync engine, and the framework
itself. The synchronization framework is kept very flexible and is
capable of synchronizing any type of data, including contacts,
calendar, tasks, notes, and files.

To sync various sources, additionally install the plug-ins.



Authors:
--------
    Armin Bauer <armin.bauer@desscon.com>
    Daniel Gollub <gollub@b1-systems.de>
%endif

%prep
%setup -q

%build
%__mkdir build
pushd build
CFLAGS="%{optflags}" \
CXXFLAGS="%{optflags}" \
cmake \
        -DCMAKE_BUILD_TYPE=None \
        -DCMAKE_INSTALL_PREFIX=%{_prefix} \
        -DOPENSYNC_LIBEXEC_DIR=%{_libexecdir}/%{libname} \
%if %{_lib} == lib64
        -DLIB_SUFFIX=64 \
%endif
        -DMAN_INSTALL_DIR=%{_mandir} \
%if %{debug_modules}
	-DOPENSYNC_DEBUG_MODULES:BOOL=ON \
%endif	
         %{_builddir}/%{name}-%{version}
%__make %{?jobs:-j%jobs} VERBOSE=1
popd

%install
pushd build
%makeinstall
popd
%__install -d -m 0755 %{buildroot}%{_libdir}/%{libname}/formats
%__install -d -m 0755 %{buildroot}%{_libdir}/%{libname}/plugins
%__install -d -m 0755 %{buildroot}%{_datadir}/%{libname}/defaults

%clean
%__rm -rf %{buildroot}

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%files -n %{libname}
%defattr(-, root, root)
%doc AUTHORS COPYING README
%{_libdir}/libopensync.so.*
%dir %{_libdir}/%{libname}
%dir %{_libdir}/%{libname}/formats
%dir %{_libdir}/%{libname}/plugins
%dir %{_datadir}/%{libname}
%dir %{_datadir}/%{libname}/capabilities
%dir %{_datadir}/%{libname}/defaults
%dir %{_datadir}/%{libname}/descriptions
%dir %{_datadir}/%{libname}/schemas
%{_datadir}/%{libname}/capabilities/*
%{_datadir}/%{libname}/descriptions/*
%{_datadir}/%{libname}/schemas/*
%dir %{_datadir}/%{libname}/cmake
%dir %{_datadir}/%{libname}/cmake/modules
%{_datadir}/%{libname}/cmake/modules/*

%if %{python_wrapper}
%files -n python-opensync
%defattr(-, root, root)
%{py_sitedir}/_opensync.so*
%{py_sitedir}/opensync.py*
%endif

%files -n libopensync-devel
%defattr(-,root,root)
%{_libdir}/libopensync.so
%dir %{_includedir}/%{libname}
%dir %{_includedir}/%{libname}/opensync
%{_includedir}/%{libname}/opensync/*
%{_libdir}/pkgconfig/libopensync1.pc

%files -n opensync-ipc
%defattr(-,root,root)
%dir %{_libexecdir}/%{libname}
%{_libexecdir}/%{libname}/osplugin

%files -n opensync-tools
%defattr(-,root,root)
%{_bindir}/osyncdump
%{_bindir}/osyncbinary
%{_bindir}/osyncplugin

%changelog

openSUSE Build Service is sponsored by