pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Altered config file; added rc.d scripts; added daemonizing scripts; modified Makefile and PLIST for new files.



Module Name:	pkgsrc-wip
Committed By:	Charlie Root <root%ramiel.studiolab45.net@localhost>
Pushed By:	dvol
Date:		Thu Feb 3 12:55:32 2022 +0000
Changeset:	323fc1dc938fe09c975f78421a609322ba6cf9f0

Modified Files:
	nncp/Makefile
	nncp/PLIST
	nncp/distinfo
Added Files:
	nncp/files/nncp-caller-daemonize.sh
	nncp/files/nncp-caller.sh
	nncp/files/nncp-daemon-daemonize.sh
	nncp/files/nncp-daemon.sh
	nncp/files/nncp-toss-daemonize.sh
	nncp/files/nncp-toss.sh
	nncp/patches/patch-config

Log Message:
Altered config file; added rc.d scripts; added daemonizing scripts; modified Makefile and PLIST for new files.

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=323fc1dc938fe09c975f78421a609322ba6cf9f0

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 nncp/Makefile                       | 25 +++++++++++++++++++++++++
 nncp/PLIST                          |  3 +++
 nncp/distinfo                       |  1 +
 nncp/files/nncp-caller-daemonize.sh |  4 ++++
 nncp/files/nncp-caller.sh           | 27 +++++++++++++++++++++++++++
 nncp/files/nncp-daemon-daemonize.sh |  4 ++++
 nncp/files/nncp-daemon.sh           | 27 +++++++++++++++++++++++++++
 nncp/files/nncp-toss-daemonize.sh   |  4 ++++
 nncp/files/nncp-toss.sh             | 28 ++++++++++++++++++++++++++++
 nncp/patches/patch-config           | 13 +++++++++++++
 10 files changed, 136 insertions(+)

diffs:
diff --git a/nncp/Makefile b/nncp/Makefile
index f701eccd3c..c4294a19dc 100644
--- a/nncp/Makefile
+++ b/nncp/Makefile
@@ -12,5 +12,30 @@ LICENSE=	gnu-gpl-v3
 
 INFO_FILES=	yes
 
+NNCP_SPOOLDIR?=		${VARBASE}/spool/nncp
+
+PKG_SYSCONFSUBDIR?=	${PKGBASE}
+
+RCD_SCRIPTS=	nncp-caller nncp-daemon nncp-toss
+
+post-extract:
+	${CP} ${FILESDIR}/nncp-caller-daemonize.sh ${WRKSRC}
+	${CP} ${FILESDIR}/nncp-daemon-daemonize.sh ${WRKSRC}
+	${CP} ${FILESDIR}/nncp-toss-daemonize.sh ${WRKSRC}
+
+SUBST_CLASSES+=			daemonize
+SUBST_STAGE.daemonize=		pre-configure
+SUBST_MESSAGE.daemonize=	Customizing daemonizing scripts
+SUBST_FILES.daemonize=		nncp-caller-daemonize.sh nncp-daemon-daemonize.sh nncp-toss-daemonize.sh
+SUBST_VARS.daemonize=		PREFIX VARBASE
+
+post-install:
+	${INSTALL_SCRIPT} -d  ${DESTDIR}${PREFIX}/libexec
+	${INSTALL_SCRIPT} ${WRKSRC}/nncp-caller-daemonize.sh ${DESTDIR}${PREFIX}/libexec/nncp-caller
+	${INSTALL_SCRIPT} ${WRKSRC}/nncp-daemon-daemonize.sh ${DESTDIR}${PREFIX}/libexec/nncp-daemon
+	${INSTALL_SCRIPT} ${WRKSRC}/nncp-toss-daemonize.sh ${DESTDIR}${PREFIX}/libexec/nncp-toss
+
+# CONF_FILES+=	${PKG_SYSCONFDIR}/nnc
+    
 .include "../../lang/go/version.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/nncp/PLIST b/nncp/PLIST
index 27d1cfb7f4..ca117631c5 100644
--- a/nncp/PLIST
+++ b/nncp/PLIST
@@ -22,6 +22,9 @@ bin/nncp-toss
 bin/nncp-trns
 bin/nncp-xfer
 info/nncp.info
+libexec/nncp-caller
+libexec/nncp-daemon
+libexec/nncp-toss
 share/doc/nncp/AUTHORS
 share/doc/nncp/NEWS
 share/doc/nncp/NEWS.RU
diff --git a/nncp/distinfo b/nncp/distinfo
index b6530420b5..25c64796d2 100644
--- a/nncp/distinfo
+++ b/nncp/distinfo
@@ -4,3 +4,4 @@ SHA1 (nncp-8.0.2.tar.xz) = b850dfcd1c0dc5917046ede63ad4a595a4c923ac
 RMD160 (nncp-8.0.2.tar.xz) = 1543275abf3db128f2909ad029486ba7995187c5
 SHA512 (nncp-8.0.2.tar.xz) = 47f4b3d61c440b24fe2b54396ff6e7c8de8e189c6da820e54448567ab8dbf686a16e4f28762c8ee82b2fca7b1caab18cbb5069567d5411920ba706d00a56c510
 Size (nncp-8.0.2.tar.xz) = 1233252 bytes
