File kmailtransport.spec of Package kmailtransport

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

%define kf5_version 5.19.0
Name:           kmailtransport
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:        KDE PIM Libraries: Mailtransport layer
License:        LGPL-2.1+
Group:          System/GUI/KDE
Source:         kmailtransport-%{version}.tar.xz
BuildRequires:  akonadi-mime-devel
BuildRequires:  akonadi-server-devel
BuildRequires:  cyrus-sasl-devel
BuildRequires:  extra-cmake-modules >= 5.19.0
BuildRequires:  kcmutils-devel >= %{kf5_version}
BuildRequires:  kconfigwidgets-devel >= %{kf5_version}
BuildRequires:  kf5-filesystem
BuildRequires:  kmime-devel
BuildRequires:  kwallet-devel >= %{kf5_version}
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Test)
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

This package contains library to provide mailtransport functionality for KDE PIM applications.

%package -n libKF5MailTransport5
Summary:        Mail Transport library for KDEPIM
Group:          System/Libraries
Requires:       %{name} >= %{version}

%description -n libKF5MailTransport5
The Mail Transport library for KDEPIM functionality

%package -n libKF5MailTransportAkonadi5
Summary:        libkdepim Akonadi library
Group:          System/Libraries
Requires:       %{name} >= %{version}

%description -n libKF5MailTransportAkonadi5
The Mail Transport library for Akonadi related functions

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

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

%package devel
Summary:        KDE PIM Libraries: Build Environment
Group:          Development/Libraries/KDE
Requires:       akonadi-mime-devel
Requires:       cyrus-sasl-devel
Requires:       kmime-devel
Requires:       kwallet-devel >= %{kf5_version}
Requires:       libKF5MailTransport5 = %{version}
Requires:       libKF5MailTransportAkonadi5 = %{version}

%description devel
This package contains necessary include files and libraries needed
to develop KDE PIM applications.

%if %{with lang}

%setup -q -n kmailtransport-%{version}

  %cmake_kf5 -d build -- -DBUILD_TESTING=ON -DKF5_INCLUDE_INSTALL_DIR=%{_kf5_includedir}

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

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

%dir %{_kf5_configkcfgdir}
%config %{_kf5_configdir}/kmailtransport.categories
%config %{_kf5_configdir}/kmailtransport.renamecategories

%files -n libKF5MailTransport5

%files -n libKF5MailTransportAkonadi5

%files devel

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