From 4d2a8f5f8a107eb8e692f7e697e165a4795807e7 Mon Sep 17 00:00:00 2001 From: Diego Elio Pettenò Date: Mon, 28 Sep 2009 18:29:36 +0000 Subject: Bump already, add init script for the userland USB daemon, and move the two daemon executables in /usr/libexec. (Portage version: 2.2_rc42/cvs/Linux x86_64) --- app-crypt/ekeyd/ChangeLog | 10 ++- app-crypt/ekeyd/ekeyd-1.0.5-r1.ebuild | 122 +++++++++++++++++++++++++++++++++ app-crypt/ekeyd/ekeyd-1.0.5.ebuild | 113 ------------------------------ app-crypt/ekeyd/files/ekey-ulusbd.conf | 16 +++++ app-crypt/ekeyd/files/ekey-ulusbd.init | 43 ++++++++++++ app-crypt/ekeyd/files/ekeyd.init | 8 +-- 6 files changed, 194 insertions(+), 118 deletions(-) create mode 100644 app-crypt/ekeyd/ekeyd-1.0.5-r1.ebuild delete mode 100644 app-crypt/ekeyd/ekeyd-1.0.5.ebuild create mode 100644 app-crypt/ekeyd/files/ekey-ulusbd.conf create mode 100644 app-crypt/ekeyd/files/ekey-ulusbd.init (limited to 'app-crypt/ekeyd') diff --git a/app-crypt/ekeyd/ChangeLog b/app-crypt/ekeyd/ChangeLog index 1d66fcf93138..6e4c380d37ac 100644 --- a/app-crypt/ekeyd/ChangeLog +++ b/app-crypt/ekeyd/ChangeLog @@ -1,6 +1,14 @@ # 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.1 2009/09/28 10:59:06 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/ChangeLog,v 1.2 2009/09/28 18:29:35 flameeyes Exp $ + +*ekeyd-1.0.5-r1 (28 Sep 2009) + + 28 Sep 2009; Diego E. Pettenò -ekeyd-1.0.5.ebuild, + +ekeyd-1.0.5-r1.ebuild, +files/ekey-ulusbd.conf, +files/ekey-ulusbd.init, + files/ekeyd.init: + Bump already, add init script for the userland USB daemon, and move the + two daemon executables in /usr/libexec. *ekeyd-1.0.5 (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 new file mode 100644 index 000000000000..dee57d21b439 --- /dev/null +++ b/app-crypt/ekeyd/ekeyd-1.0.5-r1.ebuild @@ -0,0 +1,122 @@ +# 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.ebuild b/app-crypt/ekeyd/ekeyd-1.0.5.ebuild deleted file mode 100644 index 0fff9c327b1a..000000000000 --- a/app-crypt/ekeyd/ekeyd-1.0.5.ebuild +++ /dev/null @@ -1,113 +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.ebuild,v 1.1 2009/09/28 10:59:06 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" - -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}" \ - install || die "emake install failed" - - # Install them manually because we don't want them gzipped - doman daemon/{ekeyd,ekey-setkey,ekey-rekey,ekeydctl}.8 \ - daemon/ekeyd.conf.5 || die - - if use usb; then - 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 - - keepdir /etc/ekeyd - - newinitd "${FILESDIR}"/${PN}.init ${PN} || die -} - -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 "TODO TODO TODO TODO TODO" - elog "" - elog "Please note that while the userland USB daemon is being built" - elog "there currently is no init script to start it; this will be fixed" - elog "as soon as possible." - elog "" - elog "TODO TODO TODO TODO TODO" - fi -} diff --git a/app-crypt/ekeyd/files/ekey-ulusbd.conf b/app-crypt/ekeyd/files/ekey-ulusbd.conf new file mode 100644 index 000000000000..80bf0c1aec13 --- /dev/null +++ b/app-crypt/ekeyd/files/ekey-ulusbd.conf @@ -0,0 +1,16 @@ +# 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 $ + +# The userland USB daemon has to know the USB path of the EntopyKey to +# work properly; in alternative to providing these statically, they +# can be found by giving the serial of the key. +# +# The serial will also be used to set the default path to open the +# socket to. + +EKEY_SERIAL="" +#USB_BUS="" +#USB_DEV="" + +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 new file mode 100644 index 000000000000..f1ee32bcc54a --- /dev/null +++ b/app-crypt/ekeyd/files/ekey-ulusbd.init @@ -0,0 +1,43 @@ +#!/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 $ + +INSTANCE="${SVCNAME#*.}" +if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "ekey-ulusbd" ]; then + INSTANCE="ekey-ulusbd" +fi + +depend() { + use udev +} + +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) + fi + + ebegin "Starting EntropyKey Userland USB Daemon" + start-stop-daemon \ + --start --pidfile "/var/run/${SVCNAME}.pid" \ + --exec /usr/libexec/ekey-ulusbd -- \ + -P "/var/run/${SVCNAME}.pid" \ + -p "${SOCKET_PATH}" \ + -b $(printf %03d ${USB_BUS}) -d $(printf %03d ${USB_DEV}) -D + eend $? +} + +stop() { + ebegin "Stopping EntropyKey daemon" + start-stop-daemon \ + --stop --pidfile "/var/run/${SVCNAME}.pid" \ + --exec /usr/libexec/ekey-ulusbd + eend $? +} diff --git a/app-crypt/ekeyd/files/ekeyd.init b/app-crypt/ekeyd/files/ekeyd.init index 89dab724a46c..5bdfdf17a0c9 100644 --- a/app-crypt/ekeyd/files/ekeyd.init +++ b/app-crypt/ekeyd/files/ekeyd.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/ekeyd.init,v 1.1 2009/09/28 10:59:07 flameeyes Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/files/ekeyd.init,v 1.2 2009/09/28 18:29:36 flameeyes Exp $ INSTANCE="${SVCNAME#*.}" if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "ekeyd" ]; then @@ -9,14 +9,14 @@ if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "ekeyd" ]; then fi depend() { - use udev + use udev ekey-ulusbd } start() { ebegin "Starting EntropyKey daemon" start-stop-daemon \ --start --pidfile "/var/run/${SVCNAME}.pid" \ - --exec /usr/sbin/ekeyd -- \ + --exec /usr/libexec/ekeyd -- \ -f "/etc/entropykey/${INSTANCE}.conf" \ -p "/var/run/${SVCNAME}.pid" eend $? @@ -26,7 +26,7 @@ stop() { ebegin "Stopping EntropyKey daemon" start-stop-daemon \ --stop --pidfile "/var/run/${SVCNAME}.pid" \ - --exec /usr/sbin/ekeyd + --exec /usr/libexec/ekeyd eend $? } -- cgit v1.2.3-65-gdbad