| 1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-admin/keepass/keepass-2.19.ebuild,v 1.1 2012/08/04 14:21:04 kensington Exp $
|
| 4 |
|
| 5 |
EAPI=4
|
| 6 |
|
| 7 |
inherit eutils fdo-mime gnome2-utils mono multilib
|
| 8 |
|
| 9 |
MY_PN="KeePass"
|
| 10 |
DESCRIPTION="A free, open source, light-weight and easy-to-use password manager"
|
| 11 |
HOMEPAGE="http://keepass.info/"
|
| 12 |
SRC_URI="mirror://sourceforge/${PN}/${MY_PN}-${PV}-Source.zip"
|
| 13 |
|
| 14 |
LICENSE="GPL-2"
|
| 15 |
SLOT="0"
|
| 16 |
KEYWORDS="~amd64 ~x86"
|
| 17 |
IUSE="aot"
|
| 18 |
|
| 19 |
COMMON_DEPEND=">=dev-lang/mono-2.10.5"
|
| 20 |
RDEPEND="${COMMON_DEPEND}
|
| 21 |
dev-dotnet/libgdiplus[cairo]"
|
| 22 |
DEPEND="${COMMON_DEPEND}
|
| 23 |
app-arch/unzip"
|
| 24 |
|
| 25 |
S=${WORKDIR}
|
| 26 |
|
| 27 |
src_prepare() {
|
| 28 |
# Remove Windows-specific things
|
| 29 |
pushd Build || die
|
| 30 |
. PrepMonoDev.sh || die
|
| 31 |
popd || die
|
| 32 |
|
| 33 |
# KeePass looks for some XSL files in the same folder as the executable,
|
| 34 |
# we prefer to have it in /usr/share/KeePass
|
| 35 |
epatch "${FILESDIR}/${PN}-2.20-xsl-path-detection.patch"
|
| 36 |
}
|
| 37 |
|
| 38 |
src_compile() {
|
| 39 |
# Build with Release target
|
| 40 |
xbuild /target:KeePass /property:Configuration=Release || die
|
| 41 |
|
| 42 |
# Run Ahead Of Time compiler on the binary
|
| 43 |
if use aot; then
|
| 44 |
cp Ext/KeePass.exe.config Build/KeePass/Release/
|
| 45 |
mono --aot -O=all Build/KeePass/Release/KeePass.exe || die
|
| 46 |
fi
|
| 47 |
}
|
| 48 |
|
| 49 |
src_install() {
|
| 50 |
# Wrapper script to launch mono
|
| 51 |
make_wrapper ${PN} "mono /usr/$(get_libdir)/${PN}/KeePass.exe"
|
| 52 |
|
| 53 |
# Some XSL files
|
| 54 |
insinto /usr/share/${PN}/XSL
|
| 55 |
doins Ext/XSL/*
|
| 56 |
|
| 57 |
insinto /usr/$(get_libdir)/${PN}/
|
| 58 |
exeinto /usr/$(get_libdir)/${PN}/
|
| 59 |
doins Ext/KeePass.exe.config
|
| 60 |
# Default configuration, simply says to use user-specific configuration
|
| 61 |
doins Ext/KeePass.config.xml
|
| 62 |
|
| 63 |
# The actual executable
|
| 64 |
doexe Build/KeePass/Release/KeePass.exe
|
| 65 |
|
| 66 |
# Copy the AOT compilation result
|
| 67 |
if use aot; then
|
| 68 |
doexe Build/KeePass/Release/KeePass.exe.so
|
| 69 |
fi
|
| 70 |
|
| 71 |
# Prepare the icons
|
| 72 |
newicon -s 256 Ext/Icons/Finals/plockb.png "${PN}.png"
|
| 73 |
newicon -s 256 -t gnome -c mimetypes Ext/Icons/Finals/plockb.png "application-x-${PN}2.png"
|
| 74 |
|
| 75 |
# Create a desktop entry and associate it with the KeePass mime type
|
| 76 |
make_desktop_entry ${PN} ${MY_PN} ${PN} "System;Security" "MimeType=application/x-keepass2;"
|
| 77 |
|
| 78 |
# MIME descriptor for .kdbx files
|
| 79 |
insinto /usr/share/mime/packages/
|
| 80 |
doins "${FILESDIR}/${PN}.xml"
|
| 81 |
}
|
| 82 |
|
| 83 |
pkg_preinst() {
|
| 84 |
gnome2_icon_savelist
|
| 85 |
}
|
| 86 |
|
| 87 |
pkg_postinst() {
|
| 88 |
gnome2_icon_cache_update
|
| 89 |
fdo-mime_mime_database_update
|
| 90 |
fdo-mime_desktop_database_update
|
| 91 |
|
| 92 |
elog "Optional dependencies:"
|
| 93 |
elog " x11-misc/xdotool (enables autotype)"
|
| 94 |
}
|
| 95 |
|
| 96 |
pkg_postrm() {
|
| 97 |
gnome2_icon_cache_update
|
| 98 |
fdo-mime_mime_database_update
|
| 99 |
fdo-mime_desktop_database_update
|
| 100 |
}
|