diff options
author | wiedi <wiedi@pkgsrc.org> | 2014-05-14 13:53:53 +0000 |
---|---|---|
committer | wiedi <wiedi@pkgsrc.org> | 2014-05-14 13:53:53 +0000 |
commit | 7a180558cf0cf23dffeb623ee790765b27bb6454 (patch) | |
tree | c1914a3b9a6b2e0fe075f36e96137e6c273e3114 /security/spiped | |
parent | 136b4d9ae51a1d75d0b269827037928203144dd6 (diff) | |
download | pkgsrc-7a180558cf0cf23dffeb623ee790765b27bb6454.tar.gz |
Add SMF manifest
Diffstat (limited to 'security/spiped')
-rw-r--r-- | security/spiped/MESSAGE.smf | 24 | ||||
-rw-r--r-- | security/spiped/Makefile | 9 | ||||
-rw-r--r-- | security/spiped/files/smf/manifest.xml | 28 | ||||
-rw-r--r-- | security/spiped/files/smf/spiped.sh | 33 |
4 files changed, 92 insertions, 2 deletions
diff --git a/security/spiped/MESSAGE.smf b/security/spiped/MESSAGE.smf new file mode 100644 index 00000000000..bc23d36c0d7 --- /dev/null +++ b/security/spiped/MESSAGE.smf @@ -0,0 +1,24 @@ +=========================================================================== +$NetBSD: MESSAGE.smf,v 1.1 2014/05/14 13:53:53 wiedi Exp $ + + This package supports multiple SMF instances. + + Configure using the SMF properties: mode, source, target and key. + Mode can have the value "encrypt" or "decrypt". Source and target are + formatted as described in spiped(1). The key is a path to the keyfile. + + To generate a new keyfile: + + dd if=/dev/urandom bs=32 count=1 > /opt/local/etc/spiped_example.key + + Add a example service instance: + + svccfg -s spiped add example + svccfg -s spiped:example addpg spiped application + svccfg -s spiped:example setprop spiped/mode = astring: decrypt + svccfg -s spiped:example setprop spiped/source = astring: [0.0.0.0]:2323 + svccfg -s spiped:example setprop spiped/target = astring: [127.0.0.1]:23 + svccfg -s spiped:example setprop \ + spiped/key = astring: "/opt/local/etc/spiped_example.key" + +=========================================================================== diff --git a/security/spiped/Makefile b/security/spiped/Makefile index e0345cefe08..835bd417b3e 100644 --- a/security/spiped/Makefile +++ b/security/spiped/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.3 2014/04/21 22:07:04 wiedi Exp $ +# $NetBSD: Makefile,v 1.4 2014/05/14 13:53:53 wiedi Exp $ DISTNAME= spiped-1.3.1 -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= net security MASTER_SITES= http://www.tarsnap.com/spiped/ EXTRACT_SUFX= .tgz @@ -23,6 +23,11 @@ MAKE_ENV+= LDADD_EXTRA="-lsocket -lnsl" INSTALLATION_DIRS= share/doc/spiped ${PKGMANDIR}/man1 +SMF_METHODS= spiped +.if ${INIT_SYSTEM} == "smf" +MESSAGE_SRC+= MESSAGE.smf +.endif + post-install: ${INSTALL_DATA} ${WRKSRC}/README ${DESTDIR}${PREFIX}/share/doc/spiped diff --git a/security/spiped/files/smf/manifest.xml b/security/spiped/files/smf/manifest.xml new file mode 100644 index 00000000000..a1bbb549748 --- /dev/null +++ b/security/spiped/files/smf/manifest.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> +<service_bundle type="manifest" name="@SMF_NAME@"> + <service name="@SMF_PREFIX@/@SMF_NAME@" type="service" version="1"> + <create_default_instance enabled="false"/> + + <dependency name="network" grouping="require_all" restart_on="refresh" type="service"> + <service_fmri value="svc:/milestone/network:default"/> + </dependency> + + <dependency name="filesystem" grouping="require_all" restart_on="refresh" type="service"> + <service_fmri value="svc:/system/filesystem/local"/> + </dependency> + + <exec_method type="method" name="start" exec="@PREFIX@/@SMF_METHOD_FILE.spiped@" timeout_seconds="5"/> + <exec_method type="method" name="stop" exec=":kill" timeout_seconds="60"/> + + <property_group name="application" type="application"></property_group> + + <stability value="Evolving"/> + <template> + <common_name> + <loctext xml:lang="C">symmetrically encrypted and authenticated pipes</loctext> + </common_name> + </template> + + </service> +</service_bundle> diff --git a/security/spiped/files/smf/spiped.sh b/security/spiped/files/smf/spiped.sh new file mode 100644 index 00000000000..43feaddc6d5 --- /dev/null +++ b/security/spiped/files/smf/spiped.sh @@ -0,0 +1,33 @@ +#!@SMF_METHOD_SHELL@ +# +# $NetBSD: spiped.sh,v 1.1 2014/05/14 13:53:53 wiedi Exp $ +# +# Init script for spiped. +# + +. /lib/svc/share/smf_include.sh + +getproparg() { + svcprop -p $1 $SMF_FMRI +} + +MODE=$( getproparg spiped/mode) +SOURCE=$(getproparg spiped/source) +TARGET=$(getproparg spiped/target) +KEY=$( getproparg spiped/key) + +case "$MODE" in + encrypt) + MODEFLAG="-e" + ;; + decrypt) + MODEFLAG="-d" + ;; + *) + echo Invalid value for spiped/mode: $MODE + exit $SMF_EXIT_ERR_CONFIG +esac + +@LOCALBASE@/bin/spiped $MODEFLAG -s "$SOURCE" -t "$TARGET" -k "$KEY" + +exit $SMF_EXIT_OK |