File keepassx.spec of Package keepassx

#
# spec file for package keepassx (Version 0.4.3)
#
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

# norootforbuild

%if 0%{?suse_version}
BuildRequires:  libqt4-devel >= 4.3.0, xorg-x11-devel, update-desktop-files
Requires:       libqt4 >= 4.3.0, libqt4-x11 >= 4.3.0
%endif
%if 0%{?fedora_version}
BuildRequires:  qt4-devel >= 4.3.0, xorg-x11-proto-devel, libXtst-devel, desktop-file-utils, gcc-c++
Requires:       qt4 >= 4.3.0, qt4-x11 >= 4.3.0
%endif
%if 0%{?centos_version} || 0%{?rhel_version}
BuildRequires:  qt4-devel >= 4.3.0, xorg-x11-proto-devel, libXtst-devel, desktop-file-utils, gcc-c++
Requires:       qt4 >= 4.3.0
%endif

Name:         keepassx
URL:          http://www.keepassx.org/
License:      GPLv2
%if 0%{?suse_version}
Group:        Productivity/Security
%endif
%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version}
Group:        User interface/Desktops
%endif
Summary:      KeePassX Cross Platform Password Manager
Version:      0.4.3
%if 0%{?fedora_version} || 0%{?centos_version} || 0%{?rhel_version}
Release:      0%{?dist}
%else
Release:      0
%endif
Source:       keepassx-%{version}.tar.bz2
Patch0:       keepassx-0.4.3-fix_build.patch
BuildRoot:    %{_tmppath}/%{name}-%{version}-build

%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 -p1

%build
%if 0%{?centos_version} || 0%{?rhel_version}
export PATH=/usr/lib64/qt4/bin:/usr/lib/qt4/bin:$PATH
%endif

%if 0%{?fedora_version}
CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" \
qmake-qt4 PREFIX=%{_prefix} NOSTRIP=1
%else
CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" \
qmake PREFIX=%{_prefix} NOSTRIP=1
%endif

%__make

%install
make DESTDIR=%{buildroot} INSTALL_ROOT=%{buildroot} install
%if 0%{?suse_version}
rm -rf %{buildroot}%{_datadir}/mimelnk
%endif

%clean
# clean up the hard disc after build
%__rm -rf %{buildroot}

%files
%defattr(-,root,root)
%{_bindir}/%{name}
%{_datadir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/mime/packages/%{name}.xml
%if ! 0%{?suse_version}
%{_datadir}/mimelnk/application/x-keepass.desktop
%endif
%{_datadir}/pixmaps/%{name}.xpm

%changelog