1 |
commit: 657ba44832727830f2ea042ee68295ba91701a05 |
2 |
Author: Gokturk Yuksek <gokturk <AT> binghamton <DOT> edu> |
3 |
AuthorDate: Tue Nov 3 23:14:45 2015 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Dec 25 02:23:50 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=657ba448 |
7 |
|
8 |
app-crypt/libu2f-host: create the group 'plugdev' if necessary #564748 |
9 |
|
10 |
This ebuild installs a udev rule that creates matching hidraw nodes |
11 |
with the group 'plugdev' for non-systemd configurations. However, it |
12 |
does not create the group if it doesn't exist, causing attached |
13 |
devices to fail permission checks. |
14 |
|
15 |
Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=564748 |
16 |
|
17 |
Package-Manager: portage-2.2.20.1 |
18 |
|
19 |
app-crypt/libu2f-host/libu2f-host-1.0.0-r1.ebuild | 64 +++++++++++++++++++++++ |
20 |
1 file changed, 64 insertions(+) |
21 |
|
22 |
diff --git a/app-crypt/libu2f-host/libu2f-host-1.0.0-r1.ebuild b/app-crypt/libu2f-host/libu2f-host-1.0.0-r1.ebuild |
23 |
new file mode 100644 |
24 |
index 0000000..bb3bd40 |
25 |
--- /dev/null |
26 |
+++ b/app-crypt/libu2f-host/libu2f-host-1.0.0-r1.ebuild |
27 |
@@ -0,0 +1,64 @@ |
28 |
+# Copyright 1999-2015 Gentoo Foundation |
29 |
+# Distributed under the terms of the GNU General Public License v2 |
30 |
+# $Id$ |
31 |
+ |
32 |
+EAPI=5 |
33 |
+ |
34 |
+inherit autotools-utils linux-info udev user |
35 |
+ |
36 |
+DESCRIPTION="Yubico Universal 2nd Factor (U2F) Host C Library" |
37 |
+HOMEPAGE="https://developers.yubico.com/libu2f-host/" |
38 |
+SRC_URI="https://developers.yubico.com/${PN}/Releases/${P}.tar.xz" |
39 |
+ |
40 |
+LICENSE="LGPL-2" |
41 |
+SLOT="0" |
42 |
+KEYWORDS="~amd64" |
43 |
+IUSE="kernel_linux static-libs systemd" |
44 |
+ |
45 |
+RDEPEND=" |
46 |
+ dev-libs/hidapi |
47 |
+ dev-libs/json-c" |
48 |
+DEPEND="${RDEPEND} |
49 |
+ virtual/pkgconfig" |
50 |
+RDEPEND="${RDEPEND} |
51 |
+ systemd? ( sys-apps/systemd[acl] )" |
52 |
+ |
53 |
+CONFIG_CHECK="~HIDRAW" |
54 |
+ |
55 |
+pkg_setup() { |
56 |
+ # The U2F device node will be owned by group 'plugdev' |
57 |
+ # in non-systemd configurations |
58 |
+ if ! use systemd; then |
59 |
+ enewgroup plugdev |
60 |
+ fi |
61 |
+} |
62 |
+ |
63 |
+src_prepare() { |
64 |
+ autotools-utils_src_prepare |
65 |
+ |
66 |
+ sed -e 's:TAG+="uaccess":MODE="0664", GROUP="plugdev":g' \ |
67 |
+ 70-u2f.rules > 70-u2f-udev.rules || die |
68 |
+} |
69 |
+ |
70 |
+src_configure() { |
71 |
+ autotools-utils_src_configure |
72 |
+} |
73 |
+ |
74 |
+src_install() { |
75 |
+ autotools-utils_src_install |
76 |
+ |
77 |
+ if use kernel_linux; then |
78 |
+ if use systemd; then |
79 |
+ udev_dorules 70-u2f.rules |
80 |
+ else |
81 |
+ udev_newrules 70-u2f-udev.rules 70-u2f.rules |
82 |
+ fi |
83 |
+ fi |
84 |
+} |
85 |
+ |
86 |
+pkg_postinst() { |
87 |
+ if ! use systemd; then |
88 |
+ elog "Users must be a member of the 'plugdev' group" |
89 |
+ elog "to be able to access U2F devices" |
90 |
+ fi |
91 |
+} |