]> git.ipfire.org Git - thirdparty/nqptp.git/commitdiff
Add an experimental FreeBSD service file and the automake and configure stuff.
authorMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 19 May 2022 19:28:31 +0000 (20:28 +0100)
committerMike Brady <4265913+mikebrady@users.noreply.github.com>
Thu, 19 May 2022 19:28:31 +0000 (20:28 +0100)
Makefile.am
configure.ac
nqptp.freebsd [new file with mode: 0644]

index ed4c27543fb8bc12b0464473b5c6cdf06920f499..b00d78e187029a2880e57303134f4c2cbf34fe05 100644 (file)
@@ -26,4 +26,11 @@ if INSTALL_SYSTEMD_STARTUP
 endif
 endif
  # no installer for FreeBSD yet
+if BUILD_FOR_FREEBSD
+if INSTALL_FREEBSD_STARTUP
+       [ -e /usr/local/etc/rc.d/nqptp ] || cp nqptp.freebsd /usr/local/etc/rc.d/nqptp
+       chmod 555 /usr/local/etc/rc.d/nqptp
+endif
+endif
+
  
index 92e597e0454245c466da966513d9729cb38d4001..e8d1eee9e595231a6edcde97d58af6e623947a48 100644 (file)
@@ -44,6 +44,10 @@ AM_CONDITIONAL([USE_GIT_VERSION], [test -n "$GIT" && test -e ".git/index" ])
 AC_ARG_WITH([systemd-startup],[AS_HELP_STRING([--with-systemd-startup],[install a systemd startup script during a make install])])
 AM_CONDITIONAL([INSTALL_SYSTEMD_STARTUP], [test "x$with_systemd_startup" = "xyes"])
 
+# Check to see if we should include the systemd stuff to define it as a service
+AC_ARG_WITH([freebsd-startup],[AS_HELP_STRING([--with-freebsd-startup],[install a FreeBSD startup script during a make install])])
+AM_CONDITIONAL([INSTALL_FREEBSD_STARTUP], [test "x$with_freebsd_startup" = "xyes"])
+
 
 AC_CONFIG_SRCDIR([nqptp.c])
 AC_CONFIG_HEADERS([config.h])
diff --git a/nqptp.freebsd b/nqptp.freebsd
new file mode 100644 (file)
index 0000000..679a78a
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+#
+
+# PROVIDE: nqptp
+# REQUIRE: FILESYSTEMS DAEMON hostname
+
+. /etc/rc.subr
+
+name="nqptp"
+rcvar="nqptp_enable"
+pidfile="/var/run/${name}.pid"
+apptodaemonise="/usr/local/bin/nqptp"
+
+command="/usr/sbin/daemon"
+# -S log to syslog; -P store the supervisor PID
+command_args="-S -P ${pidfile} ${apptodaemonise}"
+
+load_rc_config $name
+run_rc_command "$1"
+