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 http://bugs.opensuse.org/
#


%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
Url:            http://www.kde.org
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

%description
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}
%lang_package
%endif

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

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

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

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

%files
%defattr(-,root,root)
%doc COPYING*
%dir %{_kf5_configkcfgdir}
%{_kf5_configkcfgdir}/mailtransport.kcfg
%{_kf5_plugindir}/kcm_mailtransport.so
%{_kf5_servicesdir}/kcm_mailtransport.desktop
%config %{_kf5_configdir}/kmailtransport.categories
%config %{_kf5_configdir}/kmailtransport.renamecategories
%{_kf5_plugindir}/kf5/kio/smtp.so
%{_kf5_htmldir}/en/kioslave5/
%{_kf5_servicesdir}/smtp*.protocol

%files -n libKF5MailTransport5
%defattr(-,root,root)
%doc COPYING*
%{_kf5_libdir}/libKF5MailTransport.so.5*

%files -n libKF5MailTransportAkonadi5
%defattr(-,root,root)
%doc COPYING*
%{_kf5_libdir}/libKF5MailTransportAkonadi.so.5*

%files devel
%defattr(-,root,root)
%doc COPYING*
%{_kf5_libdir}/cmake/KF5MailTransport/
%{_kf5_libdir}/libKF5MailTransport.so
%{_kf5_libdir}/libKF5MailTransportAkonadi.so
%{_kf5_includedir}/MailTransport/
%{_kf5_includedir}/MailTransportAkonadi/
%{_kf5_includedir}/mailtransport/
%{_kf5_includedir}/mailtransportakonadi/
%{_kf5_includedir}/mailtransport_version.h
%{_kf5_mkspecsdir}/qt_KMailTransport.pri
%{_includedir}/KF5/mailtransportakonadi_version.h
%{_libdir}/cmake/KF5MailTransportAkonadi/
%{_kf5_mkspecsdir}/qt_KMailTransportAkonadi.pri

%if %{with lang}
%files lang -f %{name}.lang
%doc COPYING*
%endif

%changelog