pkgsrc-WIP-changes archive

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

charybdis: More improvements



Module Name:	pkgsrc-wip
Committed By:	Kamil Rytarowski <n54%gmx.com@localhost>
Pushed By:	kamil
Date:		Tue Oct 31 00:15:09 2017 +0100
Changeset:	e92c24e6e12383ed48430e5302992e0c4f849228

Modified Files:
	charybdis/Makefile
Added Files:
	charybdis/files/charybdis.sh

Log Message:
charybdis: More improvements

Use VARBASE for pidfile.
Add EGDIR for consistency with other packages.
Use example startup script.

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

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

diffstat:
 charybdis/Makefile           | 16 +++++++++++++---
 charybdis/files/charybdis.sh | 30 ++++++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 3 deletions(-)

diffs:
diff --git a/charybdis/Makefile b/charybdis/Makefile
index e44e80a6d3..0afa099a8c 100644
--- a/charybdis/Makefile
+++ b/charybdis/Makefile
@@ -14,15 +14,25 @@ USE_TOOLS+=	automake autoconf autoreconf
 
 GNU_CONFIGURE=	yes
 
-INSTALL_MAKE_FLAGS+=	sysconfdir=${PREFIX}/share/examples/charybdis
+BUILD_DEFS+=	VARBASE
+
+CHARYBDIS_PID_DIR=	${VARBASE}/run  # default directory for PID files
+FILES_SUBST+=		CHARYBDIS_PID_DIR=${CHARYBDIS_PID_DIR}
+
+CONFIGURE_ARGS+=	--with-rundir=${CHARYBDIS_PID_DIR}
+
+EGDIR=		${PREFIX}/share/examples/charybdis
+
+INSTALL_MAKE_FLAGS+=	sysconfdir=${EGDIR}
 
 pre-configure:
 	${RUN} cd ${WRKSRC} && ./autogen.sh
 
 MAKE_DIRS+=	${PKG_SYSCONFDIR}
 .for f in ircd.conf.example ircd.motd reference.conf
-CONF_FILES+=	${PREFIX}/share/examples/charybdis/${f} \
-		${PKG_SYSCONFDIR}/${f}
+CONF_FILES+=	${EGDIR}/${f} ${PKG_SYSCONFDIR}/${f}
 .endfor
 
+RCD_SCRIPTS+=		charybdis
+
 .include "../../mk/bsd.pkg.mk"
diff --git a/charybdis/files/charybdis.sh b/charybdis/files/charybdis.sh
new file mode 100644
index 0000000000..2235134d4d
--- /dev/null
+++ b/charybdis/files/charybdis.sh
@@ -0,0 +1,30 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD: sshd.sh,v 1.16 2015/11/11 11:40:06 sevan Exp $
+#
+# PROVIDE: charybdis
+# REQUIRE: DAEMON
+#
+# You will need to set some variables in /etc/rc.conf to start charybdis:
+#
+# charybdis=YES
+
+if [ -f /etc/rc.subr ]
+then
+	. /etc/rc.subr
+fi
+
+name="charybdis"
+rcvar=$name
+command="@PREFIX@/bin/${name}"
+pidfile="@CHARYBDIS_PID_DIR@/${name}.pid"
+required_files="@PKG_SYSCONFDIR@/ircd.conf"
+command_args="-pidfile ${pidfile}"
+
+if [ -f /etc/rc.subr ]; then
+	load_rc_config $name
+	run_rc_command "$1"
+else
+	@ECHO@ -n " ${name}"
+	${command} ${command_args}
+fi


Home | Main Index | Thread Index | Old Index