pkgsrc-WIP-changes archive

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

anope: add an rc script.



Module Name:	pkgsrc-wip
Committed By:	nia <nia%NetBSD.org@localhost>
Pushed By:	nee
Date:		Tue Feb 5 17:49:44 2019 +0000
Changeset:	70862856cff40c1f7fcd35fedecd2229d7de1108

Modified Files:
	anope/Makefile
	anope/distinfo
	anope/patches/patch-data_example.conf
Added Files:
	anope/files/anope.sh

Log Message:
anope: add an rc script.

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

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

diffstat:
 anope/Makefile                        | 27 +++++++++++++++++++++++++++
 anope/distinfo                        |  2 +-
 anope/files/anope.sh                  | 25 +++++++++++++++++++++++++
 anope/patches/patch-data_example.conf | 16 ++++++++++++++++
 4 files changed, 69 insertions(+), 1 deletion(-)

diffs:
diff --git a/anope/Makefile b/anope/Makefile
index 7679b8bf84..5f9b5e6134 100644
--- a/anope/Makefile
+++ b/anope/Makefile
@@ -13,6 +13,7 @@ COMMENT=	Modular set of IRC services
 LICENSE=	gnu-gpl-v2
 
 USE_LANGUAGES=	c c++
+USE_TOOLS+=	bash
 USE_CMAKE=	yes
 
 CMAKE_ARGS+=	-DPROGRAM_NAME=anope
@@ -23,6 +24,32 @@ CMAKE_ARGS+=	-DLIB_DIR=lib/anope
 CMAKE_ARGS+=	-DLOCALE_DIR=${PKGLOCALEDIR}/locale
 CMAKE_ARGS+=	-DLOGS_DIR=anope/logs
 
+.include "../../mk/bsd.prefs.mk"
+
+ANOPE_USER?=		anope
+ANOPE_GROUP?=		anope
+PKG_GROUPS=		${ANOPE_GROUP}
+PKG_USERS=		${ANOPE_USER}:${ANOPE_GROUP}
+PKG_GROUPS_VARS=	ANOPE_USER
+PKG_USERS_VARS=		ANOPE_GROUP
+
+OWN_DIRS_PERMS+=	${PREFIX}/anope ${ANOPE_USER} ${ANOPE_GROUP} 0755
+OWN_DIRS_PERMS+=	${PREFIX}/anope/data ${ANOPE_USER} ${ANOPE_GROUP} 0755
+OWN_DIRS_PERMS+=	${PREFIX}/anope/logs ${ANOPE_USER} ${ANOPE_GROUP} 0755
+
+FILES_SUBST+=		ANOPE_GROUP=${ANOPE_GROUP:Q}
+FILES_SUBST+=		ANOPE_USER=${ANOPE_USER:Q}
+
+SUBST_CLASSES+=		conf
+SUBST_STAGE.conf=	pre-configure
+SUBST_MESSAGE.conf=	Set variables in configuration file.
+SUBST_FILES.conf+=	data/example.conf
+SUBST_SED.conf+=	-e "s,@PREFIX@,${PREFIX},g"
+SUBST_SED.conf+=	-e "s,@PKG_SYSCONFDIR@,${PKG_SYSCONFDIR},g"
+SUBST_SED.conf+=	-e "s,@PKGLOCALEDIR@,${PKGLOCALEDIR},g"
+
+RCD_SCRIPTS=	anope
+
 EGDIR=		${PREFIX}/share/examples/anope
 DOCDIR=		${PREFIX}/share/doc/anope
 
diff --git a/anope/distinfo b/anope/distinfo
index af2fbae5f3..d9c35195c6 100644
--- a/anope/distinfo
+++ b/anope/distinfo
@@ -4,4 +4,4 @@ SHA1 (anope-2.0.6-source.tar.gz) = bba0c947657f7388da2980241bc11b03f9f64743
 RMD160 (anope-2.0.6-source.tar.gz) = 1771ee896cf30f9962abec56aed3a5f71f17b8e0
 SHA512 (anope-2.0.6-source.tar.gz) = c100758d6159023832bc7a4dceb7d554a9b3cd9120b033efc9a93c7ff28e76a086d0594b66b9cd2946b231421217674990f2a3ebaa8a6598c2a25e2dafd1b65b
 Size (anope-2.0.6-source.tar.gz) = 1792912 bytes
-SHA1 (patch-data_example.conf) = 567577ec635e311cd8089c2a91896e1b8e6caf71
+SHA1 (patch-data_example.conf) = 0adb909df1a7fa0ed7c96433f37119d90b0516db
diff --git a/anope/files/anope.sh b/anope/files/anope.sh
new file mode 100644
index 0000000000..14d3619b6d
--- /dev/null
+++ b/anope/files/anope.sh
@@ -0,0 +1,25 @@
+#!@RCD_SCRIPTS_SHELL@
+#
+# $NetBSD$
+#
+# PROVIDE: anope
+# REQUIRE: DAEMON
+
+. /etc/rc.subr
+
+name="anope"
+rcvar=${name}
+command="@PREFIX@/bin/anope"
+command_args="--confdir=@PKG_SYSCONFDIR@/anope"
+command_args="${command_args} --dbdir=@PREFIX@/anope/data"
+command_args="${command_args} --localedir=@PREFIX/@PKGLOCALEDIR@/locale"
+command_args="${command_args} --logdir=@PREFIX@/anope/logs"
+command_args="${command_args} --modulesdir=@PREFIX@/lib/anope"
+required_files="@PKG_SYSCONFDIR@/anope/services.conf"
+pidfile="@PREFIX@/anope/${name}.pid"
+
+anope_user="@ANOPE_USER@"
+anope_group="@ANOPE_GROUP@"
+
+load_rc_config $name
+run_rc_command "$1"
diff --git a/anope/patches/patch-data_example.conf b/anope/patches/patch-data_example.conf
index 99baa434a0..dc74798fee 100644
--- a/anope/patches/patch-data_example.conf
+++ b/anope/patches/patch-data_example.conf
@@ -4,6 +4,22 @@ Fix config file filenames for pkgsrc's CONF_FILES system.
 
 --- data/example.conf.orig	2017-03-30 21:00:24.000000000 +0000
 +++ data/example.conf
+@@ -231,13 +231,13 @@ serverinfo
+ 	 * The filename containing the Services process ID. The path is relative to the
+ 	 * services root directory.
+ 	 */
+-	pid = "data/services.pid"
++	pid = "@PREFIX@/anope/anope.pid"
+ 
+ 	/*
+ 	 * The filename containing the Message of the Day. The path is relative to the
+ 	 * services root directory.
+ 	 */
+-	motd = "conf/services.motd"
++	motd = "@PKG_SYSCONFDIR@/anope/services.motd"
+ }
+ 
+ /*
 @@ -560,7 +560,7 @@ options
  include
  {


Home | Main Index | Thread Index | Old Index