File kmarkdownwebview.spec of Package kmarkdownwebview

#
# spec file for package kmarkdownwebview
#
# Copyright (c) 2018 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:           kmarkdownwebview
Version:        0.5.2
Release:        0
%define kf5_version 5.25.0
Summary:        KPart for rendering Markdown content
License:        LGPL-2.1+
Group:          System/Libraries
Url:            http://www.kde.org
Source0:        https://download.kde.org/stable/%{name}/%{version}/src/%{name}-%{version}.tar.xz
BuildRequires:  extra-cmake-modules >= %{kf5_version}
BuildRequires:  ki18n-devel >= %{kf5_version}
BuildRequires:  kio-devel >= %{kf5_version}
BuildRequires:  kparts-devel >= %{kf5_version}
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Widgets) >= 5.6.0
%if 0%{?suse_version} >= 1330
BuildRequires:  pkgconfig(Qt5WebEngineWidgets) >= 5.7.0
%else
BuildRequires:  pkgconfig(Qt5WebKitWidgets) >= 5.6.0
%endif
%if %{with lang}
Recommends:     %{name}-lang
%endif
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This package allows KDE applications which use it to obtain a live preview of HTML-rendered Markdown content.

%if %{with lang}
%lang_package
%endif

%prep
%setup -q

%build
%if 0%{?suse_version} < 1330
  %cmake_kf5 -d build -- -DUSE_WEBKIT=TRUE
%else
  %cmake_kf5 -d build
%endif
  %make_jobs

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

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

%files
%defattr(-,root,root)
%license COPYING*
%{_kf5_libdir}/libKMarkdownWebView.so
%{_kf5_plugindir}/kmarkdownwebviewpart.so
%if 0%{?suse_version} < 1330
%{_kf5_plugindir}/kmarkdownwebviewthumbnail.so
%{_kf5_servicesdir}/kmarkdownwebviewthumbnail.desktop
%endif
%{_kf5_servicesdir}/kmarkdownwebviewpart.desktop
%{_kf5_appstreamdir}/org.kde.kmarkdownwebviewpart.metainfo.xml

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

%changelog
openSUSE Build Service is sponsored by