summaryrefslogtreecommitdiff
path: root/sys-auth/thinkfinger
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-auth/thinkfinger
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-auth/thinkfinger')
-rw-r--r--sys-auth/thinkfinger/Manifest11
-rw-r--r--sys-auth/thinkfinger/files/0.3-carriagereturn.patch10
-rw-r--r--sys-auth/thinkfinger/files/0.3-direct_set_config_usb_hello.patch31
-rw-r--r--sys-auth/thinkfinger/files/0.3-send-sync-event.patch50
-rw-r--r--sys-auth/thinkfinger/files/0.3-strip-strip.patch24
-rw-r--r--sys-auth/thinkfinger/files/0.3-tftoolgroup.patch64
-rw-r--r--sys-auth/thinkfinger/files/60-thinkfinger.rules5
-rw-r--r--sys-auth/thinkfinger/metadata.xml20
-rw-r--r--sys-auth/thinkfinger/thinkfinger-0.3-r3.ebuild79
9 files changed, 294 insertions, 0 deletions
diff --git a/sys-auth/thinkfinger/Manifest b/sys-auth/thinkfinger/Manifest
new file mode 100644
index 000000000000..2de44b1a3fe3
--- /dev/null
+++ b/sys-auth/thinkfinger/Manifest
@@ -0,0 +1,11 @@
+AUX 0.3-carriagereturn.patch 409 SHA256 75b6d7093d6182a1384ada721f92975450e1055cf0e6796f2649260042738b65 SHA512 f41093878aebdea7c68d55a2c1365fd0cc491715797cd56ddc5b5f77390350d6bd097767d2d21bdb2d24f95ffa31057da726aeb3248b88cb37244bf2d442e7af WHIRLPOOL 04ad5f17da6a87386a859891c6e7921370a302ef54d73d6c002917d1fa3d9574502c12460c1a95bfd6c5e125e9c52c0185960e03ae1810d97fc5279f3b965127
+AUX 0.3-direct_set_config_usb_hello.patch 941 SHA256 285fd6ae82334e5b9b19fc0ba1e8429b0c46cb7b880a0df251989c7862969c23 SHA512 7770bc4eafb00e6ca4cef38cbaeab021ecb90bc7c3d8fdfb98c2c9b07a74d2e95227701a73c85a166e689387e44e37da67f765b7e427bb150e26c22eb3abd86e WHIRLPOOL 8b968417ad1455293f0d3ebff82fd930bba816d07c5b98a336ab0299dd01eb291e1722068609d39e966fa2f610ce9209f9a56ff1a510c6072451da45ea1d0b2f
+AUX 0.3-send-sync-event.patch 1031 SHA256 ff9aab4179d44708bb77b3b8be4939c3559e724b90fef8c688c5c9d0e996f095 SHA512 d73ed855535f093d3fbbbee368b3bd6a6ea66bf6ba347321468ab2990dc94efdb4b7b1c655a6501872304b2e7e9b07a2a8f32ae9e354c41bbccf6973bb0d9953 WHIRLPOOL 517f596513ed36445bc2a3e4a485b60fbc78edcd7451b91350b282b864da9d6ce7dfae904e79a1b170cbf4dcf16647dcb8a12e4f93bdecbfe8457f7f4cf9ac57
+AUX 0.3-strip-strip.patch 1375 SHA256 c125aa32ade799c9ef582dc67273b686f160721f84c9bdb05abfc399462aaa1c SHA512 85572023761a8f6ad1a7355062f308267bea10ce529e1e01268f14f3d81023e1a1d94b92833741a2132f448ef074cbeb9bfc7a9a29786f2eaaa7c17989315214 WHIRLPOOL 87eab357b54bba63edc6a5bb10685bc0cfab7054a34d391562446ebc6cd6e58e56853025038668f5d7648126a30f451263945f0e367b4ab459f182ed47185175
+AUX 0.3-tftoolgroup.patch 1708 SHA256 d48da4d150986c21bb1b9c2b0f43dce9814ef0e8a1044f29805ca393721e4bd3 SHA512 cf4d73bd3fa29b029074b4a529426f7822eeb356b4ee5d7ac503a55fb27e891c63ccd44a0e155b1ab0ec3b2c32ca23378648f9514653861761ed75ca797aeb9a WHIRLPOOL 1f41745539a6e628d0daa0319e4353705e63138b7469a5ad696634c63d46575a91a0cc2c60ae27d54f500c717edef782769cb77b701d8bc6a71ea8208f2934b4
+AUX 60-thinkfinger.rules 251 SHA256 e7d1c3f56b052b4bc50f1bf245bff5b32067f869c9c1859828dae2ae2ae612c9 SHA512 076aa2c09498681952d92268f6b87137f6a7856447dfb00bdde36408fd54cdd1856566424595815068981df44c36592e26e2d61e2f220d8311373f1149b6ab4a WHIRLPOOL 0c2070ac89bb28cf49fbf2da3c4c6bebd81ea5d4a2118e1df7081cfb9bec694e0dc349a4413bd59212d6919a697a0eec5ca3d4982d0b9ebaea191c4ee437be9a
+DIST thinkfinger-0.3.tar.gz 372053 SHA256 9741ae205aadc9f576be73c382596266300e709371e72574a86e339ebf978f4b SHA512 08bbefd906047dd128c9a3d5eef4b14332e51383d9c0667974ffe7f85ccab2561310f58adfa0cfe8a65154e621a607542f6e99df9be3f21ced394bc7993db4ff WHIRLPOOL 3911ab0ef7d75004229b9c5b2c7a33253d017105c273c6fddf318a6de4e109bf83bb45533d42b5820669d8168bc58fdaaa7201aceb92c5ec6aa2427a65987ef0
+EBUILD thinkfinger-0.3-r3.ebuild 2032 SHA256 b56de65fa1c9737cf5f701f215d3e1eba3cf8fb87fa395471e1d2e5b24fdb3df SHA512 db039efeecf66ac460f5f4903196b4853dfa1df168da5d6ced830a0a4b8173aa076bc22027a64de490cd161b46a40b3631f32d20665a18ca5429f98e709d3a2e WHIRLPOOL 59561424899c669465daaa48e32c78d60eb58b35975b28246dde5b0513abaeabbc8b1a2d6bcb9f5dd24e1f86ce1da53e706346be25aceaddcd70ffe41bd1b120
+MISC ChangeLog 3044 SHA256 946de3d6a482d8e7a40ffdff5c16f80161bfd326d83ac64291726bfdd11595da SHA512 c2db8493340f9e7a3ef682e2059a41bb7d4cf042c04136f31d077131b94225f11de3fda133935a3b5b712244c24bad62f909546b093660f9d169c32c3398200a WHIRLPOOL 5d0014da33e60d7be95f084f965f911f5f5d7d5922111c387d952e96acc93c9ba3254a0b33cf96cc55b14406fabac168266c4867b102c816c5236fbac7cbcc3a
+MISC ChangeLog-2015 3889 SHA256 8deae1ef9a6ef4989e4b19d04fef8041ca5486f064fe5b59bd524fe3b9296b75 SHA512 8b4c2be89661ddd1964696981df56d29cfccea77422e6a06b08c949fbd2f5ce0496eee79dcecc768447c8b3faf30423e55671b5c4ece6dbd5c9cc60040db3da5 WHIRLPOOL 0ebf08dfdb069394190ed5ba7fef16d0769bbaf0048ffb3ecc1c0513ac6b0b6f7af8bfdabd3b1174f096482d91641a23bcb031afda08ffd3196333843652fca1
+MISC metadata.xml 600 SHA256 4c3c65b70389dcb8d2a5ff56885ee95b907d0047aba44bd00e251f0612b4be85 SHA512 612c8cf26597a4ad78644d20f3feed7ff7f1770c3a62650669892551ceed8e97d0cf2db432ca127e3986c6b6c614070f3b94ce76a6d00360e29d2bbbf6d3deeb WHIRLPOOL 1c5ef62c470c3a145e8003e1ca9b8a431a174d9bb574ac29e44f369f8339b1457cdbc023e2d9210e7534c8bd0e952ba0c85655a087632b905f50aa92e3a716f7
diff --git a/sys-auth/thinkfinger/files/0.3-carriagereturn.patch b/sys-auth/thinkfinger/files/0.3-carriagereturn.patch
new file mode 100644
index 000000000000..731f1531947b
--- /dev/null
+++ b/sys-auth/thinkfinger/files/0.3-carriagereturn.patch
@@ -0,0 +1,10 @@
+--- pam/pam_thinkfinger-uinput.c 2007-02-27 17:52:50.000000000 +0100
++++ pam/pam_thinkfinger-uinput.c 2009-02-17 13:56:02.013033249 +0100
+@@ -95,6 +95,7 @@
+ /* our single key keyboard */
+ i = ioctl (*fd, UI_SET_EVBIT, EV_KEY) < 0;
+ i |= ioctl (*fd, UI_SET_KEYBIT, KEY_ENTER) < 0;
++ i |= ioctl (*fd, UI_SET_KEYBIT, KEY_A) < 0;
+
+ if (write (*fd, &device, device_size) != device_size) {
+ retval = errno;
diff --git a/sys-auth/thinkfinger/files/0.3-direct_set_config_usb_hello.patch b/sys-auth/thinkfinger/files/0.3-direct_set_config_usb_hello.patch
new file mode 100644
index 000000000000..06723ad1306c
--- /dev/null
+++ b/sys-auth/thinkfinger/files/0.3-direct_set_config_usb_hello.patch
@@ -0,0 +1,31 @@
+Index: libthinkfinger/libthinkfinger.c
+===================================================================
+--- libthinkfinger/libthinkfinger.c (revision 118)
++++ libthinkfinger/libthinkfinger.c (working copy)
+@@ -265,18 +265,7 @@
+ int retval = -1;
+ char dummy[] = "\x10";
+
+- /* SET_CONFIGURATION 1 -- should not be relevant */
+ retval = usb_control_msg (handle, // usb_dev_handle *dev
+- 0x00000000, // int requesttype
+- 0x00000009, // int request
+- 0x001, // int value
+- 0x000, // int index
+- dummy, // char *bytes
+- 0x00000000, // int size
+- USB_TIMEOUT); // int timeout
+- if (retval < 0)
+- goto out;
+- retval = usb_control_msg (handle, // usb_dev_handle *dev
+ 0x00000040, // int requesttype
+ 0x0000000c, // int request
+ 0x100, // int value
+@@ -285,7 +274,6 @@
+ 0x00000001, // int size
+ USB_TIMEOUT); // int timeout
+
+-out:
+ return retval;
+ }
+
diff --git a/sys-auth/thinkfinger/files/0.3-send-sync-event.patch b/sys-auth/thinkfinger/files/0.3-send-sync-event.patch
new file mode 100644
index 000000000000..39e0edb27ba1
--- /dev/null
+++ b/sys-auth/thinkfinger/files/0.3-send-sync-event.patch
@@ -0,0 +1,50 @@
+--- pam/pam_thinkfinger-uinput.c 2009-12-27 18:42:26.000000000 +0100
++++ pam/pam_thinkfinger-uinput.c 2009-12-27 18:41:55.000000000 +0100
+@@ -34,27 +34,40 @@
+ int uinput_cr (int *fd)
+ {
+ int retval = 0, ev_size = 0;
+- struct input_event ev = {
++ struct input_event key_ev = {
+ .type = EV_KEY,
+ .code = KEY_ENTER,
+ .time = {0, }
+ };
+
+- ev_size = sizeof (ev);
++ ev_size = sizeof (key_ev);
+
+ /* key press */
+- ev.value = 1;
+- if (write (*fd, &ev, ev_size) != ev_size) {
++ key_ev.value = 1;
++ if (write (*fd, &key_ev, ev_size) != ev_size) {
+ retval = errno;
+ goto out;
+ }
+ /* key release */
+- ev.value = 0;
+- if (write (*fd, &ev, ev_size) != ev_size) {
++ key_ev.value = 0;
++ if (write (*fd, &key_ev, ev_size) != ev_size) {
+ retval = errno;
+ goto out;
+ }
+-
++
++ /* syn event */
++ struct input_event syn_ev = {
++ .time = {0, },
++ .type = EV_SYN,
++ .code = SYN_REPORT,
++ .value = 0
++ };
++
++ if (write (*fd, &syn_ev, ev_size) != ev_size) {
++ retval = errno;
++ goto out;
++ }
++
+ out:
+ return retval;
+ }
diff --git a/sys-auth/thinkfinger/files/0.3-strip-strip.patch b/sys-auth/thinkfinger/files/0.3-strip-strip.patch
new file mode 100644
index 000000000000..1339baf63a00
--- /dev/null
+++ b/sys-auth/thinkfinger/files/0.3-strip-strip.patch
@@ -0,0 +1,24 @@
+Strip is handled by the package manager.
+
+--- a/pam/Makefile.am
++++ b/pam/Makefile.am
+@@ -8,7 +8,7 @@ pam_thinkfinger_so_SOURCES = pam_thinkfinger-compat.c pam_thinkfinger-compat.h p
+ else
+ pam_thinkfinger_so_SOURCES = pam_thinkfinger-uinput.c pam_thinkfinger-uinput.h pam_thinkfinger.c
+ endif
+-pam_thinkfinger_so_LDFLAGS = -shared --strip-all -Wl,-soname,pam_thinkfinger.so -Wl,--as-needed
++pam_thinkfinger_so_LDFLAGS = -shared -Wl,-soname,pam_thinkfinger.so -Wl,--as-needed
+ pam_thinkfinger_so_CFLAGS = $(CFLAGS)
+ pam_thinkfinger_so_LDADD = $(top_builddir)/libthinkfinger/libthinkfinger.la $(PAM_LIBS) $(PTHREAD_LIBS)
+
+--- a/pam/Makefile.in
++++ b/pam/Makefile.in
+@@ -201,7 +201,7 @@ pamdir = $(SECUREDIR)
+ INCLUDES = -I$(top_srcdir)/libthinkfinger
+ @HAVE_OLD_PAM_FALSE@pam_thinkfinger_so_SOURCES = pam_thinkfinger-uinput.c pam_thinkfinger-uinput.h pam_thinkfinger.c
+ @HAVE_OLD_PAM_TRUE@pam_thinkfinger_so_SOURCES = pam_thinkfinger-compat.c pam_thinkfinger-compat.h pam_thinkfinger-uinput.c pam_thinkfinger-uinput.h pam_thinkfinger.c
+-pam_thinkfinger_so_LDFLAGS = -shared --strip-all -Wl,-soname,pam_thinkfinger.so -Wl,--as-needed
++pam_thinkfinger_so_LDFLAGS = -shared -Wl,-soname,pam_thinkfinger.so -Wl,--as-needed
+ pam_thinkfinger_so_CFLAGS = $(CFLAGS)
+ pam_thinkfinger_so_LDADD = $(top_builddir)/libthinkfinger/libthinkfinger.la $(PAM_LIBS) $(PTHREAD_LIBS)
+ all: all-am
diff --git a/sys-auth/thinkfinger/files/0.3-tftoolgroup.patch b/sys-auth/thinkfinger/files/0.3-tftoolgroup.patch
new file mode 100644
index 000000000000..169b7cefe286
--- /dev/null
+++ b/sys-auth/thinkfinger/files/0.3-tftoolgroup.patch
@@ -0,0 +1,64 @@
+--- tf-tool/tf-tool.c 2007-03-30 11:00:45.000000000 +0200
++++ tf-tool/tf-tool.c 2009-02-18 14:57:24.316197097 +0100
+@@ -26,6 +26,9 @@
+ #include <errno.h>
+ #include <libgen.h>
+ #include <pwd.h>
++#include <grp.h>
++#include <sys/stat.h>
++#include <unistd.h>
+
+ #include <config.h>
+ #include <libthinkfinger.h>
+@@ -54,6 +57,21 @@
+ int swipe_failed;
+ } s_tfdata;
+
++int changegroup(const char *groupname,const char *filename)
++{
++ struct group *g;
++ g = getgrnam(groupname);
++ if(g == NULL) {
++ perror("getgrnam:");
++ return 1;
++ }
++ if( chown(filename,-1,g->gr_gid) == -1) {
++ perror("chown: ");
++ return 1;
++ }
++ return 0;
++}
++
+ static void print_status (int swipe_success, int swiped_required, int swipe_failed)
+ {
+ printf ("\rPlease swipe your finger (successful swipes %i/%i, failed swipes: %i)...",
+@@ -64,6 +82,8 @@
+ static void callback (libthinkfinger_state state, void *data)
+ {
+ char *str;
++ int err;
++ gid_t gfp;
+ s_tfdata *tfdata = (s_tfdata *) data;
+
+ if (tfdata->verbose == true) {
+@@ -108,8 +128,18 @@
+ case TF_STATE_ENROLL_SUCCESS:
+ print_status (tfdata->swipe_success, 3, tfdata->swipe_failed);
+ printf (" done.\nStoring data (%s)...", tfdata->bir);
+- fflush (stdout);
+- break;
++ /*small hack to change group and chmod 640 on created bir file*/
++ err = chmod(tfdata->bir, S_IRUSR | S_IWUSR | S_IRGRP);
++ if(err == -1) {
++ printf("Couldn't change perms on file %s\n",tfdata->bir);
++ perror("chmod:");
++ fflush(stdout);
++ break;
++ }
++ changegroup("fingerprint",tfdata->bir);
++ fflush(stdout);
++ break;
++ /*done*/
+ case TF_STATE_SWIPE_FAILED:
+ print_status (tfdata->swipe_success, 3, ++tfdata->swipe_failed);
+ break;
diff --git a/sys-auth/thinkfinger/files/60-thinkfinger.rules b/sys-auth/thinkfinger/files/60-thinkfinger.rules
new file mode 100644
index 000000000000..1ccc394d49ff
--- /dev/null
+++ b/sys-auth/thinkfinger/files/60-thinkfinger.rules
@@ -0,0 +1,5 @@
+# SGS Thomson Microelectronics Fingerprint Reader
+ATTRS{idVendor}=="0483", ATTRS{idProduct}=="2016", SYMLINK+="input/thinkfinger-%k", MODE="0660", GROUP="fingerprint"
+
+# the also-needed uinput device
+KERNEL=="uinput", MODE="0660", GROUP="fingerprint"
diff --git a/sys-auth/thinkfinger/metadata.xml b/sys-auth/thinkfinger/metadata.xml
new file mode 100644
index 000000000000..b61739fdd921
--- /dev/null
+++ b/sys-auth/thinkfinger/metadata.xml
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>victor.quicksilver@gmail.com</email>
+ <name>Víctor Enríquez Miguel</name>
+</maintainer>
+<maintainer type="person">
+ <email>xmw@gentoo.org</email>
+ <name>Michael Weber</name>
+ <description>Proxy Maintainer</description>
+</maintainer>
+<maintainer type="project">
+ <email>proxy-maint@gentoo.org</email>
+ <name>Proxy Maintainers</name>
+</maintainer>
+<upstream>
+ <remote-id type="sourceforge">ThinkFinger</remote-id>
+</upstream>
+</pkgmetadata>
diff --git a/sys-auth/thinkfinger/thinkfinger-0.3-r3.ebuild b/sys-auth/thinkfinger/thinkfinger-0.3-r3.ebuild
new file mode 100644
index 000000000000..ce297a26fdbe
--- /dev/null
+++ b/sys-auth/thinkfinger/thinkfinger-0.3-r3.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit autotools-utils user linux-info pam
+
+DESCRIPTION="Support for the UPEK/SGS Thomson Microelectronics fingerprint reader, often seen in Thinkpads"
+HOMEPAGE="http://thinkfinger.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug pam static-libs"
+
+RDEPEND="virtual/libusb:0
+ pam? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ sys-devel/libtool
+ virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PV}-direct_set_config_usb_hello.patch
+ "${FILESDIR}"/${PV}-carriagereturn.patch
+ "${FILESDIR}"/${PV}-send-sync-event.patch
+ "${FILESDIR}"/${PV}-tftoolgroup.patch
+ "${FILESDIR}"/${PV}-strip-strip.patch
+)
+
+pkg_setup() {
+ if use pam ; then
+ CONFIG_CHECK="~INPUT_UINPUT"
+ ERROR_CFG="Your kernel needs uinput for the pam module to work"
+ check_extra_config
+ fi
+}
+
+src_configure() {
+ local myeconfargs=(
+ $(use_enable pam) \
+ $(use_enable debug usb-debug) \
+ "--with-securedir=$(getpam_mod_dir)"
+ )
+ autotools-utils_src_configure
+}
+
+src_install() {
+ DOCS=( AUTHORS ChangeLog NEWS README )
+ autotools-utils_src_install
+
+ keepdir /etc/pam_thinkfinger
+ insinto /lib/udev/rules.d
+ doins "${FILESDIR}"/60-thinkfinger.rules
+}
+
+pkg_preinst() {
+ enewgroup fingerprint
+}
+
+pkg_postinst() {
+ fowners root:fingerprint /etc/pam_thinkfinger
+ fperms 710 /etc/pam_thinkfinger
+ elog "Use tf-tool --acquire to take a finger print"
+ elog "tf-tool will write the finger print file to /tmp/test.bir"
+ elog ""
+ if use pam ; then
+ elog "To add a fingerprint to PAM, use tf-tool --add-user USERNAME"
+ elog ""
+ elog "Add the following to /etc/pam.d/system-auth after pam_env.so"
+ elog "auth sufficient pam_thinkfinger.so"
+ elog ""
+ elog "Your system-auth should look similar to:"
+ elog "auth required pam_env.so"
+ elog "auth sufficient pam_thinkfinger.so"
+ elog "auth sufficient pam_unix.so try_first_pass likeauth nullok"
+ elog ""
+ fi
+}