Bump to version 1.1.4; the patches have been collapsed into one, big gentoo patch...
authorDiego Elio Pettenò <flameeyes@gentoo.org>
Mon, 5 Sep 2011 20:10:09 +0000 (20:10 +0000)
committerDiego Elio Pettenò <flameeyes@gentoo.org>
Mon, 5 Sep 2011 20:10:09 +0000 (20:10 +0000)
Package-Manager: portage-2.2.0_alpha53/cvs/Linux x86_64

app-crypt/ekeyd/ChangeLog
app-crypt/ekeyd/Manifest
app-crypt/ekeyd/ekeyd-1.1.4.ebuild [new file with mode: 0644]
app-crypt/ekeyd/files/ekeyd-1.1.4-gentoo.patch [new file with mode: 0644]

index f625daaf914dc283f923c46595f7a06ff1eafd48..1c0d7be8a5edf7b9c337357245085e74cc45d47a 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for app-crypt/ekeyd
 # Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/ChangeLog,v 1.23 2011/04/08 11:14:49 flameeyes Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/ChangeLog,v 1.24 2011/09/05 20:10:09 flameeyes Exp $
+
+*ekeyd-1.1.4 (05 Sep 2011)
+
+  05 Sep 2011; Diego E. Pettenò <flameeyes@gentoo.org> +ekeyd-1.1.4.ebuild,
+  +files/ekeyd-1.1.4-gentoo.patch:
+  Bump to version 1.1.4; the patches have been collapsed into one, big gentoo
+  patch for now.
 
   08 Apr 2011; Diego E. Pettenò <flameeyes@gentoo.org> ekeyd-1.1.3-r4.ebuild:
   Fix DEPEND value.
index 5d90a05ff4dc418e7feacd145c0ee2423555800b..089edeafbbf25e6fcaf70c3d963049572c85b754 100644 (file)
@@ -9,15 +9,18 @@ AUX ekeyd-1.1.1-earlyboot.patch 1526 RMD160 66512d44326f6b4ccb3971dd83a5888dc817
 AUX ekeyd-1.1.3-format.patch 936 RMD160 7892a5922e0d567bf44f317def74f6105f51a2f5 SHA1 502563468f2cc0cc69e5de4c4cce39ac38f15e9d SHA256 7f72253b8b62a4db87945349441a661d7edbacfdae1cc9777ded62bb8782e106
 AUX ekeyd-1.1.3-libusb_compat.patch 658 RMD160 356e27996ac6efbda56002d2dabaae9fce234e95 SHA1 e035db0258b7162a1ed7a69a343628a92c4a78a8 SHA256 5b82fe0d834ccfe674fdee2582a9097e4f0bea5b766e0c287808c7f4b3bc77e2
 AUX ekeyd-1.1.3-slashes.patch 1820 RMD160 4ed9ac60240fae3d9cd1c5f06f372fa7808a704b SHA1 fc12e503bb70ca88d7e7a6a6ad423a95a114d6a1 SHA256 170dd74ef68b470e7a7082a7f5ec6356563daff7167e89413710940ae3a5952b
+AUX ekeyd-1.1.4-gentoo.patch 6264 RMD160 849f75357760cb965b865e06becbccdc2add0298 SHA1 70761c8f3edd0057a5537f6c4b449501b57e0311 SHA256 d9232e67977c3d80858ce81f44dd36f8d26d9622ca194e71bf927863aa419e58
 AUX ekeyd.init 1080 RMD160 3798f08e4a086effca39cc023d01c4fbe8c89677 SHA1 74143026afd4730b8b190d2a9d0ce8be80ac8adf SHA256 76b42c721a5315d81392531bc428a4351539ca6682a9336b110c7bc148a31780
 DIST ekeyd-1.1.3.tar.gz 95173 RMD160 0af970891d8da67b5b0737fbac9d626a38ccb41a SHA1 a0119105d3804b76df0dd6a5e18e80db3193ece8 SHA256 07c20450e7ab139b723945e3aa0748f55209c0da097253b25074149c847044e4
