File keepassx.spec of Package keepassx

#
# spec file for package keepassx
#
# Copyright (c) 2015 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/
#


Name:           keepassx
Version:        0.4.4
Release:        0
License:        GPL-2.0
Summary:        Cross Platform Password Manager
Url:            http://keepassx.sourceforge.net/
Group:          Productivity/Security
Source0:        https://www.keepassx.org/releases/%{version}/%{name}-%{version}.tar.gz
# PATCH-FIX-UPSTREAM keepassx-0.4.3-fix-save.patch sf#3075447 mhopf@novell.com -- fix save database
Patch0:         keepassx-0.4.3-fix-save.patch
# PATCH-FIX-UPSTREAM keepassx-0.4.3-gcc47.patch lazy.kent@opensuse.org -- fix build with gcc 4.7
Patch1:         keepassx-0.4.3-gcc47.patch
# PATCH-FIX-UPSTREAM keepassx-0.4.3-ru_translation.patch -- typos and misspelling fixes for russian translation
Patch2:         keepassx-0.4.3-ru_translation.patch
BuildRequires:  update-desktop-files
BuildRequires:  pkgconfig(QtCore)
BuildRequires:  pkgconfig(QtGui)
BuildRequires:  pkgconfig(QtXml)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires(pre):  shared-mime-info

%description
KeePassX is a free/open-source password manager or safe which helps you
to manage your passwords in a secure way. You can put all your passwords
in one database, which is locked with one master key or a key-disk. So
you only have to remember one single master password or insert the
key-disk to unlock the whole database. The databases are encrypted using
the best and most secure encryption algorithms currently known (AES and
Twofish).

%prep
%setup -q
%patch0
%patch1
%patch2

%build
sh -x translations_release.sh
qmake \
    QMAKE_CFLAGS+="%{optflags}" \
    QMAKE_CXXFLAGS+="%{optflags}" \
    QMAKE_STRIP="true"
make %{?_smp_mflags}

%install
make INSTALL_ROOT=%{buildroot} install
rm -rf %{buildroot}%{_datadir}/mimelnk

%post
%desktop_database_post
%mime_database_post

%postun
%desktop_database_postun
%mime_database_postun

%files
%defattr(-,root,root,-)
%doc changelog COPYING
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/applications/%{name}.desktop
%{_datadir}/mime/packages/%{name}.xml
%{_datadir}/pixmaps/%{name}.xpm

%changelog
openSUSE Build Service is sponsored by