File openchange.spec of Package openchange
#
# spec file for package openchange
#
# 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/
#
%define nickname QUADRANT
%global samba_version 4.0.1
Name: openchange
Version: 2.1
Release: 0
Url: http://www.openchange.org/
Summary: Provides access to Microsoft Exchange servers using native protocols
License: GPL-3.0+
Group: Productivity/Networking/Email/Clients
Source: http://tracker.openchange.org/attachments/download/244/openchange-%{version}-%{nickname}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: doxygen
BuildRequires: fdupes
BuildRequires: file-devel
BuildRequires: gcc-c++
BuildRequires: libdcerpc-devel >= %{samba_version}
BuildRequires: libdcerpc-samr-devel >= %{samba_version}
BuildRequires: libical-devel
BuildRequires: libldb-devel
BuildRequires: libndr-krb5pac-devel
#BuildRequires: libqt4-devel
BuildRequires: libsamba-hostconfig-devel >= %{samba_version}
BuildRequires: libsamba-util-devel >= %{samba_version}
BuildRequires: libsamba-credentials-devel >= %{samba_version}
BuildRequires: libtalloc-devel
BuildRequires: libtdb-devel
BuildRequires: libtevent-devel
BuildRequires: libtevent-util-devel
BuildRequires: perl-Parse-Yapp
BuildRequires: pkgconfig
BuildRequires: popt-devel
BuildRequires: python-devel
BuildRequires: samba-core-devel >= %{samba_version}
BuildRequires: samba-libs >= %{samba_version}
BuildRequires: samba-pidl >= %{samba_version}
BuildRequires: zlib-devel
%description
OpenChange provides libraries to access Microsoft Exchange servers
using native protocols.
%package -n nagios-plugins-openchange
Summary: Developer tools for OpenChange libraries - Nagios checks
Group: Development/Libraries/C and C++
Requires: nagios
Requires: %{name} = %{version}
%description -n nagios-plugins-openchange
OpenChange provides libraries to access Microsoft Exchange servers
using native protocols.
%package -n libmapi0
Summary: Developer tools for OpenChange libraries
Group: Development/Libraries/C and C++
%description -n libmapi0
OpenChange provides libraries to access Microsoft Exchange servers
using native protocols.
%package -n libmapiadmin0
Summary: Developer tools for OpenChange libraries
Group: Development/Libraries/C and C++
%description -n libmapiadmin0
OpenChange provides libraries to access Microsoft Exchange servers
using native protocols.
%package -n libmapipp0
Summary: Developer tools for OpenChange libraries
Group: Development/Libraries/C and C++
%description -n libmapipp0
OpenChange provides libraries to access Microsoft Exchange servers
using native protocols.
%package -n libmapistore0
Summary: Developer tools for OpenChange libraries
Group: Development/Libraries/C and C++
%description -n libmapistore0
OpenChange provides libraries to access Microsoft Exchange servers
using native protocols.
%package -n libocpf0
Summary: Developer tools for OpenChange libraries
Group: Development/Libraries/C and C++
%description -n libocpf0
OpenChange provides libraries to access Microsoft Exchange servers
using native protocols.
%package devel
Summary: Developer tools for OpenChange libraries
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}
Requires: libmapi0 = %{version}
Requires: libmapiadmin0 = %{version}
Requires: libmapipp0 = %{version}
Requires: libocpf0 = %{version}
# Zarafa has libmapi.so
Conflicts: zarafa-devel
%description devel
This package provides the development tools and headers for
OpenChange, providing libraries to access Microsoft Exchange servers
using native protocols.
%prep
%setup -q -n %{name}-%{version}-%{nickname}
#NOTE(saschpe): openchange wants samba-4.1.7, which we happen to ship (on Factory),
# but our version string includes some vendor junk...
SAMBA_VER=$(grep -E "^SAMBA_VERSION_STRING=" /usr/include/samba-4.0/samba/version.h | cut -d"=" -f2)
sed -i "s/SAMBA4_RELEASE=4.1.7/SAMBA4_RELEASE=${SAMBA_VER}/" script/samba4_ver.sh
%build
%configure \
--with-modulesdir=%{_libdir}/samba \
--disable-dependency-tracking
#--enable-openchange-qt4
#--enable-pyopenchange
make
%install
make install DESTDIR=%{buildroot}
# Install man-pages
make installman DESTDIR=%{buildroot}
# Install libmapistore (that would otherwise come with 'mapiproxy',
# which we can't build due to broken samba)
sed -i "/setup\/mapistore\/\*\.ldif/d" Makefile
make libmapistore-install DESTDIR=%{buildroot}
# Conflicts with graphviz-devel:
rm %{buildroot}%{_mandir}/man3/pack.3*
#NOTE(saschpe): Remove unwanted files
rm -r %{buildroot}%{_datadir}/setup/*
#NOTE(saschpe): Nagios checks belong into /usr/lib
%ifarch x86_64
mkdir -p %{buildroot}%{_prefix}/lib
mv %{buildroot}%{_libdir}/nagios/ %{buildroot}%{_prefix}/lib
%endif
# make omitted producing all required symlinks :(
/sbin/ldconfig -N %buildroot/%_libdir
%fdupes %buildroot/%_prefix
%post -n libmapi0 -p /sbin/ldconfig
%postun -n libmapi0 -p /sbin/ldconfig
%post -n libmapiadmin0 -p /sbin/ldconfig
%postun -n libmapiadmin0 -p /sbin/ldconfig
%post -n libmapipp0 -p /sbin/ldconfig
%postun -n libmapipp0 -p /sbin/ldconfig
%post -n libmapistore0 -p /sbin/ldconfig
%postun -n libmapistore0 -p /sbin/ldconfig
%post -n libocpf0 -p /sbin/ldconfig
%postun -n libocpf0 -p /sbin/ldconfig
%files
%defattr(-, root, root)
%doc COPYING IDL_LICENSE.txt
%{_bindir}/check_fasttransfer
%{_bindir}/exchange2ical
%{_bindir}/exchange2mbox
%{_bindir}/mapiprofile
%{_bindir}/mapitest
%{_bindir}/openchangeclient
%{_bindir}/openchangemapidump
%{_bindir}/openchangepfadmin
%{_bindir}/schemaIDGUID
%{_bindir}/test_asyncnotif
%{_datadir}/mapitest
%{_mandir}/man1/mapiprofile.1*
%{_mandir}/man1/openchangepfadmin.1*
%{_mandir}/man1/exchange2mbox.1*
#{_mandir}/man1/mapitest.1*
#{_mandir}/man1/exchange2ical.1*
%{_mandir}/man1/openchangeclient.1*
%files -n nagios-plugins-openchange
%defattr(-, root, root)
%dir %{_prefix}/lib/nagios
%{_prefix}/lib/nagios/check_exchange
%files -n libmapi0
%defattr(-, root, root)
%doc COPYING IDL_LICENSE.txt
%{_libdir}/libmapi.so.*
%files -n libmapiadmin0
%defattr(-, root, root)
%doc COPYING IDL_LICENSE.txt
%{_libdir}/libmapiadmin.so.*
%files -n libmapipp0
%defattr(-, root, root)
%doc COPYING IDL_LICENSE.txt
%{_libdir}/libmapipp.so.*
%files -n libmapistore0
%defattr(-, root, root)
%doc COPYING IDL_LICENSE.txt
%{_libdir}/libmapistore.so.*
%files -n libocpf0
%defattr(-, root, root)
%doc COPYING IDL_LICENSE.txt
%{_libdir}/libocpf.so.*
%files devel
%defattr(-,root,root)
%doc apidocs/html
%{_includedir}/gen_ndr
%{_includedir}/libmapi
%{_includedir}/libmapiadmin
%{_includedir}/libmapi++
%{_includedir}/libocpf
%{_includedir}/mapistore
%{_libdir}/pkgconfig/libmapi.pc
%{_libdir}/pkgconfig/libmapiadmin.pc
%{_libdir}/pkgconfig/libmapi++.pc
%{_libdir}/pkgconfig/libocpf.pc
%{_libdir}/pkgconfig/libmapiserver.pc
%{_libdir}/libmapi.so
%{_libdir}/libmapiadmin.so
%{_libdir}/libmapipp.so
%{_libdir}/libmapistore.so
%{_libdir}/libocpf.so
%{_mandir}/man3/*
%changelog