Blob Blame History Raw
Name:           keepassx
Version:        0.2.2
Release:        2%{?dist}
Summary:        Cross-platform password manager

Group:          User Interface/Desktops
License:        GPL
URL:            http://keepassx.sourceforge.net
Source0:        http://download.sf.net/keepassx/KeePassX-%{version}.tar.gz
Source1:        http://keepassx.sourceforge.net/images/logos/KeePassX_logo_100x100.png
Patch0:         keepass-0.2.2-htmlview.patch
Patch1:         keepassx-0.2.2-helpurl.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:  qt4-devel > 4.1, libXtst-devel, ImageMagick, desktop-file-utils

Requires:       hicolor-icon-theme, htmlview

%description
KeePassX is an application for people with extremly high demands on secure
personal data management.
KeePassX saves many different information e.g. user names, passwords, urls,
attachemts and comments in one single database. For a better management
user-defined titles and icons can be specified for each single entry.
Furthermore the entries are sorted in groups, which are customizable as well.
The integrated search function allows to search in a single group or the
complete database.
KeePassX offers a little utility for secure password generation. The password
generator is very customizable, fast and easy to use. Especially someone who
generates passwords frequently will appreciate this feature.
The complete database is always encrypted either with AES (alias Rijndael) or
Twofish encryption algorithm using a 256 bit key. Therefore the saved
information can be considered as quite safe. KeePassX uses a database format
that is compatible with KeePass Password Safe for MS Windows.


%prep
%setup -q
%patch0 -p0 -b .htmlview
%patch1 -p0 -b .helpurl


%build
export CFLAGS=$RPM_OPT_FLAGS
export CXXFLAGS=$RPM_OPT_FLAGS
qmake-qt4 PREFIX=%{_prefix}
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
make install INSTALL_ROOT=$RPM_BUILD_ROOT

# Icons
for size in 16 22 24 32 48 64 96 128; do
  mkdir -p $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${size}x${size}/apps
  convert -resize ${size}x${size} %{SOURCE1} \
    $RPM_BUILD_ROOT%{_datadir}/icons/hicolor/${size}x${size}/apps/keepassx.png
done
# Fix permissions
chmod -x $RPM_BUILD_ROOT%{_datadir}/keepass/icons/*.png

# Menu
cat > %{name}.desktop << EOF
[Desktop Entry]
Name=KeePassX
Comment=Password manager
Exec=keepass %f
Icon=keepassx.png
Type=Application
MimeType=application/x-keepass;
EOF
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
desktop-file-install  --vendor fedora \
        --dir $RPM_BUILD_ROOT%{_datadir}/applications \
        --add-category Utility \
        --add-category Qt \
        %{name}.desktop

# Associate KDB files
cat > x-keepass.desktop << EOF
[Desktop Entry]
Comment=
Hidden=false
Icon=keepassx.png
MimeType=application/x-keepass
Patterns=*.kdb;*.KDB
Type=MimeType
EOF
install -D -m 644 -p x-keepass.desktop \
  $RPM_BUILD_ROOT%{_datadir}/mimelnk/application/x-keepass.desktop


%post
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
update-desktop-database &> /dev/null ||:

%postun
touch --no-create %{_datadir}/icons/hicolor || :
if [ -x %{_bindir}/gtk-update-icon-cache ]; then
    %{_bindir}/gtk-update-icon-cache --quiet %{_datadir}/icons/hicolor || :
fi
update-desktop-database &> /dev/null ||:


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc share/keepass/license.html
%{_bindir}/keepass
%{_datadir}/keepass
%{_datadir}/applications/*.desktop
%{_datadir}/mimelnk/application/*.desktop
%{_datadir}/icons/hicolor/*/apps/keepassx.png


%changelog
* Wed Jun 27 2007 Aurelien Bompard <abompard@fedoraproject.org> 0.2.2-2
- fix help button
- use htmlview instead of the hardcoded konqueror

* Sun Mar 04 2007 Aurelien Bompard <abompard@fedoraproject.org> 0.2.2-1
- initial package