pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
hiawatha: added rc script
Module Name: pkgsrc-wip
Committed By: Kevin Bloom <kevin.bloom%posteo.net@localhost>
Pushed By: nuclearkev
Date: Mon Mar 25 11:07:49 2024 -0400
Changeset: 95e0cc61188a12bb89375c188aa4d57764989786
Modified Files:
hiawatha/Makefile
hiawatha/PLIST
hiawatha/TODO
Added Files:
hiawatha/files/hiawatha.sh
Log Message:
hiawatha: added rc script
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=95e0cc61188a12bb89375c188aa4d57764989786
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
hiawatha/Makefile | 9 +++++----
hiawatha/PLIST | 1 +
hiawatha/TODO | 2 +-
hiawatha/files/hiawatha.sh | 39 +++++++++++++++++++++++++++++++++++++++
4 files changed, 46 insertions(+), 5 deletions(-)
diffs:
diff --git a/hiawatha/Makefile b/hiawatha/Makefile
index dd4990f334..400dc7157a 100644
--- a/hiawatha/Makefile
+++ b/hiawatha/Makefile
@@ -11,8 +11,6 @@ LICENSE= gnu-gpl-v2
USE_CMAKE= yes
-EGDIR= ${PREFIX}/share/examples/hiawatha
-
CMAKE_ARGS+= -DUSE_SHARED_MBEDTLS_LIBRARY=OFF
CMAKE_ARGS+= -DUSE_STATIC_MBEDTLS_LIBRARY=ON
CMAKE_ARGS+= -DWEBROOT_DIR="${PREFIX}/var/hiawatha"
@@ -30,8 +28,9 @@ REPLACE_PHP+= extra/letsencrypt/lefh.in
# TODO: having issues requiring PHP
CHECK_INTERPRETER_SKIP+= sbin/lefh
-
+EGDIR= ${PREFIX}/share/examples/hiawatha
ETCDIR= ${PKG_SYSCONFDIR}/hiawatha
+FILESDIR= ${PKGDIR}/../../wip/hiawatha/files
CONF_FILES+= ${EGDIR}/error.xslt ${ETCDIR}/error.xslt
CONF_FILES+= ${EGDIR}/hiawatha.conf ${ETCDIR}/hiawatha.conf
@@ -39,7 +38,9 @@ CONF_FILES+= ${EGDIR}/index.xslt ${ETCDIR}/index.xslt
CONF_FILES+= ${EGDIR}/mimetype.conf ${ETCDIR}/mimetype.conf
CONF_FILES+= ${EGDIR}/cgi-wrapper.conf ${ETCDIR}/cgi-wrapper.conf
-INSTALLATION_DIRS+= ${EGDIR}
+INSTALLATION_DIRS+= ${EGDIR} ${RCDIR}
+
+RCD_SCRIPTS= hiawatha
post-install:
${MV} ${DESTDIR}${ETCDIR}/hiawatha.conf ${DESTDIR}${EGDIR}
diff --git a/hiawatha/PLIST b/hiawatha/PLIST
index 7a5a8f3898..afe46371b8 100644
--- a/hiawatha/PLIST
+++ b/hiawatha/PLIST
@@ -122,6 +122,7 @@ share/examples/hiawatha/error.xslt
share/examples/hiawatha/hiawatha.conf
share/examples/hiawatha/index.xslt
share/examples/hiawatha/mimetype.conf
+share/examples/rc.d/hiawatha
var/hiawatha/index.html
@pkgdir var/run
@pkgdir var/log/hiawatha
diff --git a/hiawatha/TODO b/hiawatha/TODO
index 87511982fa..397c9504ff 100644
--- a/hiawatha/TODO
+++ b/hiawatha/TODO
@@ -1,2 +1,2 @@
test
-rc file
+monitor option
diff --git a/hiawatha/files/hiawatha.sh b/hiawatha/files/hiawatha.sh
new file mode 100644
index 0000000000..63c25f99c9
--- /dev/null
+++ b/hiawatha/files/hiawatha.sh
@@ -0,0 +1,39 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: $
+#
+# PROVIDE: hiawatha
+# REQUIRE: DAEMON
+
+pidfile=/usr/pkg/var/run/hiawatha.pid
+
+name="hiawatha"
+command="hiawatha"
+
+cmd=${1:-start}
+
+case ${cmd} in
+ start)
+ echo "Starting ${name}."
+ ${command}&
+ echo $! > ${pidfile}
+ ;;
+
+ stop)
+ echo "Stopping ${name}."
+ kill `cat ${pidfile}`
+ rm ${pidfile}
+ ;;
+
+ restart)
+ ( $0 stop )
+ sleep 5
+ $0 start
+ ;;
+
+ *)
+ echo 1>&2 "Usage: $0 [restart|start|stop]"
+ exit 1
+ ;;
+esac
+exit 0
Home |
Main Index |
Thread Index |
Old Index