From bcd4f1687976da18343f6c66e971c555971fe342 Mon Sep 17 00:00:00 2001 From: Diego Elio Pettenò Date: Tue, 29 Sep 2009 12:03:21 +0000 Subject: New revision, thanks to the comments from Rob Kendrick (upstream); the init script now uses lsusb, and is only installed for non-Linux systems, while the correct udev rules are installed on Linux. Add a check for the CDC driver, and also add warnings about both the userland USB and CDC options. (Portage version: 2.2_rc42/cvs/Linux x86_64) --- app-crypt/ekeyd/ChangeLog | 13 ++- app-crypt/ekeyd/ekeyd-1.0.5-r1.ebuild | 122 -------------------------- app-crypt/ekeyd/ekeyd-1.0.5-r2.ebuild | 154 +++++++++++++++++++++++++++++++++ app-crypt/ekeyd/files/ekey-ulusbd.conf | 4 +- app-crypt/ekeyd/files/ekey-ulusbd.init | 17 ++-- 5 files changed, 176 insertions(+), 134 deletions(-) delete mode 100644 app-crypt/ekeyd/ekeyd-1.0.5-r1.ebuild create mode 100644 app-crypt/ekeyd/ekeyd-1.0.5-r2.ebuild (limited to 'app-crypt/ekeyd') diff --git a/app-crypt/ekeyd/ChangeLog b/app-crypt/ekeyd/ChangeLog index 6e4c380d37ac..97d368d117bd 100644 --- a/app-crypt/ekeyd/ChangeLog +++ b/app-crypt/ekeyd/ChangeLog @@ -1,6 +1,17 @@ # ChangeLog for app-crypt/ekeyd # Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/ChangeLog,v 1.2 2009/09/28 18:29:35 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/ChangeLog,v 1.3 2009/09/29 12:03:20 flameeyes Exp $ + +*ekeyd-1.0.5-r2 (29 Sep 2009) + + 29 Sep 2009; Diego E. Pettenò + -ekeyd-1.0.5-r1.ebuild, +ekeyd-1.0.5-r2.ebuild, files/ekey-ulusbd.conf, + files/ekey-ulusbd.init: + New revision, thanks to the comments from Rob Kendrick (upstream); the + init script now uses lsusb, and is only installed for non-Linux systems, + while the correct udev rules are installed on Linux. Add a check for the + CDC driver, and also add warnings about both the userland USB and CDC + options. *ekeyd-1.0.5-r1 (28 Sep 2009) diff --git a/app-crypt/ekeyd/ekeyd-1.0.5-r1.ebuild b/app-crypt/ekeyd/ekeyd-1.0.5-r1.ebuild deleted file mode 100644 index dee57d21b439..000000000000 --- a/app-crypt/ekeyd/ekeyd-1.0.5-r1.ebuild +++ /dev/null @@ -1,122 +0,0 @@ -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/ekeyd-1.0.5-r1.ebuild,v 1.1 2009/09/28 18:29:35 flameeyes Exp $ - -EAPI=2 - -inherit multilib - -DESCRIPTION="Entropy Key userspace daemon" -HOMEPAGE="http://www.entropykey.co.uk/" -SRC_URI="http://www.entropykey.co.uk/res/download/${P}.tar.gz" - -LICENSE="as-is" # yes, truly - -SLOT="0" - -KEYWORDS="~amd64 ~x86" - -IUSE="usb kernel_linux" - -RDEPEND="dev-lang/lua - usb? ( dev-libs/libusb:0 )" -DEPEND="${RDEPEND}" -RDEPEND="${RDEPEND} - dev-libs/luasocket - kernel_linux? ( sys-fs/udev )" - -src_prepare() { - # - avoid using -Werror; - # - don't gzip the man pages, this will also stop it from - # installing them, so we'll do it by hand. - sed -i \ - -e 's:-Werror::' \ - -e '/gzip/d' \ - daemon/Makefile || die -} - -src_compile() { - local osname - - # Override automatic detection: upstream provides this with uname, - # we don't like using uname. - case ${CHOST} in - *-linux-*) - osname=linux;; - *-freebsd*) - osname=freebsd;; - *-kfrebsd-gnu) - osname=gnukfreebsd;; - *-openbsd*) - osname=openbsd;; - *) - die "Unsupported operating system!" - ;; - esac - - # We don't slot LUA so we don't really need to have the variables - # set at all. - emake -C daemon \ - LUA_V= LUA_INC= \ - OSNAME=${osname} \ - OPT="${CFLAGS}" \ - BUILD_ULUSBD=$(use usb && echo yes || echo no) \ - || die "emake failed" -} - -src_install() { - emake -C daemon \ - DESTDIR="${D}" \ - BUILD_ULUSBD=$(use usb && echo yes || echo no) \ - install || die "emake install failed" - - # We move the daemons around to avoid polluting the available - # commands. - dodir /usr/libexec - mv "${D}"/usr/sbin/ekey*d "${D}"/usr/libexec - - keepdir /etc/ekeyd - - # Install them manually because we don't want them gzipped - doman daemon/{ekeyd,ekey-setkey,ekey-rekey,ekeydctl}.8 \ - daemon/ekeyd.conf.5 || die - - newinitd "${FILESDIR}"/${PN}.init ${PN} || die - - if use usb; then - newinitd "${FILESDIR}"/ekey-ulusbd.init ekey-ulusbd || die - newconfd "${FILESDIR}"/ekey-ulusbd.conf ekey-ulusbd || die - doman daemon/ekey-ulusbd.8 || die - fi - - dodoc daemon/README* AUTHORS WARNING || die - - if use kernel_linux; then - insinto /etc/udev/rules.d - newins doc/60-UDEKEY01.rules 70-${PN}.rules || die - - exeinto /$(get_libdir)/udev - doexe doc/ekeyd-udev || die - fi -} - -pkg_postinst() { - elog "To make use of your entropykey, make sure to execute ekey-rekey" - elog "the first time, and then start the ekeyd service." - elog "" - elog "The service supports multiplexing if you wish to use multiple" - elog "keys, just symlink /etc/init.d/ekeyd → /etc/init.d/ekeyd.identifier" - elog "and it'll be looking for /etc/init.d/identifier.conf" - - if use usb; then - elog "" - elog "If you don't want (or can't) use the CDC ACM driver in your" - elog "kernel, you may use the Userland USB Daemon to access the" - elog "EntropyKey." - elog "" - elog "To do so, make sure to start the ekey-ulusbd service, after" - elog "having configured /etc/conf.d/ekey-ulusbd." - elog "This service is also multiplexed so you can run it for any" - elog "number of keys." - fi -} diff --git a/app-crypt/ekeyd/ekeyd-1.0.5-r2.ebuild b/app-crypt/ekeyd/ekeyd-1.0.5-r2.ebuild new file mode 100644 index 000000000000..49374e9cbfc4 --- /dev/null +++ b/app-crypt/ekeyd/ekeyd-1.0.5-r2.ebuild @@ -0,0 +1,154 @@ +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/ekeyd-1.0.5-r2.ebuild,v 1.1 2009/09/29 12:03:20 flameeyes Exp $ + +EAPI=2 + +inherit multilib linux-info + +DESCRIPTION="Entropy Key userspace daemon" +HOMEPAGE="http://www.entropykey.co.uk/" +SRC_URI="http://www.entropykey.co.uk/res/download/${P}.tar.gz" + +LICENSE="as-is" # yes, truly + +SLOT="0" + +KEYWORDS="~amd64 ~x86" + +IUSE="usb kernel_linux" + +RDEPEND="dev-lang/lua + usb? ( dev-libs/libusb:0 )" +DEPEND="${RDEPEND}" +RDEPEND="${RDEPEND} + dev-libs/luasocket + kernel_linux? ( sys-fs/udev ) + usb? ( !kernel_linux? ( sys-apps/usbutils ) )" + +CONFIG_CHECK="USB_ACM" + +pkg_setup() { + if use kernel_linux && ! use usb && linux_config_exists; then + check_extra_config + fi +} + +src_prepare() { + # - avoid using -Werror; + # - don't gzip the man pages, this will also stop it from + # installing them, so we'll do it by hand. + sed -i \ + -e 's:-Werror::' \ + -e '/gzip/d' \ + daemon/Makefile || die + + # We moved the binaries around + sed -i -e 's:$BINPATH/ekey-ulusbd:/usr/libexec/ekey-ulusbd:' \ + doc/ekeyd-udev || die +} + +src_compile() { + local osname + + # Override automatic detection: upstream provides this with uname, + # we don't like using uname. + case ${CHOST} in + *-linux-*) + osname=linux;; + *-freebsd*) + osname=freebsd;; + *-kfrebsd-gnu) + osname=gnukfreebsd;; + *-openbsd*) + osname=openbsd;; + *) + die "Unsupported operating system!" + ;; + esac + + # We don't slot LUA so we don't really need to have the variables + # set at all. + emake -C daemon \ + LUA_V= LUA_INC= \ + OSNAME=${osname} \ + OPT="${CFLAGS}" \ + BUILD_ULUSBD=$(use usb && echo yes || echo no) \ + || die "emake failed" +} + +src_install() { + emake -C daemon \ + DESTDIR="${D}" \ + BUILD_ULUSBD=$(use usb && echo yes || echo no) \ + install || die "emake install failed" + + # We move the daemons around to avoid polluting the available + # commands. + dodir /usr/libexec + mv "${D}"/usr/sbin/ekey*d "${D}"/usr/libexec + + keepdir /etc/ekeyd + + # Install them manually because we don't want them gzipped + doman daemon/{ekeyd,ekey-setkey,ekey-rekey,ekeydctl}.8 \ + daemon/ekeyd.conf.5 || die + + newinitd "${FILESDIR}"/${PN}.init ${PN} || die + + if use usb; then + if ! use kernel_linux; then + newinitd "${FILESDIR}"/ekey-ulusbd.init ekey-ulusbd || die + newconfd "${FILESDIR}"/ekey-ulusbd.conf ekey-ulusbd || die + fi + doman daemon/ekey-ulusbd.8 || die + fi + + dodoc daemon/README* AUTHORS WARNING || die + + if use kernel_linux; then + insinto /etc/udev/rules.d + if use usb; then + newins doc/60-UDEKEY01-UDS.rules 70-ekey-ulusbd.rules || die + else + newins doc/60-UDEKEY01.rules 70-${PN}.rules || die + fi + + exeinto /$(get_libdir)/udev + doexe doc/ekeyd-udev || die + fi +} + +pkg_postinst() { + elog "To make use of your entropykey, make sure to execute ekey-rekey" + elog "the first time, and then start the ekeyd service." + elog "" + elog "The service supports multiplexing if you wish to use multiple" + elog "keys, just symlink /etc/init.d/ekeyd → /etc/init.d/ekeyd.identifier" + elog "and it'll be looking for /etc/init.d/identifier.conf" + elog "" + + if use usb; then + if use kernel_linux; then + elog "You're going to use the userland USB daemon, the udev rules" + elog "will be used accordingly. If you want to use the CDC driver" + elog "please disable the usb USE flag." + else + elog "You're going to use the userland USB daemon, since your OS" + elog "does not support udev, you should start the ekey-ulusbd" + elog "service before ekeyd." + fi + else + if use kernel_linux; then + elog "Some versions of Linux have a faulty CDC ACM driver that stops" + elog "EntropyKey from working properly; please check the compatibility" + elog "table at http://www.entropykey.co.uk/download/" + else + elog "Make sure your operating system supports the CDC ACM driver" + elog "or otherwise you won't be able to use the EntropyKey." + fi + elog "" + elog "If you're unsure about the working state of the CDC ACM driver" + elog "enable the usb USE flag and use the userland USB daemon" + fi +} diff --git a/app-crypt/ekeyd/files/ekey-ulusbd.conf b/app-crypt/ekeyd/files/ekey-ulusbd.conf index 80bf0c1aec13..1a6100854df8 100644 --- a/app-crypt/ekeyd/files/ekey-ulusbd.conf +++ b/app-crypt/ekeyd/files/ekey-ulusbd.conf @@ -1,6 +1,6 @@ # Copyright 2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/files/ekey-ulusbd.conf,v 1.1 2009/09/28 18:29:36 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/files/ekey-ulusbd.conf,v 1.2 2009/09/29 12:03:21 flameeyes Exp $ # The userland USB daemon has to know the USB path of the EntopyKey to # work properly; in alternative to providing these statically, they @@ -13,4 +13,4 @@ EKEY_SERIAL="" #USB_BUS="" #USB_DEV="" -SOCKET_PATH="/var/run/ekey.ulusbd.${EKEY_SERIAL}" +SOCKET_PATH="/var/run/ekey-ulusbd-${EKEY_SERIAL}" diff --git a/app-crypt/ekeyd/files/ekey-ulusbd.init b/app-crypt/ekeyd/files/ekey-ulusbd.init index f1ee32bcc54a..8a955c5ecec5 100644 --- a/app-crypt/ekeyd/files/ekey-ulusbd.init +++ b/app-crypt/ekeyd/files/ekey-ulusbd.init @@ -1,7 +1,7 @@ #!/sbin/runscript # Copyright 2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/files/ekey-ulusbd.init,v 1.1 2009/09/28 18:29:36 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/files/ekey-ulusbd.init,v 1.2 2009/09/29 12:03:21 flameeyes Exp $ INSTANCE="${SVCNAME#*.}" if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "ekey-ulusbd" ]; then @@ -14,14 +14,13 @@ depend() { start() { if [ -z ${USB_BUS} ]; then - local devdir=$(fgrep -l 20df /sys/bus/usb/devices/*/idVendor \ - | xargs -n1 dirname \ - | xargs -I{} fgrep -l 0001 {}/idProduct \ - | xargs -n1 dirname \ - | xargs -I{} fgrep -l ${EKEY_SERIAL} {}/serial \ - | xargs -n1 dirname) - USB_BUS=$(< ${devdir}/busnum) - USB_DEV=$(< ${devdir}/devnum) + set -- $(lsusb -v -d 20df:0001 | \ + egrep '(^Bus|iSerial)' | \ + grep -B1 "${EKEY_SERIAL}" | \ + head -n 1 | \ + cut -c 5-7,15-18) + USB_BUS=$1 + USB_DEV=$2 fi ebegin "Starting EntropyKey Userland USB Daemon" -- cgit v1.2.3-65-gdbad