File okular.spec of Package okular

#
# spec file for package okular
#
# 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:           okular
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:        Document Viewer
License:        GPL-2.0-or-later
Group:          Productivity/Office/Other
Url:            http://www.kde.org
Source:         %{name}-%{version}.tar.xz
# PATCH-FIX-UPSTREAM
Patch0:         fix-width-and-height-being-switched-when-printing-custom-size.patch
# PATCH-FIX-UPSTREAM
Patch1:         simplify-drawing-of-buffered-highlight-rectangles.patch
# PATCH-FIX-UPSTREAM
Patch2:         HiDPI-support.patch
# PATCH-FIX-UPSTREAM
Patch3:         0001-Fix-path-traversal-issue-when-extracting-an-.okular-.patch
BuildRequires:  chmlib-devel
BuildRequires:  extra-cmake-modules
BuildRequires:  freetype2-devel
BuildRequires:  kactivities5-devel
BuildRequires:  karchive-devel
BuildRequires:  kbookmarks-devel
BuildRequires:  kcompletion-devel
BuildRequires:  kconfig-devel
BuildRequires:  kconfigwidgets-devel
BuildRequires:  kcoreaddons-devel
BuildRequires:  kdbusaddons-devel
BuildRequires:  kdoctools-devel
BuildRequires:  kf5-filesystem
BuildRequires:  khtml-devel
BuildRequires:  kiconthemes-devel
BuildRequires:  kio-devel
BuildRequires:  kjs-devel
BuildRequires:  kparts-devel
BuildRequires:  kpty-devel
BuildRequires:  kwallet-devel
BuildRequires:  kwindowsystem-devel
BuildRequires:  libdjvulibre-devel
BuildRequires:  libepub-devel
BuildRequires:  libjpeg-devel
BuildRequires:  libkexiv2-devel
BuildRequires:  libpoppler-qt5-devel
BuildRequires:  libqca-qt5-devel
BuildRequires:  libspectre-devel
BuildRequires:  libtiff-devel
BuildRequires:  mobipocket-devel
BuildRequires:  phonon4qt5-devel
BuildRequires:  pkgconfig
BuildRequires:  threadweaver-devel
BuildRequires:  zlib-devel
BuildRequires:  pkgconfig(Qt5Core) >= 5.6.0
BuildRequires:  pkgconfig(Qt5DBus) >= 5.6.0
BuildRequires:  pkgconfig(Qt5PrintSupport) >= 5.6.0
BuildRequires:  pkgconfig(Qt5Qml) >= 5.6.0
BuildRequires:  pkgconfig(Qt5Quick) >= 5.6.0
BuildRequires:  pkgconfig(Qt5Svg) >= 5.6.0
BuildRequires:  pkgconfig(Qt5Test) >= 5.6.0
BuildRequires:  pkgconfig(Qt5Widgets) >= 5.6.0
Obsoletes:      okular5 < %{version}
Provides:       okular5 = %{version}
Recommends:     %{name}-lang
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Document viewing program; supports document in PDF, PS and
many other formats.

%package devel
Summary:        Document Viewer - Development Files
Group:          Development/Libraries/KDE
Requires:       %{name} = %{version}
Requires:       cmake(KF5Config)
Requires:       cmake(KF5CoreAddons)
Requires:       cmake(KF5XmlGui)
Requires:       cmake(Qt5Core) >= 5.6.0
Requires:       cmake(Qt5PrintSupport) >= 5.6.0
Requires:       cmake(Qt5Widgets) >= 5.6.0
Obsoletes:      okular5-devel < %{version}
Provides:       okular5-devel = %{version}

%description devel
Document viewing program; supports document in various formats

%if %{with lang}
%lang_package
%endif

%prep
%setup -q -n okular-%{version}
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1

%build
%cmake_kf5 -d build
%make_jobs

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

rm -rfv %{buildroot}/%{_kf5_applicationsdir}/org.kde.mobile*

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

%files
%defattr(-,root,root)
%{_kf5_libdir}/libOkular5Core.so.*
%{_kf5_plugindir}/
%{_kf5_applicationsdir}/*.desktop
%{_kf5_configkcfgdir}/
%{_kf5_iconsdir}/hicolor/*/*/okular.*
%{_kf5_servicesdir}/
%{_kf5_servicetypesdir}/
%{_kf5_sharedir}/kconf_update
%{_kf5_sharedir}/okular
%{_kf5_sharedir}/kxmlgui5
%{_kf5_bindir}/okular
%{_kf5_qmldir}/
%dir %{_kf5_appstreamdir}
%{_kf5_appstreamdir}/org.kde.okular*.xml
%dir %{_kf5_htmldir}/en
%dir %{_kf5_htmldir}
%doc %{_kf5_htmldir}/en/*/
%doc %{_kf5_mandir}/man1/okular.*
%{_datadir}/kpackage/
%{_kf5_configdir}/okular.categories

%files devel
%defattr(-,root,root)
%{_kf5_prefix}/include/okular/
%{_kf5_libdir}/cmake/Okular5/
%{_kf5_libdir}/libOkular5Core.so

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

%changelog
openSUSE Build Service is sponsored by