summaryrefslogtreecommitdiff
path: root/devel/p4d/files
diff options
context:
space:
mode:
authorschmonz <schmonz@pkgsrc.org>2002-09-01 02:25:04 +0000
committerschmonz <schmonz@pkgsrc.org>2002-09-01 02:25:04 +0000
commit76f8f380746937f23375d51011c73ec8230a6e69 (patch)
tree2d57c4a0fde310d61ab4447647c1fa4abca8413a /devel/p4d/files
parent3e6bfff126b272f3cbd97747724fb576a8817210 (diff)
downloadpkgsrc-76f8f380746937f23375d51011c73ec8230a6e69.tar.gz
Initial import of Perforce SCM server, release 2002.1.
P4D, the Perforce Server, manages the Perforce central file repository (the "depot"), tracks Perforce user operations, and records activity in the Perforce SCM database. You need one Perforce Server to support all of the users in your enterprise.
Diffstat (limited to 'devel/p4d/files')
-rw-r--r--devel/p4d/files/p4d.sh108
1 files changed, 108 insertions, 0 deletions
diff --git a/devel/p4d/files/p4d.sh b/devel/p4d/files/p4d.sh
new file mode 100644
index 00000000000..7df60e5ce2a
--- /dev/null
+++ b/devel/p4d/files/p4d.sh
@@ -0,0 +1,108 @@
+#!/bin/sh
+#
+# $NetBSD: p4d.sh,v 1.1.1.1 2002/09/01 02:26:09 schmonz Exp $
+#
+# Perforce SCM server
+#
+# PROVIDE: p4d
+# REQUIRE: DAEMON
+
+[ -f /etc/rc.subr ] && . /etc/rc.subr
+
+name="p4d"
+rcvar=${name}
+command="@PREFIX@/sbin/p4d"
+start_cmd="p4d_start"
+license_cmd="p4d_license"
+extra_commands="license"
+
+p4d_start()
+{
+ p4d_run ${p4d_flags} -d -q
+}
+
+p4d_license()
+{
+ p4d_run -V
+}
+
+p4d_run()
+{
+ eval "@SU@ -m @P4USER@ -c 'umask 037; @SETENV@ - `p4d_getenv` ${command} $@'"
+}
+
+p4d_getenv()
+{
+ p4d_getenv_debug
+ p4d_getenv_journalfile
+ p4d_getenv_logfile
+ p4d_getenv_port
+ p4d_getenv_rootdir
+ p4d_getenv_tmp
+}
+
+p4d_getenv_debug()
+{
+ # Possibly specify debug output
+ # p4d default: none
+ if [ ! -z ${P4DEBUG} ]; then
+ @ECHO@ -n " P4DEBUG=${P4DEBUG}"
+ fi
+}
+
+p4d_getenv_journalfile()
+{
+ # Possibly specify the journal file
+ # p4d default: "journal" if it exists, else none
+ if [ ! -z ${P4JOURNAL} ]; then
+ @ECHO@ -n " P4JOURNAL=${P4JOURNAL}"
+ fi
+}
+
+p4d_getenv_logfile()
+{
+ # Always specify the log file
+ # p4d default: stderr
+ if [ -z ${P4LOG} ]; then
+ P4LOG=@P4LOG@
+ fi
+ @ECHO@ -n " P4LOG=${P4LOG}"
+}
+
+p4d_getenv_port()
+{
+ # Possibly specify the port number
+ # p4d default: 1666
+ if [ ! -z ${P4PORT} ]; then
+ @ECHO@ -n " P4PORT=${P4PORT}"
+ fi
+}
+
+p4d_getenv_rootdir()
+{
+ # Always specify the root dir
+ # p4d default: working directory
+ if [ -z ${P4ROOT} ]; then
+ P4ROOT=@P4ROOT@
+ fi
+ @ECHO@ -n " P4ROOT=${P4ROOT}"
+}
+
+p4d_getenv_tmp()
+{
+ # Possibly specify temp dir
+ # p4d default: /tmp
+ if [ ! -z ${TEMP} ]; then
+ @ECHO@ -n " TMP=${TEMP}"
+ elif [ ! -z ${TMP} ]; then
+ @ECHO@ -n " TMP=${TMP}"
+ fi
+}
+
+if [ -f /etc/rc.subr ]; then
+ load_rc_config $name
+ run_rc_command "$1"
+else
+ echo -n " ${name}"
+ ${start_cmd}
+fi