File libkolabxml.spec of Package libkolabxml

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


Name:           libkolabxml
Version:        0.8.1
Release:        0
%define soname  0
Summary:        Kolab XML Format Schema Definitions Library
License:        LGPL-3.0+
Group:          Development/Libraries/C and C++
Url:            http://wiki.kolab.org/Libkolabxml
Source:         http://mirror.kolabsys.com/pub/releases/%{name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE fix_php5_bindings.diff
Patch0:         fix_php5_bindings.diff
BuildRequires:  boost-devel
BuildRequires:  cmake >= 2.6
BuildRequires:  gcc-c++
BuildRequires:  gcc-java
BuildRequires:  java-openjdk
BuildRequires:  libcurl-devel
BuildRequires:  libqt4-devel
BuildRequires:  libxerces-c-devel
BuildRequires:  mono-devel
# ToDo: Fix SLE_11_SP2 CSHARP and PHP bindings
#%%if 0%{?sles_version} == 0
BuildRequires:  php5-devel
#%%else
#BuildRequires:  php53-devel
#%%endif
BuildRequires:  pkgconfig
BuildRequires:  python-devel
BuildRequires:  swig
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
%patch0 -p0

%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} \
%if 0%{?sles_version} == 0
        -DCSHARP_BINDINGS=TRUE -DCSHARP_INSTALL_DIR=%{_prefix}/lib/mono/ \
        -DPHP_BINDINGS=TRUE \
%endif
        -DPYTHON_BINDINGS=TRUE -DPYTHON_INSTALL_DIR=%{python_sitearch} \
        ..

  make %{?_smp_mflags}

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

%if 0%{?sles_version} == 0
  %define php_extension_dir %( %{_bindir}/php-config --extension-dir | sed -e 's#\\n##' )
  %define php_inidir /etc/php5/conf.d

  mkdir -p %{buildroot}/%{_datadir}/php5
  mv %{buildroot}/%{php_extension_dir}/kolabformat.php %{buildroot}/%{_datadir}/php5/kolabformat.php

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

%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

%if 0%{?sles_version} == 0
%files -n php-%{name}%{soname}
%defattr(-,root,root)
%doc COPYING
%config(noreplace) %{php_inidir}/kolabformat.ini
%{_datadir}/php5/kolabformat.php
%{php_extension_dir}/kolabformat.so
%endif

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

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

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

%changelog
openSUSE Build Service is sponsored by