File ark.spec of Package ark

# spec file for package ark
# Copyright (c) 2020 SUSE LLC
# 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

%define SOMAJOR 20
# Latest stable Applications (e.g. 17.08 in KA, but 17.11.80 in KUA)
%{!?_kapp_version: %define _kapp_version %(echo %{version}| awk -F. '{print $1"."$2}')}
%bcond_without lang
Name:           ark
Version:        20.04.3
Release:        0
Summary:        KDE Archiver Tool
License:        GPL-2.0-or-later
Group:          Productivity/Other
Patch0:         0001-Support-building-against-libarchive-3.3.2-again.patch
Patch1:         0001-Fix-vulnerability-to-path-traversal-attacks.patch
BuildRequires:  extra-cmake-modules
BuildRequires:  kf5-filesystem
BuildRequires:  libarchive-devel
BuildRequires:  libzip-devel >= 1.2.0
BuildRequires:  pkgconfig
BuildRequires:  update-desktop-files
BuildRequires:  xz
BuildRequires:  xz-devel
BuildRequires:  zlib-devel
BuildRequires:  cmake(KF5Archive)
BuildRequires:  cmake(KF5Config)
BuildRequires:  cmake(KF5Crash)
BuildRequires:  cmake(KF5DBusAddons)
BuildRequires:  cmake(KF5DocTools)
BuildRequires:  cmake(KF5I18n)
BuildRequires:  cmake(KF5IconThemes)
BuildRequires:  cmake(KF5ItemModels)
BuildRequires:  cmake(KF5KIO)
BuildRequires:  cmake(KF5Parts)
BuildRequires:  cmake(KF5Pty)
BuildRequires:  cmake(KF5Service)
BuildRequires:  cmake(Qt5Concurrent)
BuildRequires:  cmake(Qt5Core)
BuildRequires:  cmake(Qt5Test)
BuildRequires:  cmake(Qt5Widgets)
BuildRequires:  pkgconfig(bzip2)
Requires:       shared-mime-info
# Recommend the most used compression programs (bnc#872010)
Recommends:     xz
# unrar is non-free. Avoid installing it automatically.
Suggests:       unrar
Obsoletes:      ark-devel
%if %{with lang}
Source2:        applications.keyring
%if 0%{?suse_version} > 1500
Recommends:     p7zip-full
Recommends:     p7zip
Recommends:     %{name}-lang

This is a KDE application to work with compressed archives.

%package -n libkerfuffle%{SOMAJOR}
Summary:        KDE Archiver Tool
Group:          System/Libraries

%description -n libkerfuffle%{SOMAJOR}
This is a KDE application to work with compressed archives.


%autosetup -p1

  %cmake_kf5 -d build

  %kf5_makeinstall -C build
  %if %{with lang}
    %find_lang %{name} --with-man --all-name
  %suse_update_desktop_file org.kde.ark System Archiving



%post -n libkerfuffle%{SOMAJOR} -p /sbin/ldconfig
%postun -n libkerfuffle%{SOMAJOR} -p /sbin/ldconfig

%license COPYING*
%dir %{_kf5_htmldir}
%dir %{_kf5_htmldir}/en
%doc %lang(en) %{_kf5_htmldir}/en/ark/
%doc %{_kf5_mandir}/man1/ark.*

%files -n libkerfuffle%{SOMAJOR}
%license COPYING*

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