File messagelib.spec of Package messagelib

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

Name:           messagelib
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 library for e-mail message parsing and display
# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
License:        GPL-2.0 and GPL-3.0 and LGPL-2.1+
Group:          Development/Libraries
Url:            http://www.kde.org
Source0:        %{name}-%{version}.tar.xz
BuildRequires:  akonadi-contact-devel
BuildRequires:  akonadi-mime-devel
BuildRequires:  akonadi-search-devel
BuildRequires:  akonadi-server-devel
BuildRequires:  extra-cmake-modules
BuildRequires:  grantlee5-devel
BuildRequires:  grantleetheme-devel
BuildRequires:  karchive-devel
BuildRequires:  kcodecs-devel
BuildRequires:  kcompletion-devel
BuildRequires:  kconfig-devel
BuildRequires:  kcontacts-devel
BuildRequires:  kdepim-apps-libs-devel
BuildRequires:  kdewebkit-devel >= 5.0
BuildRequires:  kf5-filesystem
BuildRequires:  ki18n-devel
BuildRequires:  kiconthemes-devel
BuildRequires:  kidentitymanagement-devel
BuildRequires:  kimap-devel
BuildRequires:  kitemviews-devel
BuildRequires:  kldap-devel
BuildRequires:  kmailtransport-devel
BuildRequires:  kmbox-devel
BuildRequires:  kmime-devel
BuildRequires:  kpimtextedit-devel
BuildRequires:  kxmlgui-devel
BuildRequires:  libQt5Sql-private-headers-devel
BuildRequires:  libgpgme-devel
BuildRequires:  libgpgmepp-devel
BuildRequires:  libgravatar-devel
BuildRequires:  libkdepim-devel
BuildRequires:  libkleo-devel
BuildRequires:  libqgpgme-devel
BuildRequires:  pimcommon-devel
BuildRequires:  pkgconfig
BuildRequires:  syntax-highlighting-devel
BuildRequires:  pkgconfig(Qt5Concurrent) >= 5.4.0
BuildRequires:  pkgconfig(Qt5Network) >= 5.4.0
BuildRequires:  pkgconfig(Qt5Sql) >= 5.4.0
BuildRequires:  pkgconfig(Qt5Test) >= 5.4.0
BuildRequires:  pkgconfig(Qt5UiTools) >= 5.4.0
BuildRequires:  pkgconfig(Qt5WebEngine) >= 5.4.0
BuildRequires:  pkgconfig(Qt5WebEngineWidgets) >= 5.4.0
BuildRequires:  pkgconfig(Qt5Widgets) >= 5.4.0
%if 0%{?suse_version} > 1325
BuildRequires:  libboost_headers-devel
%else
BuildRequires:  boost-devel
%endif
# 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

%description
This package contains the messagelib library. It is used by KDE PIM to parse and
display emails.

%if %{with lang}
%lang_package
%endif

%prep
%setup -q

%build
%cmake_kf5 -d build -- -DMESSAGEVIEWER_USE_QTWEBENGINE=TRUE -DQTWEBENGINE_SUPPORT_OPTION=TRUE
%make_jobs

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

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

%package devel
Summary:        Library for messages
# FIXME: use correct group, see "https://en.opensuse.org/openSUSE:Package_group_guidelines"
License:        LGPL-2.1+
Group:          Development/Libraries
Requires:       %{name} = %{version}
Requires:       akonadi-mime-devel
Requires:       akonadi-server-devel
Requires:       kcontacts-devel
Requires:       kidentitymanagement-devel
Requires:       kmime-devel
Requires:       libkleo-devel
Requires:       messagelib-devel
Requires:       pimcommon-devel
%if 0%{?suse_version} > 1325
Requires:       libboost_headers-devel
%else
Requires:       boost-devel
%endif

%description devel
This package contains source headers for messagelib.

%files devel
%defattr(-,root,root)
%{_includedir}/KF5/
%{_libdir}/cmake/KF5MessageComposer/
%{_libdir}/cmake/KF5MessageCore/
%{_libdir}/cmake/KF5MessageList/
%{_libdir}/cmake/KF5MessageViewer/
%{_libdir}/cmake/KF5TemplateParser/
%{_libdir}/libKF5MessageComposer.so
%{_libdir}/libKF5MessageCore.so
%{_libdir}/libKF5MessageList.so
%{_libdir}/libKF5MessageViewer.so
%{_libdir}/libKF5TemplateParser.so
%{_libdir}/libKF5MimeTreeParser.so
%{_libdir}/libKF5WebEngineViewer.so
%{_libdir}/qt5/mkspecs/modules/qt_*.pri
%{_libdir}/cmake/KF5MimeTreeParser/
%{_libdir}/cmake/KF5WebEngineViewer/

%files
%defattr(-,root,root)
%config %{_kf5_configdir}/messagelib.categories
%config %{_kf5_configdir}/messageviewer_header_themes.knsrc
%config %{_kf5_configdir}/messagelib.renamecategories
%{_libdir}/libKF5MessageComposer.so.*
%{_libdir}/libKF5MessageCore.so.*
%{_libdir}/libKF5MessageList.so.*
%{_libdir}/libKF5MessageViewer.so.*
%{_libdir}/libKF5TemplateParser.so.*
%{_libdir}/libKF5MimeTreeParser.so.*
%{_libdir}/libKF5WebEngineViewer.so.*
%{_datadir}/config.kcfg/*.kcfg
%{_datadir}/kconf_update/
%{_kf5_notifydir}/messageviewer.notifyrc
%{_datadir}/libmessageviewer/
%{_datadir}/messagelist/
%{_datadir}/messageviewer/
%{_kf5_plugindir}/messageviewer/

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

%changelog