File keepassxc.spec of Package keepassxc

# spec file for package keepassxc
# Copyright (c) 2019 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

Name:           keepassxc
Version:        2.5.1
Release:        0
Summary:        Qt5-based Password Manager
License:        GPL-2.0-only OR GPL-3.0-only
Group:          Productivity/Security
Source98:       debian.tar.xz
Source99:       keepassxc.dsc
BuildRequires:  cmake >= 3.1.0
BuildRequires:  fdupes
BuildRequires:  hicolor-icon-theme
BuildRequires:  libgcrypt-devel >= 1.7
%if 0%{?suse_version}
BuildRequires:  libqt5-linguist-devel
BuildRequires:  libquazip-qt5-devel
BuildRequires:  qt5-linguist
BuildRequires:  quazip-qt5-devel
BuildRequires:  libsodium-devel
%if 0%{?suse_version}
BuildRequires:  libykpers-devel
BuildRequires:  ykpers-devel
BuildRequires:  libyubikey-devel
BuildRequires:  readline-devel
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(Qt5Concurrent)
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5DBus)
BuildRequires:  pkgconfig(Qt5Network)
BuildRequires:  pkgconfig(Qt5Svg)
BuildRequires:  pkgconfig(Qt5Test)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5X11Extras)
BuildRequires:  pkgconfig(bash-completion)
BuildRequires:  pkgconfig(libargon2)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libmicrohttpd)
BuildRequires:  pkgconfig(libqrencode)
BuildRequires:  pkgconfig(xi)
BuildRequires:  pkgconfig(xtst)
BuildRequires:  pkgconfig(zlib)
%if 0%{?suse_version}
BuildRequires:  update-desktop-files
Requires:       hicolor-icon-theme
Requires(post): hicolor-icon-theme
Requires(post): shared-mime-info
Requires(postun): hicolor-icon-theme
Requires(postun): shared-mime-info
%if 0%{?suse_version}
Requires(post): update-desktop-files
Requires(postun): update-desktop-files
Recommends:     %{name}-lang
# until boo#1117355 is fixed
%if 0%{?suse_version}
BuildRequires:  libgcrypt20-hmac
Requires:       libgcrypt20-hmac
# boo#1148406. Last version in factory 2.0.3-2.7
Provides:       keepassx = 2.0.4
Obsoletes:      keepassx < 2.0.4

A password manager or safe which manages your passwords. Databases
are locked with a master key/password or a key disk. The databases
are encrypted using AES and Twofish.

%if 0%{?suse_version}

%setup -q

%define _lto_cflags %{nil}
%cmake \
%if 0%{?suse_version}
make %{?_smp_mflags}

%if 0%{?suse_version}
for i in $(find %{buildroot} -type f -name \*.svgz) ; do
  gunzip < $i > $j
%if 0%{?suse_version}
%fdupes -s %{buildroot}/%{_prefix}

# gh#keepassxreboot/keepassxc#667
export LANG=en_US.UTF-8

%if 0%{?suse_version}
# on newer distros it is handled via file trigger
%if 0%{?suse_version} < 1500

touch --no-create %{_datadir}/icons/hicolor >/dev/null 2>/dev/null || :

update-desktop-database >/dev/null 2>/dev/null || :
if [ $1 -eq 0 ] ; then
    touch --no-create %{_datadir}/icons/hicolor >/dev/null 2>/dev/null
    gtk-update-icon-cache %{_datadir}/icons/hicolor >/dev/null 2>/dev/null || :

gtk-update-icon-cache %{_datadir}/icons/hicolor >/dev/null 2>/dev/null || :

%doc docs/*
%dir %{_datadir}/%{name}
%dir %{_datadir}/metainfo
%dir %{_libdir}/%{name}

%if 0%{?suse_version}
%files lang