File libkolabxml.spec of Package libkolabxml

#
# spec file for package libkolabxml
#
# Copyright (c) 2013 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/
#


%global phpdir php5
%global php_extdir %{_libdir}/%{phpdir}/extensions
%global php_inidir %{_sysconfdir}/%{phpdir}/conf.d

%bcond_without mono

Name:           libkolabxml
Version:        0.8.4
Release:        0
%define soname  0
Summary:        Kolab XML Format Schema Definitions Library
License:        LGPL-3.0+
Group:          Development/Libraries/C and C++
Url:            https://kolab.org/about/libkolabxml
Source:         http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz
# Fix uuid.h path on SLE* 11
Patch0:         fix_uuid_includes_SLE.diff
BuildRequires:  boost-devel
BuildRequires:  cmake >= 2.6
BuildRequires:  gcc-c++
BuildRequires:  gcc-java
BuildRequires:  java-openjdk
BuildRequires:  libcurl-devel
BuildRequires:  libqt4-devel
%if 0%{?sles_version} == 11
BuildRequires:  uuid-devel = 1.6.2
%endif
BuildRequires:  libXerces-c-devel
%if %{with mono}
BuildRequires:  mono-devel
%endif
BuildRequires:  php-devel >= 5.3
BuildRequires:  pkgconfig
BuildRequires:  python-devel
BuildRequires:  swig >= 2.0
BuildRequires:  xsd
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Libkolabxml serves as a serialization/de-serialization library for the the Kolab XML Format

Features:
- Based on official standards:
- Todos/Events/Journals are fully xCal compliant
- Contacts/Distributionlists are fully xCard compliant
- Can model everything which is used in the Kolab XML Format 2.0, Kontact and Roundcube.
- Easily extensible
- Canonical storage format
- Supports Todos/Events/Journals/Contacts/Distribution Lists/Notes/Configurations

%package -n %{name}%{soname}
Summary:        Kolab XML Format Schema Definitions Library
Group:          Development/Libraries/C and C++

%description -n %{name}%{soname}
Libkolabxml serves as a serialization/de-serialization library for the the Kolab XML Format

Features:
- Based on official standards:
- Todos/Events/Journals are fully xCal compliant
- Contacts/Distributionlists are fully xCard compliant
- Can model everything which is used in the Kolab XML Format 2.0, Kontact and Roundcube.
- Easily extensible
- Canonical storage format
- Supports Todos/Events/Journals/Contacts/Distribution Lists/Notes/Configurations

%package devel
Summary:        Kolab XML Format Schema Definitions Library
Group:          Development/Libraries/C and C++
Requires:       %{name}%{soname} = %{version}
Requires:       libcurl-devel

%description devel
Libkolabxml serves as a serialization/de-serialization library for the the Kolab XML Format

Features:
- Based on official standards:
- Todos/Events/Journals are fully xCal compliant
- Contacts/Distributionlists are fully xCard compliant
- Can model everything which is used in the Kolab XML Format 2.0, Kontact and Roundcube.
- Easily extensible
- Canonical storage format
- Supports Todos/Events/Journals/Contacts/Distribution Lists/Notes/Configurations

%package -n java-%{name}%{soname}
Summary:        Java bindings for %{name}
Group:          Development/Languages/Java
Provides:       java-kolabformat = %{version}

%description -n java-%{name}%{soname}
Libkolabxml serves as a serialization/de-serialization library for the the Kolab XML Format

Features:
- Based on official standards:
- Todos/Events/Journals are fully xCal compliant
- Contacts/Distributionlists are fully xCard compliant
- Can model everything which is used in the Kolab XML Format 2.0, Kontact and Roundcube.
- Easily extensible
- Canonical storage format
- Supports Todos/Events/Journals/Contacts/Distribution Lists/Notes/Configurations

This package provides the java bindings for Libkolabxml