+SHA1 (patch-config) = 03b77ce342c2d0abb568ae8038c4ac1e8030384e
diff --git a/nncp/files/nncp-caller-daemonize.sh b/nncp/files/nncp-caller-daemonize.sh
new file mode 100755
index 0000000000..f32d38850d
--- /dev/null
+++ b/nncp/files/nncp-caller-daemonize.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# nncp-caller itself doesn't daemonize when run non-interactively
+( cd /; @PREFIX@/bin/nncp-caller < /dev/null >/dev/null 2>&1 & echo $! > @VARBASE@/run/nncp-caller.pid ) &
diff --git a/nncp/files/nncp-caller.sh b/nncp/files/nncp-caller.sh
new file mode 100755
index 0000000000..2673baf3d4
--- /dev/null
+++ b/nncp/files/nncp-caller.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# $NetBSD: nncp-caller.sh,v 0.2 2022/02/02 dvol Exp $
+#
+
+# PROVIDE: nncp_caller
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="nncp_caller"
+nncp_caller_rcname="nncp-caller"
+rcvar="nncp_caller"
+command="@PREFIX@/libexec/nncp-caller"
+procname="@PREFIX@/bin/nncp-caller"
+conf_file="@PKG_SYSCONFDIR@/nncp/nncp.hjson"
+required_files="${conf_file}"
+pidfile="@VARBASE@/run/nncp-caller.pid"
+stop_postcmd=nncp_caller_remove_pidfile
+
+nncp_caller_remove_pidfile {
+    rm -f "${pidfile}"
+}
+
+load_rc_config ${nncp_caller_rcname}
+run_rc_command ${1}
+
diff --git a/nncp/files/nncp-daemon-daemonize.sh b/nncp/files/nncp-daemon-daemonize.sh
new file mode 100755
index 0000000000..2bec9f2a32
--- /dev/null
+++ b/nncp/files/nncp-daemon-daemonize.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# nncp-daemon itself doesn't daemonize when run non-interactively
+( cd /; @PREFIX@/bin/nncp-daemon < /dev/null >/dev/null 2>&1 & echo $! > @VARBASE@/run/nncp-daemon.pid ) &
diff --git a/nncp/files/nncp-daemon.sh b/nncp/files/nncp-daemon.sh
new file mode 100755
index 0000000000..4aac97cdca
--- /dev/null
+++ b/nncp/files/nncp-daemon.sh
@@ -0,0 +1,27 @@
+#!/bin/sh
+#
+# $NetBSD: nncp-daemon.sh,v 0.2 2022/02/02 dvol Exp $
+#
+
+# PROVIDE: nncp_daemon
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="nncp_daemon"
+nncp_daemon_rcname="nncp-daemon"
+rcvar="nncp_daemon"
+command="@PREFIX@/libexec/nncp-daemon"
+procname="@PREFIX@/bin/nncp-daemon"
+conf_file="@PKG_SYSCONFDIR@/nncp/nncp.hjson"
+required_files="${conf_file}"
+pidfile="@VARBASE@/run/nncp-daemon.pid"
+stop_postcmd=nncp_daemon_remove_pidfile
+
+nncp_daemon_remove_pidfile {
+    rm -f "${pidfile}"
+}
+
+load_rc_config ${nncp_daemon_rcname}
+run_rc_command ${1}
+
diff --git a/nncp/files/nncp-toss-daemonize.sh b/nncp/files/nncp-toss-daemonize.sh
new file mode 100755
index 0000000000..594d65b017
--- /dev/null
+++ b/nncp/files/nncp-toss-daemonize.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+# nncp-toss itself doesn't daemonize when run non-interactively
+( cd /; @PREFIX@/bin/nncp-toss < /dev/null >/dev/null 2>&1 & echo $! > @VARBASE@/run/nncp-toss.pid ) &
diff --git a/nncp/files/nncp-toss.sh b/nncp/files/nncp-toss.sh
new file mode 100755
index 0000000000..3439a3fb24
--- /dev/null
+++ b/nncp/files/nncp-toss.sh
@@ -0,0 +1,28 @@
+#!/bin/sh
+#
+# $NetBSD: nncp-toss.sh,v 0.2 2022/02/02 dvol Exp $
+#
+
+# PROVIDE: nncp_toss
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="nncp_toss"
+nncp_toss_rcname="nncp-toss"
+rcvar="nncp_toss"
+command="@PREFIX@/libexec/nncp-toss"
+procname="@PREFIX@/bin/nncp-toss"
+conf_file="@PKG_SYSCONFDIR@/nncp/nncp.hjson"
+required_files="${conf_file}"
+nncp_toss_flags="--cycle 60"
+pidfile="@VARBASE@/run/nncp-toss.pid"
+stop_postcmd=nncp_toss_remove_pidfile
+
+nncp_toss_remove_pidfile {
+    rm -f "${pidfile}"
+}
+
+load_rc_config ${nncp_toss_rcname}
+run_rc_command ${1}
+
diff --git a/nncp/patches/patch-config b/nncp/patches/patch-config
new file mode 100644
index 0000000000..87dcfb1942
--- /dev/null
+++ b/nncp/patches/patch-config
@@ -0,0 +1,13 @@
+$NetBSD$
+
+--- config.orig	2021-11-10 09:45:48.000000000 +0000
++++ config
+@@ -5,7 +5,7 @@ PLANTUML=${PLANTUML:-plantuml}
+ PREFIX=${PREFIX:-/usr/local}
+ 
+ SENDMAIL=${SENDMAIL:-/usr/sbin/sendmail}
+-CFGPATH=${CFGPATH:-$PREFIX/etc/nncp.hjson}
++CFGPATH=${CFGPATH:-${PKG_SYSCONFDIR}/nncp.hjson}
+ SPOOLPATH=${SPOOLPATH:-/var/spool/nncp}
+ LOGPATH=${LOGPATH:-/var/spool/nncp/log}
+ 


Home | Main Index | Thread Index | Old Index