1 |
commit: 9c5bb37bf6ebebec1b9990ee9294ada0cd250ce6 |
2 |
Author: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sat Oct 6 10:31:54 2018 +0000 |
4 |
Commit: Michael Palimaka <kensington <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Oct 6 10:32:26 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c5bb37b |
7 |
|
8 |
app-admin/keepass: define WMClass in .desktop file |
9 |
|
10 |
Closes: https://bugs.gentoo.org/626710 |
11 |
Signed-off-by: Michael Palimaka <kensington <AT> gentoo.org> |
12 |
Package-Manager: Portage-2.3.49, Repoman-2.3.11 |
13 |
|
14 |
app-admin/keepass/keepass-2.40-r1.ebuild | 111 +++++++++++++++++++++++++++++++ |
15 |
1 file changed, 111 insertions(+) |
16 |
|
17 |
diff --git a/app-admin/keepass/keepass-2.40-r1.ebuild b/app-admin/keepass/keepass-2.40-r1.ebuild |
18 |
new file mode 100644 |
19 |
index 00000000000..2e9012f8220 |
20 |
--- /dev/null |
21 |
+++ b/app-admin/keepass/keepass-2.40-r1.ebuild |
22 |
@@ -0,0 +1,111 @@ |
23 |
+# Copyright 1999-2018 Gentoo Authors |
24 |
+# Distributed under the terms of the GNU General Public License v2 |
25 |
+ |
26 |
+EAPI=6 |
27 |
+ |
28 |
+inherit eutils gnome2-utils xdg-utils |
29 |
+ |
30 |
+MY_PN="KeePass" |
31 |
+DESCRIPTION="A free, open source, light-weight and easy-to-use password manager" |
32 |
+HOMEPAGE="https://keepass.info/" |
33 |
+SRC_URI="mirror://sourceforge/${PN}/${MY_PN}-${PV}-Source.zip" |
34 |
+ |
35 |
+LICENSE="GPL-2" |
36 |
+SLOT="0" |
37 |
+KEYWORDS="~amd64 ~x86" |
38 |
+IUSE="aot" |
39 |
+ |
40 |
+COMMON_DEPEND="dev-lang/mono" |
41 |
+DEPEND="${COMMON_DEPEND} |
42 |
+ app-arch/unzip |
43 |
+" |
44 |
+RDEPEND="${COMMON_DEPEND} |
45 |
+ dev-dotnet/libgdiplus[cairo] |
46 |
+" |
47 |
+ |
48 |
+S="${WORKDIR}" |
49 |
+PATCHES=( "${FILESDIR}/${PN}-2.36-xsl-path-detection.patch" ) |
50 |
+ |
51 |
+src_prepare() { |
52 |
+ # KeePass looks for some XSL files in the same folder as the executable, |
53 |
+ # we prefer to have it in /usr/share/KeePass. Apply patch using base function. |
54 |
+ # This XSL file will not be upstreamed since the KeePass creator said that |
55 |
+ # including this patch would break the Portable USB version of KeePass |
56 |
+ # (which keeps/looks for xsl files in its own folder) |
57 |
+ default |
58 |
+ |
59 |
+ # Switch into build dir so the mono prepration script works correctly |
60 |
+ pushd Build || die |
61 |
+ source PrepMonoDev.sh || die |
62 |
+ popd || die |
63 |
+} |
64 |
+ |
65 |
+src_compile() { |
66 |
+ # Build with Release target |
67 |
+ xbuild /target:KeePass /property:Configuration=Release || die |
68 |
+ |
69 |
+ # Run Ahead Of Time compiler on the binary |
70 |
+ if use aot; then |
71 |
+ cp Ext/KeePass.exe.config Build/KeePass/Release/ || die |
72 |
+ mono --aot -O=all Build/KeePass/Release/KeePass.exe || die |
73 |
+ fi |
74 |
+} |
75 |
+ |
76 |
+src_install() { |
77 |
+ # Wrapper script to launch mono |
78 |
+ make_wrapper "${PN}" "mono /usr/$(get_libdir)/${PN}/KeePass.exe" |
79 |
+ |
80 |
+ # Some XSL files |
81 |
+ insinto "/usr/share/${PN}/XSL" |
82 |
+ doins Ext/XSL/* |
83 |
+ |
84 |
+ insinto "/usr/$(get_libdir)/${PN}" |
85 |
+ exeinto "/usr/$(get_libdir)/${PN}" |
86 |
+ |
87 |
+ doins Ext/KeePass.exe.config |
88 |
+ |
89 |
+ # Default configuration, simply says to use user-specific configuration |
90 |
+ doins Ext/KeePass.config.xml |
91 |
+ |
92 |
+ # The actual executable |
93 |
+ doexe Build/KeePass/Release/KeePass.exe |
94 |
+ |
95 |
+ # Copy the AOT compilation result |
96 |
+ if use aot; then |
97 |
+ doexe Build/KeePass/Release/KeePass.exe.so |
98 |
+ fi |
99 |
+ |
100 |
+ # Prepare the icons |
101 |
+ newicon -s 256 Ext/Icons_04_CB/Finals/plockb.png "${PN}.png" |
102 |
+ newicon -s 256 -t gnome -c mimetypes Ext/Icons_04_CB/Finals/plockb.png "application-x-${PN}2.png" |
103 |
+ |
104 |
+ # Create a desktop entry and associate it with the KeePass mime type |
105 |
+ make_desktop_entry "${PN}" "${MY_PN}" "${PN}" "System;Security" "MimeType=application/x-keepass2;\nStartupWMClass=KeePass2;" |
106 |
+ |
107 |
+ # MIME descriptor for .kdbx files |
108 |
+ insinto /usr/share/mime/packages |
109 |
+ doins "${FILESDIR}/${PN}.xml" |
110 |
+ |
111 |
+ # sed, because patching this really sucks |
112 |
+ sed -i 's/mono/mono --verify-all/g' "${D}/usr/bin/keepass" || die |
113 |
+} |
114 |
+ |
115 |
+pkg_postinst() { |
116 |
+ gnome2_icon_cache_update |
117 |
+ xdg_desktop_database_update |
118 |
+ xdg_mimeinfo_database_update |
119 |
+ |
120 |
+ if ! has_version x11-misc/xdotool ; then |
121 |
+ elog "Optional dependencies:" |
122 |
+ elog " x11-misc/xdotool (enables autotype/autofill)" |
123 |
+ fi |
124 |
+ |
125 |
+ elog "Some systems may experience issues with copy and paste operations." |
126 |
+ elog "If you encounter this, please install x11-misc/xsel." |
127 |
+} |
128 |
+ |
129 |
+pkg_postrm() { |
130 |
+ gnome2_icon_cache_update |
131 |
+ xdg_desktop_database_update |
132 |
+ xdg_mimeinfo_database_update |
133 |
+} |