+DIST ekeyd-1.1.4.tar.gz 100911 RMD160 1b25b8c19271ade48ded95178bcb50fd0ed9c763 SHA1 b6281f04980de0d78e2b5b59cd3ee193802f76d3 SHA256 147ca4ff964ab7b344a08d3cd6f9b1bf03ba18776a1941d603681d8102cce0c8
 EBUILD ekeyd-1.1.3-r4.ebuild 6384 RMD160 cbabdcf5f123f37f282d956d2970153d7b3b852d SHA1 2a98331ddb54948263101293b19f2297a3218e75 SHA256 d4161f870dce104ec3a7748ef8973b3dca6a0c12cc8bb466e4d26f88cd841f7c
-MISC ChangeLog 5993 RMD160 a2f1816fe5cb94aed126b0886329df8be389ca27 SHA1 50bd238cbe61e8f095d178dc436e539730fdef48 SHA256 309f8551fde6271800d67b092c84890524cb8d690e6c6aed6108ab4fa9b40966
+EBUILD ekeyd-1.1.4.ebuild 5658 RMD160 3cd38704c9554a18e6161bc6281ea290820dcd8c SHA1 8b38db0f92523b7b20acb493c0d7df7815163f58 SHA256 fded9f58d2e85e650089e73aefdaabb1a886cbd56d4afa3d78ed8c9e353ee2fa
+MISC ChangeLog 6229 RMD160 55d13b777b22b74b3b5d93a9bc38bc8400b3bcfb SHA1 e543fa0ebe46f295026dd3ad31887255763673da SHA256 c65b8725d2e2a8c0aaf59933b6da343a7ddb93890ae12da4b1ad868ae61edeb6
 MISC metadata.xml 884 RMD160 a62acfce69aab419d1b9c87af34776b07152a0ac SHA1 110778f2363f40b8b4779babc96565877c4ce74b SHA256 04925060b6ba63355650e0e049a7d75d8618fa8ea403ade8cbec6e687d4870ce
 -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.17 (GNU/Linux)
+Version: GnuPG v2.0.18 (GNU/Linux)
 
-iEYEARECAAYFAk2e7iwACgkQAiZjviIA2XhWygCfdrY6pyovdaBA6QiiptiF+eWC
-KfEAnRPj+mYUd85gWiqlObB5vOCiqJtS
-=03UU
+iEYEARECAAYFAk5lLIMACgkQAiZjviIA2XiibwCgvdVV0eChGffNZo2GbAdkwJp0
+wvwAn2cbkq+E2dQ9x0zuIBIk2d2R2YMs
+=5+R9
 -----END PGP SIGNATURE-----
