File mailcommon.spec of Package mailcommon

# spec file for package mailcommon
# Copyright (c) 2017 SUSE LINUX 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

%bcond_without lang

Name:           mailcommon
Version:        17.04.2
Release:        0
%define kf5_version 5.26.0
# Latest stable Applications (e.g. 16.08 in KA, but 16.11.80 in KUA)
%{!?_kapp_version: %global _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')}
Summary:        Base KDE PIM library for mail-handling applications
License:        GPL-2.0 and LGPL-2.1+
Group:          System/Libraries
Source0:        %{name}-%{version}.tar.xz
BuildRequires:  akonadi-contact-devel
BuildRequires:  akonadi-mime-devel
BuildRequires:  akonadi-server-devel
BuildRequires:  extra-cmake-modules
BuildRequires:  karchive-devel
BuildRequires:  kcalcore-devel
BuildRequires:  kcodecs-devel
BuildRequires:  kconfig-devel
BuildRequires:  kf5-filesystem
BuildRequires:  ki18n-devel
BuildRequires:  kiconthemes-devel
BuildRequires:  kidentitymanagement-devel
BuildRequires:  kimap-devel
BuildRequires:  kitemviews-devel
BuildRequires:  kldap-devel
BuildRequires:  kmailtransport-devel >= %{_kapp_version}
BuildRequires:  kmime-devel
BuildRequires:  kwindowsystem-devel
BuildRequires:  kxmlgui-devel
BuildRequires:  libkdepim-devel
BuildRequires:  libkleo-devel
BuildRequires:  mailimporter-devel >= %{_kapp_version}
BuildRequires:  messagelib-devel >= %{_kapp_version}
BuildRequires:  phonon4qt5-devel
BuildRequires:  pimcommon-devel
BuildRequires:  pkgconfig
BuildRequires:  xsltproc
BuildRequires:  pkgconfig(Qt5Test) >= 5.4.0
BuildRequires:  pkgconfig(Qt5UiTools) >= 5.4.0
BuildRequires:  pkgconfig(Qt5Widgets) >= 5.4.0
# It can only build on the same platforms as Qt Webengine
ExclusiveArch:  %ix86 x86_64 %arm aarch64 mips mips64
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

The mailcommon library is a KDE PIM project to provide a
framework to build applications which handle e-mail.

%if %{with lang}

%setup -q

%cmake_kf5 -d build


%kf5_makeinstall -C build
%if %{with lang}
  %find_lang %{name} --with-man --all-name

%package -n libKF5MailCommon5
Summary:        Common Mail library for kdepim
License:        LGPL-2.1+
Group:          System/Libraries
Requires:       %{name}

%description -n libKF5MailCommon5
This package provides the mailcommon library, a base KDE PIM library
to build email-handling applications.

%post -n libKF5MailCommon5 -p /sbin/ldconfig
%postun -n libKF5MailCommon5 -p /sbin/ldconfig

%package devel
Summary:        Development package for mailcommon
License:        LGPL-2.1+
Group:          Development/Libraries/KDE
Requires:       akonadi-mime-devel
Requires:       akonadi-server-devel
Requires:       libKF5MailCommon5 = %{version}
Requires:       messagelib-devel
Requires:       pimcommon-devel

%description devel
This package contains the development headers for the mailcommon library.

%config %{_kf5_configdir}/mailcommon.categories
%config %{_kf5_configdir}/mailcommon.renamecategories

%files devel
%dir %{_kf5_plugindir}/designer

%files -n libKF5MailCommon5

%if %{with lang}
%files lang -f %{name}.lang