%package -n mono-%{name}%{soname}
Summary:        Mono (C#) bindings for %{name}
Group:          Development/Languages/Mono
Provides:       csharp-kolabformat = %{version}

%description -n mono-%{name}%{soname}
Libkolabxml serves as a serialization/de-serialization library for the the Kolab XML Format

Features:
- Based on official standards:
- Todos/Events/Journals are fully xCal compliant
- Contacts/Distributionlists are fully xCard compliant
- Can model everything which is used in the Kolab XML Format 2.0, Kontact and Roundcube.
- Easily extensible
- Canonical storage format
- Supports Todos/Events/Journals/Contacts/Distribution Lists/Notes/Configurations

This package provides the mono (C#) bindings for Libkolabxml

%package -n php-%{name}%{soname}
Summary:        PHP bindings for %{name}
Group:          Development/Languages/Other
Provides:       php-kolabformat = %{version}

%description -n php-%{name}%{soname}
Libkolabxml serves as a serialization/de-serialization library for the the Kolab XML Format

Features:
- Based on official standards:
- Todos/Events/Journals are fully xCal compliant
- Contacts/Distributionlists are fully xCard compliant
- Can model everything which is used in the Kolab XML Format 2.0, Kontact and Roundcube.
- Easily extensible
- Canonical storage format
- Supports Todos/Events/Journals/Contacts/Distribution Lists/Notes/Configurations

This package provides the php bindings for Libkolabxml

%package -n python-%{name}%{soname}
Summary:        Python bindings for %{name}
Group:          Development/Languages/Python
Provides:       python-kolabformat = %{version}

%description -n python-%{name}%{soname}
Libkolabxml serves as a serialization/de-serialization library for the the Kolab XML Format

Features:
- Based on official standards:
- Todos/Events/Journals are fully xCal compliant
- Contacts/Distributionlists are fully xCard compliant
- Can model everything which is used in the Kolab XML Format 2.0, Kontact and Roundcube.
- Easily extensible
- Canonical storage format
- Supports Todos/Events/Journals/Contacts/Distribution Lists/Notes/Configurations

This package provides the python bindings for Libkolabxml

%prep
%setup -q
%if 0%{?sles_version} == 11
%patch0 -p0
%endif

%build
  export CXXFLAGS="%{optflags}"
  export CFLAGS="%{optflags}"

  mkdir build
  cd build

  cmake -DCMAKE_INSTALL_PREFIX="%{_prefix}" \
        -DLIB_INSTALL_DIR=%{_lib} \
        -DCMAKE_SKIP_RPATH=TRUE  \
        -DJAVA_BINDINGS=TRUE -DJAVA_INSTALL_DIR=%{_jnidir} \
        -DCSHARP_BINDINGS=TRUE -DCSHARP_INSTALL_DIR=%{_prefix}/lib/mono/ \
        -DPHP_BINDINGS=TRUE -DPHP_INSTALL_DIR=%{php_extdir}\
        -DPYTHON_BINDINGS=TRUE -DPYTHON_INSTALL_DIR=%{python_sitearch} \
        ..

  make %{?_smp_mflags}

%install
  cd build
  make DESTDIR=%{buildroot} install

  mkdir -p %{buildroot}/%{_datadir}/%{phpdir}
  mv %{buildroot}/%{php_extdir}/kolabformat.php %{buildroot}/%{_datadir}/%{phpdir}/kolabformat.php

  mkdir -p %{buildroot}/%{php_inidir}/
  cat >%{buildroot}/%{php_inidir}/kolabformat.ini <<EOF
extension=kolabformat.so
EOF

%post   -n %{name}%{soname} -p /sbin/ldconfig

%postun -n %{name}%{soname} -p /sbin/ldconfig

%files -n %{name}%{soname}
%defattr(-,root,root)
%doc AUTHORS COPYING NEWS README
%{_libdir}/libkolabxml.so.*

%files -n python-%{name}%{soname}
%defattr(-,root,root)
%doc COPYING
%{python_sitearch}/_kolabformat.so
%{python_sitearch}/kolabformat.py*

%files -n php-%{name}%{soname}
%defattr(-,root,root)
%doc COPYING
%config(noreplace) %{php_inidir}/kolabformat.ini
%{_datadir}/%{phpdir}/kolabformat.php
%{php_extdir}/kolabformat.so

%files -n java-%{name}%{soname}
%defattr(-,root,root)
%doc COPYING
%dir %{_libdir}/java/
%{_libdir}/java/*

%if %{with mono}
%files -n mono-%{name}%{soname}
%defattr(-,root,root)
%doc COPYING
%{_prefix}/lib/mono/*
%endif

%files devel
%defattr(-,root,root)
%doc DEVELOPMENT
%dir %{_libdir}/cmake/
%{_libdir}/cmake/Libkolabxml/
%{_libdir}/libkolabxml.so
%{_includedir}/kolabxml/

%changelog
openSUSE Build Service is sponsored by