aboutsummaryrefslogtreecommitdiffstats
path: root/emulators/tpm-emulator
diff options
context:
space:
mode:
authornork <nork@FreeBSD.org>2010-12-14 02:38:54 +0800
committernork <nork@FreeBSD.org>2010-12-14 02:38:54 +0800
commitce901f5da08cd675d2c0b813c85b40a7582f9137 (patch)
treec58c910b145fa794261726aa8c8ce255d57792fe /emulators/tpm-emulator
parentf73c6388b1f1a8ef9efa54f3ce12cadd451bee8d (diff)
downloadfreebsd-ports-gnome-ce901f5da08cd675d2c0b813c85b40a7582f9137.tar.gz
freebsd-ports-gnome-ce901f5da08cd675d2c0b813c85b40a7582f9137.tar.zst
freebsd-ports-gnome-ce901f5da08cd675d2c0b813c85b40a7582f9137.zip
Add support rc script. (buggy by not install USER/GROUP)
[NOTE] In this time, I don't bump PORTREVISION. Because I must install _tss user and group account(bug), and I'll re-setup working directory under $PREFIX. So I'll finish these working, and bump PORTREVISION.
Diffstat (limited to 'emulators/tpm-emulator')
-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"