summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorspz <spz@pkgsrc.org>2022-07-26 19:08:02 +0000
committerspz <spz@pkgsrc.org>2022-07-26 19:08:02 +0000
commit2f4906b2604490fff80adc800ab67a0a60c5c191 (patch)
tree9b29779e49b4feadb64d2f616843d2c4cccd61f5
parentf1b3b1b9b6fdfffb795cfe1fe44ccc0420c48803 (diff)
downloadpkgsrc-2f4906b2604490fff80adc800ab67a0a60c5c191.tar.gz
Pullup ticket #6649 - requested by khorben
chat/prosody: integration fix Revisions pulled up: - chat/prosody/Makefile 1.38-1.40 - chat/prosody/files/prosody.sh 1.3-1.5 ------------------------------------------------------------------- Module Name: pkgsrc Committed By: khorben Date: Thu Jul 7 01:53:00 UTC 2022 Modified Files: pkgsrc/chat/prosody: Makefile pkgsrc/chat/prosody/files: prosody.sh Log Message: prosody: fix the path to the PID file in the RC script PROSODY_RUN is set to eg /var/run/prosody/prosody.pid instead of just /var/run/prosody.pid, which is a good thing (tm) since prosody's user needs the access rights to write to the corresponding directory. Unfortunately, the directory is not automatically created nor the right permissions set yet, but this is progress. While there, appease pkglint(1). Bumps PKGREVISION. Tested on NetBSD/amd64. XXX pull-up to pkgsrc-2022Q2 once the complete solution is in place To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 pkgsrc/chat/prosody/Makefile cvs rdiff -u -r1.2 -r1.3 pkgsrc/chat/prosody/files/prosody.sh ------------------------------------------------------------------- Module Name: pkgsrc Committed By: khorben Date: Thu Jul 7 02:31:46 UTC 2022 Modified Files: pkgsrc/chat/prosody: Makefile pkgsrc/chat/prosody/files: prosody.sh Log Message: prosody: make sure pidfile always matches PROSODY_RUN in the RC script This concludes my investigation on the correct path for the PID file. No changes to the final binary if PROSODY_RUN is set to its default value. Tested on NetBSD/amd64. XXX pull-up to pkgsrc-2022Q2 To generate a diff of this commit: cvs rdiff -u -r1.38 -r1.39 pkgsrc/chat/prosody/Makefile cvs rdiff -u -r1.3 -r1.4 pkgsrc/chat/prosody/files/prosody.sh ------------------------------------------------------------------- Module Name: pkgsrc Committed By: khorben Date: Mon Jul 25 04:47:07 UTC 2022 Modified Files: pkgsrc/chat/prosody: Makefile pkgsrc/chat/prosody/files: prosody.sh Log Message: chat/prosody: always create the directory for the PID file The RC script for prosody now always creates the corresponding sub-directory for prosody's PID file. This is inspired by the RC script for mdnsd in NetBSD, and for dbus in pkgsrc; thanks spz@ for the suggestion! Bumps PKGREVISION. Tested on NetBSD/amd64. XXX pull-up to pkgsrc-2022Q2 (completes request 6649) To generate a diff of this commit: cvs rdiff -u -r1.39 -r1.40 pkgsrc/chat/prosody/Makefile cvs rdiff -u -r1.4 -r1.5 pkgsrc/chat/prosody/files/prosody.sh
-rw-r--r--chat/prosody/Makefile10
-rw-r--r--chat/prosody/files/prosody.sh15
2 files changed, 19 insertions, 6 deletions
diff --git a/chat/prosody/Makefile b/chat/prosody/Makefile
index 7ccdb43a9ae..b8e60436d18 100644
--- a/chat/prosody/Makefile
+++ b/chat/prosody/Makefile
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.37 2022/05/08 21:24:12 khorben Exp $
+# $NetBSD: Makefile,v 1.37.2.1 2022/07/26 19:08:02 spz Exp $
DISTNAME= prosody-0.12.0
+PKGREVISION= 2
CATEGORIES= chat
MASTER_SITES= https://prosody.im/downloads/source/
@@ -16,7 +17,7 @@ DEPENDS+= ${LUA_PKGPREFIX}-socket>=2.0:../../net/lua-socket
DEPENDS+= ${LUA_PKGPREFIX}-unbound-[0-9]*:../../net/lua-unbound
HAS_CONFIGURE= yes
-USE_LANGUAGES= c99
+USE_LANGUAGES= c
BUILD_DEFS+= VARBASE
LUA_VERSIONS_ACCEPTED= 52 51
@@ -53,7 +54,7 @@ SUBST_CLASSES+= path
SUBST_MESSAGE.path= Fixing default paths
SUBST_STAGE.path= pre-configure
SUBST_FILES.path= makefile prosody.cfg.lua.dist
-SUBST_SED.path= -e 's,$$(CONFIG),$$(DESTDIR)$(EGDIR),g'
+SUBST_SED.path= -e 's,$$(CONFIG),$${DESTDIR}${EGDIR},g'
SUBST_VARS.path= EGDIR PROSODY_DATA PROSODY_LOG PROSODY_RUN
CONFIGURE_ARGS+= --cflags=${CFLAGS:Q}
@@ -69,6 +70,9 @@ MAKE_ENV.SunOS+= SOCKET_LIB=-lsocket
MAKE_FILE= makefile
RCD_SCRIPTS= prosody
+FILES_SUBST+= PROSODY_RUN=${PROSODY_RUN}
+FILES_SUBST+= PROSODY_USER=${PROSODY_USER}
+FILES_SUBST+= PROSODY_GROUP=${PROSODY_GROUP}
TEST_TARGET= test
diff --git a/chat/prosody/files/prosody.sh b/chat/prosody/files/prosody.sh
index f8fd2c411c1..40b554d10be 100644
--- a/chat/prosody/files/prosody.sh
+++ b/chat/prosody/files/prosody.sh
@@ -1,6 +1,6 @@
#!@RCD_SCRIPTS_SHELL@
#
-# $NetBSD: prosody.sh,v 1.2 2021/08/29 18:32:29 khorben Exp $
+# $NetBSD: prosody.sh,v 1.2.8.1 2022/07/26 19:08:02 spz Exp $
#
# PROVIDE: prosody
# REQUIRE: DAEMON
@@ -13,10 +13,19 @@ name="prosody"
rcvar=${name}
ctl_command="@PREFIX@/bin/${name}ctl"
required_files="@PKG_SYSCONFDIR@/${name}.cfg.lua"
-pidfile="@VARBASE@/run/${name}.pid"
-#start_precmd="ulimit -n 2048"
+pidfile="@PROSODY_RUN@/${name}.pid"
+start_precmd="prosody_precmd"
extra_commands="reload status"
+prosody_precmd()
+{
+ if [ ! -d @PROSODY_RUN@ ]; then
+ @MKDIR@ -m 0755 @PROSODY_RUN@
+ fi
+ @CHOWN@ @PROSODY_USER@:@PROSODY_GROUP@ @PROSODY_RUN@
+ #ulimit -n 2048
+}
+
start_cmd="${ctl_command} start"
stop_cmd="${ctl_command} stop"
reload_cmd="${ctl_command} reload"