net-misc/sks: Add ebuild
authorkristianf <devnull@localhost>
Sat, 2 Nov 2013 22:54:53 +0000 (23:54 +0100)
committerkristianf <devnull@localhost>
Sat, 2 Nov 2013 22:54:53 +0000 (23:54 +0100)
net-misc/sks/Manifest [new file with mode: 0644]
net-misc/sks/files/sks-confd [new file with mode: 0644]
net-misc/sks/files/sks-db.runscript [new file with mode: 0644]
net-misc/sks/files/sks-db.service [new file with mode: 0644]
net-misc/sks/files/sks-recon.runscript [new file with mode: 0644]
net-misc/sks/files/sks-recon.service [new file with mode: 0644]
net-misc/sks/sks-1.1.4.ebuild [new file with mode: 0644]

diff --git a/net-misc/sks/Manifest b/net-misc/sks/Manifest
new file mode 100644 (file)
index 0000000..78e078e
--- /dev/null
@@ -0,0 +1,7 @@
+AUX sks-confd 87 SHA256 811498c2c964ee109dcbf617682addf0631172bb75e9b221af5b4084f4720214 SHA512 617067acb45e7326ad79726302a1eea9bbebaaad905d5f586469056fe01ff8a3f5cfba1f43dcdec456ffe5c31058b80e3c9f2acbb1d19a9640fee073a2cf3660 WHIRLPOOL 0ee221d86ca478af20aa9e8530eff79ecd0181dbf52da282d41fed6881a6649335281f1907e486bdc1dd4877b930265aefb3e5d189cd6b5c270d383abf329fc7
+AUX sks-db.runscript 519 SHA256 947a04372252e9e21a020243a678d3f78ba9b6b5fffd8086f83592c772bed467 SHA512 157cdd1477d829acc7b983fbfea015528c16b88938f595cfb6a7bb7c27bf0be4f42d2a69def0e0ef38d618b23db56e241e2712c4eb9ebb837273693e05f2734f WHIRLPOOL 5b12f2434d0229e46b3e50176063df5d8b680f1cb1d003a39d1eb3d3950303b28ecea2e8f5907564a7dcf2c3d4275d7ea555f6530eebd0cac131160e1d573a1c
+AUX sks-db.service 186 SHA256 14154252dfe8ff757b67979c54053497fc6f0ef18c81393a925540904b5f0d41 SHA512 26973d2409fd605ec5851b0501a445e4666bf8c7d2854949858896ffa02b3f5ddd67c68c431c033c913399a90bb8fb2cd85af72fe419241fb8258a9c7e82ea98 WHIRLPOOL bdd61312995eb8d17efe0cb131df17f779c6606cdd37bff10075e8b670a5cc2706dc688aae2c3338f48368bbb7256fd2ebc713dcdb81153777b5b3ece0c7669f
+AUX sks-recon.runscript 592 SHA256 85ef9ab277082e6440a300dc3e1f7b94365a892982c073b1133d9b26a5292295 SHA512 5ea71ae4dc0cad2bf603ba450037507b96d059be9be1d3d8afff2fd0eeca06aa583480065d6bbb22e9ba453e959d7fbd2a1d6a00287abc97930e859f725002f8 WHIRLPOOL 7f74824e12028986ba86a56b0668f8f63dad55ccf7baa452ac72115bacadbded23e072787c4e4ae2e40cdff2d7b439bbbaddacaa8e275c6ebb89520066f643e1
+AUX sks-recon.service 207 SHA256 990b809a91323f94110a4024ebd4759a3f5c1cac96a1577b39f50ef4b6865e3a SHA512 7fc3c83f3267ef5e2b8b097c0d095cbaa682552df8caa1be47f54ff5639e9f64855f304562aad181800516d7faa8d081c4b225d9c95223cb14c61e8b6d58faa7 WHIRLPOOL 03f7623e12ff84f8affda5214d0b1234b77ce55eb7faad813365e9aa4acae61214b06d6b26e789ffdb1d25db6f5a6c6bbfc5dd2c60c14506f0337272c9e4e96d
+DIST sks-1.1.4.tgz 345249 SHA256 baa79be8c1983544518e8a72ccecacb2837d52ae4015dc7cf364cddb53220c76 SHA512 f83c02c995dd3519cfa221c41ab827b9689bcbf91360d2448f83a5dd8b42e7f15665213c4f048ad678da4093d2ec533b6fcc1f5297933ad5f445143b77e14202 WHIRLPOOL eda6d169998434e5eda58dfdd6d7b0e63a5fc493fd38c65d9ce12a2eb5319523c93be4d5244f7fa9f7a3cb408a12b89cbd357e67096b3c914a2e903635970a50
+EBUILD sks-1.1.4.ebuild 2992 SHA256 8c300cf3d9c6a19e32c7b23f426fcbe9b93f73b6a03b356e94c5253d478b6e89 SHA512 5b4e83f24daa261bcb5446f36e4738329e3996b059a8abfe3e193e12afe2f204570ba3dbdb66a7d0e6e2d938754cc8b0e35e871ced495ba63ba84a2e4560cd57 WHIRLPOOL b1dcbbe72a30cdddb53a4aded8d981e7d7e442eb0b0b851fc0bcd664f2bb22f95f6b7139d2974a1e64f8326d673fa184d613039113c3da2891fa06585b39febd
diff --git a/net-misc/sks/files/sks-confd b/net-misc/sks/files/sks-confd
new file mode 100644 (file)
index 0000000..64eef24
--- /dev/null
@@ -0,0 +1,4 @@
+SKS_DIR="/var/lib/sks"
+
+# Set common options for sks db and sks recon here.
+SKS_ARGS=""
\ No newline at end of file
diff --git a/net-misc/sks/files/sks-db.runscript b/net-misc/sks/files/sks-db.runscript
new file mode 100644 (file)
index 0000000..93f1561
--- /dev/null
@@ -0,0 +1,25 @@
+#!/sbin/runscript
+source /etc/conf.d/sks
+
+command=/usr/bin/sks
+command_args="db ${SKS_ARGS}"
+command_background=1
+description="SKS database thread"
+name="SKS db"
+pidfile="/var/run/sks-db.pid"
+required_files="${SKS_DIR}/sksconf"
+start_stop_daemon_args="--chdir ${SKS_DIR} --user sks"
+
+
+depend()
+{
+       use net
+}
+
+start_pre()
+{
+    checkpath --owner sks:sks --directory \
+        ${SKS_DIR} ${SKS_DIR}/KDB ${SKS_DIR}/PTree
+    checkpath --owner sks:sks --file \
+        ${SKS_DIR}/*.log ${SKS_DIR}/KDB/* ${SKS_DIR}/PTree/*
+}
diff --git a/net-misc/sks/files/sks-db.service b/net-misc/sks/files/sks-db.service
new file mode 100644 (file)
index 0000000..92639c3
--- /dev/null
@@ -0,0 +1,12 @@
+[Unit]
+Description=SKS database thread
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/sks db
+User=sks
+WorkingDirectory=/var/lib/sks
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/sks/files/sks-recon.runscript b/net-misc/sks/files/sks-recon.runscript
new file mode 100644 (file)
index 0000000..28f128e
--- /dev/null
@@ -0,0 +1,26 @@
+#!/sbin/runscript
+source /etc/conf.d/sks
+
+command=/usr/bin/sks
+command_args="recon ${SKS_ARGS}"
+command_background=1
+description="Reconnoiters SKS peers for keys"
+name="SKS recon"
+pidfile="/var/run/sks-recon.pid"
+required_files="${SKS_DIR}/sksconf ${SKS_DIR}/membership"
+start_stop_daemon_args="--chdir ${SKS_DIR} --nice 10 --user sks"
+
+
+depend()
+{
+    after sks-db
+    use net
+}
+
+start_pre()
+{
+    checkpath --owner sks:sks --directory \
+        ${SKS_DIR} ${SKS_DIR}/KDB ${SKS_DIR}/PTree
+    checkpath --owner sks:sks --file \
+        ${SKS_DIR}/*.log ${SKS_DIR}/KDB/* ${SKS_DIR}/PTree/*
+}
diff --git a/net-misc/sks/files/sks-recon.service b/net-misc/sks/files/sks-recon.service
new file mode 100644 (file)
index 0000000..4dd51e6
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=SKS key reconnaissance thread
+After=network.target
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/sks recon
+User=sks
+WorkingDirectory=/var/lib/sks
+Nice=10
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-misc/sks/sks-1.1.4.ebuild b/net-misc/sks/sks-1.1.4.ebuild
new file mode 100644 (file)
index 0000000..b6a97a1
--- /dev/null
@@ -0,0 +1,97 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/sks/sks-1.1.2.ebuild,v 1.4 2012/02/07 00:34:06 kingtaco Exp $
+
+EAPI=4
+
+inherit eutils multilib
+
+DESCRIPTION="SKS Keyserver"
+HOMEPAGE="https://bitbucket.org/skskeyserver/sks-keyserver"
+SRC_URI="https://bitbucket.org/skskeyserver/sks-keyserver/downloads/${P}.tgz"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="systemd optimize test"
+
+DEPEND="dev-lang/ocaml
+               dev-ml/cryptokit
+               sys-libs/db:5.2"
+RDEPEND="${DEPEND}"
+
+pkg_setup() {
+       ebegin "Creating named group and user"
+       enewgroup sks
+       enewuser sks -1 -1 /var/lib/sks sks
+}
+
+src_prepare() {
+       cp Makefile.local.unused Makefile.local || die
+       sed -i \
+               -e "s:^BDBLIB=.*$:BDBLIB=-L/usr/$(get_libdir):g" \
+               -e "s:^BDBINCLUDE=.*$:BDBINCLUDE=-I/usr/include/db5.2/:g" \
+               -e "s:^LIBDB=.*$:LIBDB=-ldb-5.2:g" \
+               -e "s:^PREFIX=.*$:PREFIX=${D}/usr:g" \
+               -e "s:^MANDIR=.*$:MANDIR=${D}/usr/share/man:g" \
+               Makefile.local || die
+       sed -i \
+               -e 's:^CAMLINCLUDE= -I lib -I bdb$:CAMLINCLUDE= -I lib -I bdb -I +cryptokit:g' \
+               -e 's:-Werror-implicit-function-declaration::g' \
+               Makefile bdb/Makefile || die
+}
+
+src_compile() {
+       emake dep
+       emake -j1 all
+       if use optimize; then
+               emake all.bc
+       fi
+}
+
+src_test() {
+       ./sks unit_test
+}
+
+src_install() {
+       if use optimize; then
+               emake install.bc
+               dosym /usr/bin/sks.bc usr/bin/sks
+               dosym /usr/bin/sks_add_mail.bc usr/bin/sks_add_mail
+       else
+               emake install
+       fi
+
+       dodoc README.md
+
+       newinitd "${FILESDIR}/sks-db.runscript" sks-db
+       newinitd "${FILESDIR}/sks-recon.runscript" sks-recon
+       newconfd "${FILESDIR}/sks-confd" sks
+       use systemd && systemd_dounit "${FILESDIR}/sks-db.service"
+       use systemd && systemd_dounit "${FILESDIR}/sks-recon.service"
+
+       mkdir -p $D/var/lib/sks/web.typical
+       cp $S/sampleConfig/DB_CONFIG $D/var/lib/sks/DB_CONFIG.typical
+       cp $S/sampleConfig/sksconf.typical $D/var/lib/sks/sksconf.typical
+       cp $S/sampleWeb/HTML5/* $D/var/lib/sks/web.typical/
+
+       keepdir /var/lib/sks
+}
+
+pkg_postinst() {
+       einfo "To get sks running, first build the database,"
+       einfo "start the databse, import atleast one key, then"
+       einfo "run a cleandb. See the sks man page for more"
+       einfo "information"
+       einfo "Typical DB_CONFIG file and sksconf has been installed"
+       einfo "in /var/lib/sks and can be used as templates by renaming"
+       einfo "to remove the .typical extension. The DB_CONFIG file has"
+       einfo "to be in place before doing the database build, or the BDB"
+       einfo "environment has to be manually cleared from both KDB and PTree"
+       einfo "using db4.8_recover -h and db4.8_checkpoint -1h"
+       einfo "Additionally a sample web interface has been installed as"
+       einfo "web.typical in /var/lib/sks that can be used by renaming it to web"
+       einfo "Important: It is strongly recommended to set up SKS behind a"
+       einfo "reverse proxy. Instructions on properly configuring SKS can be"
+       einfo "found at https://bitbucket.org/skskeyserver/sks-keyserver/wiki/Peering"
+}
+