aboutsummaryrefslogtreecommitdiff
path: root/net-im/prosody
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2020-03-04 19:47:53 +0000
committerKurt Jaeger <pi@FreeBSD.org>2020-03-04 19:47:53 +0000
commitbaee6b2d5e1190143630a3c3a88b276142bcd901 (patch)
tree757daa1bc238d0c5f13681c3cdeb3a930fa124c5 /net-im/prosody
parentfc84d9d97f8720718ed8abdbf705e9dfc989b872 (diff)
downloadports-baee6b2d5e1190143630a3c3a88b276142bcd901.tar.gz
ports-baee6b2d5e1190143630a3c3a88b276142bcd901.zip
net-im/prosody: refactor and move to lua 5.2
- Use Lua 5.2 and drop support for the dead LuaJIT. - Explicitly state all required configure options as the "freebsd" preset has some of them wrong. - Do not install the example certs as they clutter the config directory and nobody should ever use them. They can be recreated with prosodyctl if needed. - Remove the broken "daemonize" option from the rc script, handle all actions with "prosodyctl" instead. - Change data directory from /usr/local/var/lib/prosody to /var/db/prosody and include instructions in UPDATING - Install the prosody migrator - Use arc4random PR: 241619 Submitted by: thomas@beingboiled.info Reviewed by: lx (maintainer), Sascha Biberhofer <ports@skyforge.at> Approved by: lx (maintainer timeout)
Notes
Notes: svn path=/head/; revision=527796
Diffstat (limited to 'net-im/prosody')
-rw-r--r--net-im/prosody/Makefile46
-rw-r--r--net-im/prosody/files/patch-GNUmakefile11
-rw-r--r--net-im/prosody/files/patch-tools_migration_Makefile28
-rw-r--r--net-im/prosody/files/patch-util-src_time.c6
-rw-r--r--net-im/prosody/files/pkg-deinstall.in3
-rw-r--r--net-im/prosody/files/prosody.in22
-rw-r--r--net-im/prosody/pkg-plist19
7 files changed, 76 insertions, 59 deletions
diff --git a/net-im/prosody/Makefile b/net-im/prosody/Makefile
index 16228e744aef..aacafd3264a9 100644
--- a/net-im/prosody/Makefile
+++ b/net-im/prosody/Makefile
@@ -3,6 +3,7 @@
PORTNAME= prosody
PORTVERSION= 0.11.4
+PORTREVISION= 1
CATEGORIES= net-im
MASTER_SITES= http://prosody.im/downloads/source/ \
http://redundancy.redundancy.org/mirror/
@@ -13,27 +14,30 @@ COMMENT= Simple extensible XMPP server written in Lua
LICENSE= MIT
LICENSE_FILE= ${WRKSRC}/COPYING
-RUN_DEPENDS= ${LUA_MODLIBDIR}/socket/core.so:net/luasocket-51 \
- ${LUA_MODLIBDIR}/ssl.so:security/luasec-51 \
- ${LUA_MODLIBDIR}/lxp.so:textproc/luaexpat-51 \
- ${LUA_MODLIBDIR}/lfs.so:devel/luafilesystem-51 \
- ${LUA_MODLIBDIR}/bit.so:devel/lua51-bitop
+RUN_DEPENDS= ${LUA_MODLIBDIR}/socket/core.so:net/luasocket \
+ ${LUA_MODLIBDIR}/ssl.so:security/luasec \
+ ${LUA_MODLIBDIR}/lxp.so:textproc/luaexpat \
+ ${LUA_MODLIBDIR}/lfs.so:devel/luafilesystem \
+ ${LUA_MODLIBDIR}/bit.so:devel/lua-bitop
LIB_DEPENDS= libidn.so:dns/libidn
-USES= compiler:c11 cpe gmake lua:51 shebangfix ssl
-SHEBANG_FILES= prosody prosodyctl
+USES= compiler:c11 cpe gmake lua:52 ssl
LUA_PREMK= yes
HAS_CONFIGURE= yes
-CFLAGS+= -I${OPENSSLINC}
-LDFLAGS+= -L${OPENSSLLIB}
-CONFIGURE_ARGS= --ostype=freebsd \
- --c-compiler="${CC}" \
- --linker="${CC}" \
- --with-lua-include="${LUA_INCDIR}" \
+CONFIGURE_ARGS= --prefix="${PREFIX}" \
+ --datadir="/var/db/prosody" \
+ --lua-version="${LUA_VER}" \
--lua-suffix="${LUA_VER_STR}" \
--with-lua-include="${LUA_INCDIR}" \
--with-lua-lib="${LUA_LIBDIR}" \
- --prefix="${PREFIX}"
+ --with-random=arc4random \
+ --c-compiler="${CC}" \
+ --cflags="${CFLAGS}" \
+ --add-cflags="-fPIC -std=c99 -I${LOCALBASE}/include -I${OPENSSLINC}" \
+ --linker="${CC}" \
+ --ldflags="${LDFLAGS}" \
+ --add-ldflags="-shared -L${LOCALBASE}/lib -L${OPENSSLLIB}" \
+ --no-example-certs
MAKEFILE= GNUmakefile
USERS= prosody
@@ -47,19 +51,9 @@ PLIST_SUB= PROSODY_USER=${USERS} \
PROSODY_GROUP=${GROUPS} \
PROSODY_GROUP_regex=\b${GROUPS}\b
-OPTIONS_DEFINE= LUAJIT
-LUAJIT_DESC= Run prosody using luajit
-LUAJIT_LIB_DEPENDS= libluajit-5.1.so:lang/luajit
-
-.include <bsd.port.options.mk>
-
-.if ${PORT_OPTIONS:MLUAJIT}
-lua_CMD= ${LOCALBASE}/bin/luajit
-.else
-lua_CMD= ${LOCALBASE}/bin/${LUA_CMD}
-.endif
-
post-install:
@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/prosody/util/*.so
+ @${MKDIR} ${STAGEDIR}/var/run/prosody
+ @${RM} ${STAGEDIR}${ETCDIR}/certs/*
.include <bsd.port.mk>
diff --git a/net-im/prosody/files/patch-GNUmakefile b/net-im/prosody/files/patch-GNUmakefile
index a3a7d777ef21..21b4816e9ceb 100644
--- a/net-im/prosody/files/patch-GNUmakefile
+++ b/net-im/prosody/files/patch-GNUmakefile
@@ -1,6 +1,6 @@
---- GNUmakefile.orig 2018-12-01 14:51:46.042219000 +0000
-+++ GNUmakefile 2018-12-01 14:52:30.212140000 +0000
-@@ -6,7 +6,7 @@
+--- GNUmakefile.orig 2020-01-02 09:49:37 UTC
++++ GNUmakefile
+@@ -6,7 +6,7 @@ CONFIG = $(DESTDIR)$(SYSCONFDIR)
MODULES = $(DESTDIR)$(LIBDIR)/prosody/modules
SOURCE = $(DESTDIR)$(LIBDIR)/prosody
DATA = $(DESTDIR)$(DATADIR)
@@ -9,7 +9,7 @@
INSTALLEDSOURCE = $(LIBDIR)/prosody
INSTALLEDCONFIG = $(SYSCONFDIR)
-@@ -57,7 +57,7 @@
+@@ -57,9 +57,10 @@ install: prosody.install prosodyctl.install prosody.cf
$(INSTALL_DATA) plugins/mod_mam/*.lua $(MODULES)/mod_mam
$(INSTALL_DATA) certs/* $(CONFIG)/certs
$(INSTALL_DATA) man/prosodyctl.man $(MAN)/man1/prosodyctl.1
@@ -17,4 +17,7 @@
+ $(INSTALL_DATA) prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua.sample
-test -f prosody.version && $(INSTALL_DATA) prosody.version $(SOURCE)/prosody.version
$(MAKE) install -C util-src
++ $(MAKE) install -C tools/migration
+ clean:
+ rm -f prosody.install
diff --git a/net-im/prosody/files/patch-tools_migration_Makefile b/net-im/prosody/files/patch-tools_migration_Makefile
new file mode 100644
index 000000000000..402539a70b3b
--- /dev/null
+++ b/net-im/prosody/files/patch-tools_migration_Makefile
@@ -0,0 +1,28 @@
+--- tools/migration/Makefile.orig 2020-01-02 09:49:37 UTC
++++ tools/migration/Makefile
+@@ -5,7 +5,7 @@ BIN = $(DESTDIR)$(PREFIX)/bin
+ CONFIG = $(DESTDIR)$(SYSCONFDIR)
+ SOURCE = $(DESTDIR)$(LIBDIR)/prosody
+ DATA = $(DESTDIR)$(DATADIR)
+-MAN = $(DESTDIR)$(PREFIX)/share/man
++MAN = $(DESTDIR)$(PREFIX)/man
+
+ INSTALLEDSOURCE = $(LIBDIR)/prosody
+ INSTALLEDCONFIG = $(SYSCONFDIR)
+@@ -22,14 +22,14 @@ install: prosody-migrator.install migrator.cfg.lua.ins
+ install -d $(SOURCE)/migrator
+ install -m755 ./prosody-migrator.install $(BIN)/prosody-migrator
+ install -m644 $(SOURCE_FILES) $(SOURCE)/migrator
+- test -e $(CONFIG)/migrator.cfg.lua || install -m644 migrator.cfg.lua.install $(CONFIG)/migrator.cfg.lua
++ install -m644 migrator.cfg.lua.install $(CONFIG)/migrator.cfg.lua.sample
+
+ clean:
+ rm -f prosody-migrator.install
+ rm -f migrator.cfg.lua.install
+
+ prosody-migrator.install: prosody-migrator.lua
+- sed "1s/\blua\b/$(RUNWITH)/; \
++ sed "1s/ lua$$/ $(RUNWITH)/; \
+ s|^CFG_SOURCEDIR=.*;$$|CFG_SOURCEDIR='$(INSTALLEDSOURCE)';|; \
+ s|^CFG_CONFIGDIR=.*;$$|CFG_CONFIGDIR='$(INSTALLEDCONFIG)';|;" \
+ < prosody-migrator.lua > prosody-migrator.install
diff --git a/net-im/prosody/files/patch-util-src_time.c b/net-im/prosody/files/patch-util-src_time.c
index 8a7fa2383fc1..4339e8c3fb36 100644
--- a/net-im/prosody/files/patch-util-src_time.c
+++ b/net-im/prosody/files/patch-util-src_time.c
@@ -1,9 +1,9 @@
---- util-src/time.c.orig 2018-12-01 10:50:51.975557000 +0000
-+++ util-src/time.c 2018-12-01 10:51:05.667316000 +0000
+--- util-src/time.c.orig 2020-01-02 09:49:37 UTC
++++ util-src/time.c
@@ -1,5 +1,5 @@
#ifndef _POSIX_C_SOURCE
-#define _POSIX_C_SOURCE 199309L
+#define _POSIX_C_SOURCE 200809L
#endif
-
+
#include <time.h>
diff --git a/net-im/prosody/files/pkg-deinstall.in b/net-im/prosody/files/pkg-deinstall.in
index ac4bcbaf9a96..c7187a9d3074 100644
--- a/net-im/prosody/files/pkg-deinstall.in
+++ b/net-im/prosody/files/pkg-deinstall.in
@@ -17,7 +17,8 @@ POST-DEINSTALL)
echo " pw groupdel -n %%GROUPS%%"
echo ""
echo " and to remove all server data:"
- echo " rm -rf /usr/local/var/lib/prosody"
+ echo " rm -rf /var/db/prosody"
+ echo " rm -rf /var/run/prosody"
echo ""
;;
esac
diff --git a/net-im/prosody/files/prosody.in b/net-im/prosody/files/prosody.in
index 3faf2501f198..54a3ac861a22 100644
--- a/net-im/prosody/files/prosody.in
+++ b/net-im/prosody/files/prosody.in
@@ -15,32 +15,22 @@
. /etc/rc.subr
name="prosody"
-rcvar=prosody_enable
+rcvar="prosody_enable"
command="%%PREFIX%%/bin/prosodyctl"
load_rc_config $name
prosody_enable=${prosody_enable:-"NO"}
-pidfile=${prosody_pidfile:-"%%PREFIX%%/var/lib/prosody/prosody.pid"}
+pidfile=${prosody_pidfile:-"/var/run/prosody/prosody.pid"}
-extra_commands="reload status"
-
-start_cmd="prosody_start"
+extra_commands="reload"
+start_cmd="prosody_cmd start"
stop_cmd="prosody_cmd stop"
reload_cmd="prosody_cmd reload"
-restart_cmd="$stop_cmd; $start_cmd"
+restart_cmd="prosody_cmd restart"
status_cmd="prosody_cmd status"
-prosody_start()
-{
- config="%%PREFIX%%/etc/prosody/prosody.cfg.lua"
- if grep -q '^daemonize[[:blank:]]*=[[:blank:]]*false' $config; then
- # Prosody's not going to daemonize on its own, use daemon(8)
- daemon $command start
- else
- $command start
- fi
-}
+export PATH="%%PREFIX%%/bin:$PATH"
prosody_cmd()
{
diff --git a/net-im/prosody/pkg-plist b/net-im/prosody/pkg-plist
index ace9a2edc655..d7e9872e684f 100644
--- a/net-im/prosody/pkg-plist
+++ b/net-im/prosody/pkg-plist
@@ -1,13 +1,8 @@
bin/prosody
bin/prosodyctl
-%%ETCDIR%%/certs/GNUmakefile
-%%ETCDIR%%/certs/example.com.crt
-%%ETCDIR%%/certs/example.com.key
-%%ETCDIR%%/certs/localhost.cnf
-%%ETCDIR%%/certs/localhost.crt
-%%ETCDIR%%/certs/localhost.key
-%%ETCDIR%%/certs/makefile
-%%ETCDIR%%/certs/openssl.cnf
+bin/prosody-migrator
+@dir %%ETCDIR%%/certs
+@sample %%ETCDIR%%/migrator.cfg.lua.sample
@sample %%ETCDIR%%/prosody.cfg.lua.sample
%%LUA_LIBDIR%%/prosody/core/certmanager.lua
%%LUA_LIBDIR%%/prosody/core/configmanager.lua
@@ -23,6 +18,10 @@ bin/prosodyctl
%%LUA_LIBDIR%%/prosody/core/statsmanager.lua
%%LUA_LIBDIR%%/prosody/core/storagemanager.lua
%%LUA_LIBDIR%%/prosody/core/usermanager.lua
+%%LUA_LIBDIR%%/prosody/migrator/jabberd14.lua
+%%LUA_LIBDIR%%/prosody/migrator/mtools.lua
+%%LUA_LIBDIR%%/prosody/migrator/prosody_files.lua
+%%LUA_LIBDIR%%/prosody/migrator/prosody_sql.lua
%%LUA_LIBDIR%%/prosody/modules/adhoc/adhoc.%%LUA_LIBDIR%%.lua
%%LUA_LIBDIR%%/prosody/modules/adhoc/mod_adhoc.lua
%%LUA_LIBDIR%%/prosody/modules/mod_admin_adhoc.lua
@@ -144,6 +143,7 @@ bin/prosodyctl
%%LUA_LIBDIR%%/prosody/util/cache.lua
%%LUA_LIBDIR%%/prosody/util/caps.lua
%%LUA_LIBDIR%%/prosody/util/compat.so
+%%LUA_LIBDIR%%/prosody/util/crand.so
%%LUA_LIBDIR%%/prosody/util/dataforms.lua
%%LUA_LIBDIR%%/prosody/util/datamanager.lua
%%LUA_LIBDIR%%/prosody/util/datetime.lua
@@ -216,4 +216,5 @@ bin/prosodyctl
%%LUA_LIBDIR%%/prosody/util/xmppstream.lua
%%LUA_LIBDIR%%/prosody/util/xpcall.lua
man/man1/prosodyctl.1.gz
-@dir(%%PROSODY_USER%%,%%PROSODY_GROUP%%,) var/%%LUA_LIBDIR%%/prosody
+@dir(%%PROSODY_USER%%,%%PROSODY_GROUP%%,) /var/db/prosody
+@dir(%%PROSODY_USER%%,%%PROSODY_GROUP%%,) /var/run/prosody