aboutsummaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorNorikatsu Shigemura <nork@FreeBSD.org>2010-12-13 18:38:54 +0000
committerNorikatsu Shigemura <nork@FreeBSD.org>2010-12-13 18:38:54 +0000
commit339a230ae5a0f836ecd8f0f3b7a8a2e41c926a1e (patch)
treee8d335af563f25547e3c3b9ce93b207d2f1460bb /emulators
parent70d97cf7a248e727d4806c40831919088368e73b (diff)
downloadports-339a230ae5a0f836ecd8f0f3b7a8a2e41c926a1e.tar.gz
ports-339a230ae5a0f836ecd8f0f3b7a8a2e41c926a1e.zip
Notes
Diffstat (limited to 'emulators')
-rw-r--r--emulators/tpm-emulator/Makefile1
-rw-r--r--emulators/tpm-emulator/files/tpmd.in31
2 files changed, 32 insertions, 0 deletions
diff --git a/emulators/tpm-emulator/Makefile b/emulators/tpm-emulator/Makefile
index 5d32bc2452cf..59d58bd6c55c 100644
--- a/emulators/tpm-emulator/Makefile
+++ b/emulators/tpm-emulator/Makefile
@@ -17,6 +17,7 @@ COMMENT= Trusted Platform Module (TPM) emulator
LIB_DEPENDS= gmp.10:${PORTSDIR}/math/gmp
USE_CMAKE= YES
+USE_RC_SUBR= tpmd
USE_LDCONFIG= YES
MAKE_JOBS_SAFE= YES
diff --git a/emulators/tpm-emulator/files/tpmd.in b/emulators/tpm-emulator/files/tpmd.in
new file mode 100644
index 000000000000..f497e38757b6
--- /dev/null
+++ b/emulators/tpm-emulator/files/tpmd.in
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: tpmd
+# REQUIRE: SERVERS
+# BEFORE: tcsd
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# tpmd_enable (bool): Set to NO by default.
+# Set it to YES to enable tpmd.
+
+. /etc/rc.subr
+
+name=tpmd
+rcvar=`set_rcvar`
+command="%%PREFIX%%/bin/${name}"
+
+load_rc_config $name
+
+tpmd_enable=${tpmd_enable-"NO"}
+tpmd_user=${tpmd_user-"_tss"}
+tpmd_group=${tpmd_group-"_tss"}
+
+command_args="-o ${tpmd_user} -g ${tpmd_group}"
+unset tpmd_user tpmd_group
+
+run_rc_command "$1"