summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gentoo.org>2009-09-28 10:59:07 +0000
committerDiego Elio Pettenò <flameeyes@gentoo.org>2009-09-28 10:59:07 +0000
commit19e45254d93be3bae4e5c656e724d98c959f01ad (patch)
treeb3577a00e8714d5291829a522511625d1806e2dc /app-crypt/ekeyd
parentInitial import of luasocket (needed for ekeyd); thanks to Pierre Guinoiseau i... (diff)
downloadgentoo-2-19e45254d93be3bae4e5c656e724d98c959f01ad.tar.gz
gentoo-2-19e45254d93be3bae4e5c656e724d98c959f01ad.tar.bz2
gentoo-2-19e45254d93be3bae4e5c656e724d98c959f01ad.zip
Initial import of the EntropyKey daemon; this is still a work-in-progress ebuild, as it lacks an init script for the USB userland driver, and checks for Linux kernel options for CDC modem support.
(Portage version: 2.2_rc42/cvs/Linux x86_64)
Diffstat (limited to 'app-crypt/ekeyd')
-rw-r--r--app-crypt/ekeyd/ChangeLog12
-rw-r--r--app-crypt/ekeyd/ekeyd-1.0.5.ebuild113
-rw-r--r--app-crypt/ekeyd/files/ekeyd.init32
-rw-r--r--app-crypt/ekeyd/metadata.xml14
4 files changed, 171 insertions, 0 deletions
diff --git a/app-crypt/ekeyd/ChangeLog b/app-crypt/ekeyd/ChangeLog
new file mode 100644
index 000000000000..1d66fcf93138
--- /dev/null
+++ b/app-crypt/ekeyd/ChangeLog
@@ -0,0 +1,12 @@
+# 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 $
+
+*ekeyd-1.0.5 (28 Sep 2009)
+
+ 28 Sep 2009; Diego E. Pettenò <flameeyes@gentoo.org> +ekeyd-1.0.5.ebuild,
+ +files/ekeyd.init, +metadata.xml:
+ Initial import of the EntropyKey daemon; this is still a work-in-progress
+ ebuild, as it lacks an init script for the USB userland driver, and checks
+ for Linux kernel options for CDC modem support.
+
diff --git a/app-crypt/ekeyd/ekeyd-1.0.5.ebuild b/app-crypt/ekeyd/ekeyd-1.0.5.ebuild
new file mode 100644
index 000000000000..0fff9c327b1a
--- /dev/null
+++ b/app-crypt/ekeyd/ekeyd-1.0.5.ebuild
@@ -0,0 +1,113 @@
+# 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/ekeyd.init b/app-crypt/ekeyd/files/ekeyd.init
new file mode 100644
index 000000000000..89dab724a46c
--- /dev/null
+++ b/app-crypt/ekeyd/files/ekeyd.init
@@ -0,0 +1,32 @@
+#!/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 $
+
+INSTANCE="${SVCNAME#*.}"
+if [ -z "${INSTANCE}" ] || [ "${SVCNAME}" = "ekeyd" ]; then
+ INSTANCE="ekeyd"
+fi
+
+depend() {
+ use udev
+}
+
+start() {
+ ebegin "Starting EntropyKey daemon"
+ start-stop-daemon \
+ --start --pidfile "/var/run/${SVCNAME}.pid" \
+ --exec /usr/sbin/ekeyd -- \
+ -f "/etc/entropykey/${INSTANCE}.conf" \
+ -p "/var/run/${SVCNAME}.pid"
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping EntropyKey daemon"
+ start-stop-daemon \
+ --stop --pidfile "/var/run/${SVCNAME}.pid" \
+ --exec /usr/sbin/ekeyd
+ eend $?
+}
+
diff --git a/app-crypt/ekeyd/metadata.xml b/app-crypt/ekeyd/metadata.xml
new file mode 100644
index 000000000000..85ddda26dec9
--- /dev/null
+++ b/app-crypt/ekeyd/metadata.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>no-herd</herd>
+ <maintainer>
+ <email>flameeyes@gentoo.org</email>
+ </maintainer>
+ <use>
+ <flag name='usb'>
+ Build the libusb-based userland daemon for accessing the
+ entropykey (alternative to the CDC USB driver).
+ </flag>
+ </use>
+</pkgmetadata>