File evolution-exchange.spec of Package evolution-exchange

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


%define USE_EVOLDAP 0

Name:           evolution-exchange
# This should be updated upon major version changes; it should match BASE_VERSION as defined in configure.in of evolution.
%define evolution_base_version 3.4
BuildRequires:  db-devel
%if %USE_EVOLDAP
BuildRequires:  evoldap2-devel
%else
BuildRequires:  openldap2-devel
%endif
BuildRequires:  evolution-devel >= 3.3.5
BuildRequires:  fdupes
BuildRequires:  intltool
BuildRequires:  krb5-devel
BuildRequires:  lzo-devel
BuildRequires:  mozilla-nss-devel
BuildRequires:  nss-shared-helper-devel
BuildRequires:  translation-update-upstream
BuildRequires:  pkgconfig(libical) >= 0.43
Version:        3.4.4
Release:        0
Summary:        Evolution Connector for Microsoft Exchange Server 2000/2003
License:        GPL-2.0+
Group:          Productivity/Networking/Email/Utilities
Source:         http://download.gnome.org/sources/evolution-exchange/3.4/%{name}-%{version}.tar.xz
Url:            http://www.novell.com/products/connector
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
DocDir:         %{_defaultdocdir}/evolution-exchange
Recommends:     %{name}-lang
Provides:       ximian-connector
Obsoletes:      %{name}-doc <= %{version}
Obsoletes:      ximian-connector
%gconf_schemas_prereq

%description
With the Connector for Microsoft Exchange installed, Evolution
functions as an Exchange client, enabling users to become full
participants in companywide group scheduling and other collaborative
tasks. Linux and Solaris users can access public folders, Global
Address Lists, e-mail, calendar, task lists, and group scheduling
information.

%lang_package
%prep
%setup -q
translation-update-upstream

%build
%{configure} \
%if %USE_EVOLDAP
        --with-openldap=%{_libdir}/evoldap \
%else
        --with-openldap=yes \
%endif
        --with-krb5=%{_prefix} \
        --disable-static
make %{?_smp_mflags} V=1

%install
%{makeinstall}
find %{buildroot} -name '*.la' -type f -delete -print
%find_lang evolution-exchange-%evolution_base_version %{?no_lang_C}
%find_gconf_schemas
# Since there's no devel subpackage, there's no point in shipping
# gtk-doc documentation.
rm -r %{buildroot}%{_datadir}/gtk-doc/html/%{name}
%if %USE_EVOLDAP
  %{__mv} %{buildroot}%{_bindir}/exchange-connector-setup-%{evolution_base_version} %{buildroot}%{_bindir}/exchange-connector-setup-%{evolution_base_version}.bin
  echo -e "#!/bin/bash\n\nLD_LIBRARY_PATH=%{_libdir}/evoldap/lib exec -a \"%{_bindir}/exchange-connector-setup-%{evolution_base_version}\" %{_bindir}/exchange-connector-setup-%{evolution_base_version}.bin \"\$@\"" > %{buildroot}%{_bindir}/exchange-connector-setup-%{evolution_base_version}
  %{__chmod} +x %{buildroot}%{_bindir}/exchange-connector-setup-%{evolution_base_version}
%endif
%fdupes %{buildroot}

%pre -f %{name}.schemas_pre

%posttrans -f %{name}.schemas_posttrans

%preun -f %{name}.schemas_preun

%files -f evolution-exchange.schemas_list
%defattr(-, root, root)
%{_bindir}/exchange-connector-setup-%{evolution_base_version}
%{_datadir}/evolution-exchange
%{_datadir}/evolution/*/errors/*
%{_libdir}/evolution-data-server/camel-providers/*
%{_libdir}/evolution-data-server/addressbook-backends/*
%{_libdir}/evolution-data-server/calendar-backends/*
%{_libdir}/evolution-exchange/
%{_libdir}/evolution/*/plugins/*

%files lang -f evolution-exchange-%{evolution_base_version}.lang

%changelog