diff --git a/app-crypt/ekeyd/ekeyd-1.1.4.ebuild b/app-crypt/ekeyd/ekeyd-1.1.4.ebuild
new file mode 100644 (file)
index 0000000..25ab303
--- /dev/null
@@ -0,0 +1,190 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-crypt/ekeyd/ekeyd-1.1.4.ebuild,v 1.1 2011/09/05 20:10:09 flameeyes Exp $
+
+EAPI=4
+
+inherit multilib linux-info toolchain-funcs
+
+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 munin minimal"
+
+EKEYD_RDEPEND="dev-lang/lua
+               usb? ( virtual/libusb:0 )"
+EKEYD_DEPEND="${EKEYD_RDEPEND}"
+EKEYD_RDEPEND="${EKEYD_RDEPEND}
+       dev-lua/luasocket
+       kernel_linux? ( >=sys-fs/udev-147 )
+       usb? ( !kernel_linux? ( sys-apps/usbutils ) )
+       munin? ( net-analyzer/munin )"
+
+RDEPEND="!minimal? ( ${EKEYD_RDEPEND} )
+       !app-crypt/ekey-egd-linux"
+DEPEND="!minimal? ( ${EKEYD_DEPEND} )"
+
+CONFIG_CHECK="~USB_ACM"
+
+REQUIRED_USE="minimal? ( !munin !usb )"
+
+pkg_setup() {
+       if ! use minimal && use kernel_linux && ! use usb && linux_config_exists; then
+               check_extra_config
+       fi
+}
+
+src_prepare() {
+       epatch "${FILESDIR}"/${P}-gentoo.patch
+}
+
+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 host \
+               CC="$(tc-getCC)" \
+               LUA_V= LUA_INC= \
+               OSNAME=${osname} \
+               OPT="${CFLAGS}" \
+               BUILD_ULUSBD=$(use usb && echo yes || echo no) \
+               $(use minimal && echo egd-linux)
+}
+
+src_install() {
+       exeinto /usr/libexec
+       newexe host/egd-linux   ekey-egd-linux
+       newman host/egd-linux.8 ekey-egd-linux.8
+
+       newconfd "${FILESDIR}"/ekey-egd-linux.conf ekey-egd-linux
+       newinitd "${FILESDIR}"/ekey-egd-linux.init ekey-egd-linux
+
+       dodoc doc/* AUTHORS ChangeLog THANKS
+
+       use minimal && return
+       # from here on, install everything that is not part of the minimal
+       # support.
+
+       emake -C host \
+               DESTDIR="${D}" \
+               MANZCMD=cat MANZEXT= \
+               install-ekeyd $(use usb && echo install-ekey-ulusbd)
+
+       # We move the daemons around to avoid polluting the available
+       # commands.
+       dodir /usr/libexec
+       mv "${D}"/usr/sbin/ekey*d "${D}"/usr/libexec
+
+       newinitd "${FILESDIR}"/${PN}.init ${PN}
+
+       if use usb && ! use kernel_linux; then
+               newinitd "${FILESDIR}"/ekey-ulusbd.init ekey-ulusbd
+               newconfd "${FILESDIR}"/ekey-ulusbd.conf ekey-ulusbd
+       fi
+
+       if use kernel_linux; then
+               local rules=udev/fedora15/60-entropykey.rules
+               use usb && rules=udev/fedora15/60-entropykey-uds.rules
+
+               insinto /lib/udev/rules.d
+               newins ${rules} 70-${PN}.rules
+
+               exeinto /lib/udev
+               doexe udev/entropykey.sh
+       fi
+
+       if use munin; then
+               exeinto /usr/libexec/munin/plugins
+               doexe munin/ekeyd_stat_
+
+               insinto /etc/munin/plugin-conf.d
+               newins munin/plugin-conf.d_ekeyd ekeyd
+       fi
+}
+
+pkg_postinst() {
+       elog "${CATEGORY}/${PN} now install also the EGD client service ekey-egd-linux."
+       elog "To use this service, you need enable EGDTCPSocket for the ekeyd service"
+       elog "managing the key(s)."
+       elog ""
+       elog "The daemon will send more entropy to the kernel once the available pool"
+       elog "falls below the value set in the kernel.random.write_wakeup_threshold"
+       elog "sysctl entry."
+       elog ""
+       elog "You can change the watermark in /etc/conf.d/ekey-egd-linux; if you do"
+       elog "it will require write access to the kernel's sysctl."
+
+       use minimal && return
+       # from here on, document everything that is not part of the minimal
+       # support.
+
+       elog ""
+       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 "By default ekeyd will feed the entropy directly to the kernel's pool;"
+       elog "if your system has jumps in load average, you might prefer using the"
+       elog "EGD compatibility mode, by enabling EGDTCPSocket for ekeyd and then"
+       elog "starting the ekey-egd-linux service."
+       elog ""
+       elog "The same applies if you intend to provide entropy for multiple hosts"
+       elog "over the network. If you want to have the ekey-egd-linux service on"
+       elog "other hosts, you can enable the 'minimal' USE flag."
+       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/entropykey/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
+
+               ewarn "The userland USB daemon has multiple known issues. If you can,"
+               ewarn "please consider disabling the 'usb' USE flag and instead use the"
+               ewarn "CDC-ACM access method."
+       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/ekeyd-1.1.4-gentoo.patch b/app-crypt/ekeyd/files/ekeyd-1.1.4-gentoo.patch
new file mode 100644 (file)
index 0000000..f5f9695
--- /dev/null
@@ -0,0 +1,129 @@
+Index: ekeyd-1.1.4/host/ekeyd.c
+===================================================================
+--- ekeyd-1.1.4.orig/host/ekeyd.c
++++ ekeyd-1.1.4/host/ekeyd.c
+@@ -209,7 +209,7 @@ open_foldback_output(void)
+     return (output_stream != NULL);
+ }
+-static const char *usage=
++static const char usage[]=
+     "Usage: %s [-f <configfile>] [-p <pidfile>] [-v] [-h]\n"
+     "Entropy Key Daemon\n\n"
+     "\t-f Read configuration from configfile\n"
+Index: ekeyd-1.1.4/host/ekey-setkey.c
+===================================================================
+--- ekeyd-1.1.4.orig/host/ekey-setkey.c
++++ ekeyd-1.1.4/host/ekey-setkey.c
+@@ -79,7 +79,7 @@ calc_mac(uint8_t *snum, uint8_t *mkey, u
+     return mac;
+ }
+-static const char *usage =
++static const char usage[] =
+     "Usage: %s [-d] [-h] [-n] [-f <keyring>] [-m <master>]\n"
+     "       [-s <serial>] <path>\n"
+     "Entropy key device long term session key tool\n\n"
+Index: ekeyd-1.1.4/host/ekey-ulusbd.c
+===================================================================
+--- ekeyd-1.1.4.orig/host/ekey-ulusbd.c
++++ ekeyd-1.1.4/host/ekey-ulusbd.c
+@@ -100,7 +100,8 @@ find_usb_device(char *busmatch, char *de
+ #if LIBUSB_HAS_DETACH_KERNEL_DRIVER_NP
+     if ((r = usb_detach_kernel_driver_np(devh, EKEY_IFACE)) != 0) {
+-        if (r != -ENODATA) {
++        /* libusb_compat-0.1.3 mistakenly translate ENODATA to ENOENT */
++        if (r != -ENODATA && r != -ENOENT) {
+             fprintf(stderr, 
+                     "Unable to detach Entropy Key at %s/%s from kernel\n", 
+                     busmatch, devmatch);
+Index: ekeyd-1.1.4/udev/entropykey.sh
+===================================================================
+--- ekeyd-1.1.4.orig/udev/entropykey.sh
++++ ekeyd-1.1.4/udev/entropykey.sh
+@@ -19,9 +19,9 @@ wait_for_usb () {
+     COUNTER=$(( ${COUNTER} + 1 ))
+     test ${COUNTER} -ge 10 && exit 1
+   done
+-  $BINPATH/ekey-ulusbd -b${BUSNUM} -d${DEVNUM} -P/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid -p/var/run/entropykeys/${ENTROPY_KEY_SERIAL} -D
++  /usr/libexec/ekey-ulusbd -b${BUSNUM} -d${DEVNUM} -P/dev/.ekey-ulusbd/${ENTROPY_KEY_SERIAL}.pid -p/dev/entropykey/${ENTROPY_KEY_SERIAL} -D
+   sleep 1
+-  $BINPATH/ekeydctl ${ACTION} /var/run/entropykeys/${ENTROPY_KEY_SERIAL}
++  $BINPATH/ekeydctl ${ACTION} /dev/entropykey/${ENTROPY_KEY_SERIAL}
+   exit 0
+ }
+@@ -34,18 +34,18 @@ else
+     if test "x${BUSNUM}" = "x" -o "x${DEVNUM}" = "x"; then
+       exit 0
+     fi
+-    if test -r "/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid"; then
+-      kill $(cat "/var/run/ekey-ulusbd-${ENTROPY_KEY_SERIAL}.pid") || true
++    if test -r "/dev/.ekey-ulusbd/${ENTROPY_KEY_SERIAL}.pid"; then
++      kill $(< "/dev/.ekey-ulusbd/${ENTROPY_KEY_SERIAL}.pid") || true
+     fi
+-    mkdir -p /var/run/entropykeys
++    mkdir -p /dev/entropykey /dev/.ekeyd-ulusb
+     wait_for_usb &
+     exit 0
+   fi
+   # Update ekeyd with device operation
+-  $BINPATH/ekeydctl ${ACTION} /var/run/entropykeys/${ENTROPY_KEY_SERIAL}
++  $BINPATH/ekeydctl ${ACTION} /dev/entropykey/${ENTROPY_KEY_SERIAL}
+   if test "x$ACTION" = "xremove"; then
+-    rm "/var/run/ekey-ulusbd-${ENTROPYKEY_KEY_SERIAL}.pid"
+-    rm "/var/run/entropykeys/${ENTROPYKEY_KEY_SERIAL}"
++    rm "/dev/.ekey-ulusbd/${ENTROPYKEY_KEY_SERIAL}.pid"
++    rm "/dev/entropykey/${ENTROPYKEY_KEY_SERIAL}"
+   fi
+ fi
+Index: ekeyd-1.1.4/udev/fedora15/60-entropykey.rules
+===================================================================
+--- ekeyd-1.1.4.orig/udev/fedora15/60-entropykey.rules
++++ ekeyd-1.1.4/udev/fedora15/60-entropykey.rules
+@@ -12,7 +12,7 @@
+ ACTION=="add|change|remove", SUBSYSTEM=="tty", KERNEL=="ttyACM[0-9]*", BUS=="usb", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="usb_id --export %p"
+ # Detect an Entropy Key being inserted and extract serial number
+-ACTION=="add|change|remove", SUBSYSTEM=="tty", KERNEL=="ttyACM[0-9]*", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="/bin/echo ENTROPY_KEY_SERIAL=$env{ID_SERIAL_SHORT}"
++ACTION=="add|change|remove", SUBSYSTEM=="tty", KERNEL=="ttyACM[0-9]*", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="/bin/sh -c '/bin/echo ENTROPY_KEY_SERIAL=$env{ID_SERIAL_SHORT} | /bin/sed -e s:/:_:g'"
+ # Add the /dev/entropykey/<serialnumber> symbolic link
+ ENV{ENTROPY_KEY_SERIAL}!="", SYMLINK+="entropykey/$env{ENTROPY_KEY_SERIAL}"
+Index: ekeyd-1.1.4/udev/fedora15/60-entropykey-uds.rules
+===================================================================
+--- ekeyd-1.1.4.orig/udev/fedora15/60-entropykey-uds.rules
++++ ekeyd-1.1.4/udev/fedora15/60-entropykey-uds.rules
+@@ -9,7 +9,7 @@
+ # For licence terms refer to the COPYING file.
+ # Detect an Entropy Key being inserted and extract serial number
+-ACTION=="add|change|remove", SUBSYSTEM=="usb", BUS=="usb", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="/bin/echo ENTROPY_KEY_SERIAL=$attr{serial}"
++ACTION=="add|change|remove", SUBSYSTEM=="usb", BUS=="usb", ATTRS{idVendor}=="20df", ATTRS{idProduct}=="0001", IMPORT{program}="/bin/sh -c '/bin/echo ENTROPY_KEY_SERIAL=$env{ID_SERIAL_SHORT} | /bin/sed -e s:/:_:g'"
+ # And tell the ekeyd about the device action.
+ ENV{ENTROPY_KEY_SERIAL}!="", RUN+="/lib/udev/entropykey.sh"
+Index: ekeyd-1.1.4/host/Makefile
+===================================================================
+--- ekeyd-1.1.4.orig/host/Makefile
++++ ekeyd-1.1.4/host/Makefile
+@@ -107,7 +107,7 @@ OPT ?= -O2
+ CFLAGS += $(INCLUDES)
+ CFLAGS += -g -Wall $(OPT)
+ CFLAGS += -fno-strict-aliasing
+-CFLAGS += -std=c99 -Wall -pedantic -Wshadow -Werror -D_GNU_SOURCE
++CFLAGS += -std=c99 -Wall -pedantic -Wshadow -D_GNU_SOURCE
+ CFLAGS += '-DCONFIGFILE="$(SYSCONFPREFIX)/ekeyd.conf"'
+ CFLAGS += '-DPIDFILE="$(RUNTIMEPREFIX)/ekeyd.pid"'
+ CFLAGS += '-DKEYRINGFILE="$(SYSCONFPREFIX)/keyring"'
+@@ -148,7 +148,7 @@ daemonise_ulusbd.o: daemonise.c
+       $(COMPILE.c) $(OUTPUT_OPTION) $(PTHFLAGS) $^
+ egd-linux: egd-linux.o daemonise.o
+-      $(CC) $(CFLAGS) -o $@ $^
++      $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^
+ ekeyd: ekeyd.o daemonise.o lstate.o connection.o stream.o frame.o packet.o keydb.o util.o fds.o krnlop.o foldback.o stats.o nonce.o ../device/frames/pem.o ../device/skeinwrap.o ../device/skein/skein.o ../device/skein/skein_block.o
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ $(LIBS)