View | Details | Raw Unified | Return to bug 241619 | Differences between
and this patch

Collapse All | Expand All

(-)Makefile (-26 / +20 lines)
Lines 1-10 Link Here
1
# Created by: Andrew Lewis <freeghb@gmail.com>
1
# Created by: Andrew Lewis <freeghb@gmail.com>
2
# $FreeBSD: head/net-im/prosody/Makefile 522848 2020-01-13 03:30:07Z koobs $
2
# $FreeBSD: head/net-im/prosody/Makefile 522848 2020-01-13 03:30:07Z koobs $
3
3
4
PORTNAME=	prosody
4
PORTNAME=	prosody
5
PORTVERSION=	0.11.3
5
PORTVERSION=	0.11.3
6
PORTREVISION=	1
6
CATEGORIES=	net-im
7
CATEGORIES=	net-im
7
MASTER_SITES=	http://prosody.im/downloads/source/ \
8
MASTER_SITES=	http://prosody.im/downloads/source/ \
8
		http://redundancy.redundancy.org/mirror/
9
		http://redundancy.redundancy.org/mirror/
9
10
10
MAINTAINER=	lx@FreeBSD.org
11
MAINTAINER=	lx@FreeBSD.org
Lines 11-41 Link Here
11
COMMENT=	Simple extensible XMPP server written in Lua
12
COMMENT=	Simple extensible XMPP server written in Lua
12
13
13
LICENSE=	MIT
14
LICENSE=	MIT
14
LICENSE_FILE=	${WRKSRC}/COPYING
15
LICENSE_FILE=	${WRKSRC}/COPYING
15
16
16
RUN_DEPENDS=	${LUA_MODLIBDIR}/socket/core.so:net/luasocket-51 \
17
RUN_DEPENDS=	${LUA_MODLIBDIR}/socket/core.so:net/luasocket \
17
		${LUA_MODLIBDIR}/ssl.so:security/luasec-51 \
18
		${LUA_MODLIBDIR}/ssl.so:security/luasec \
18
		${LUA_MODLIBDIR}/lxp.so:textproc/luaexpat-51 \
19
		${LUA_MODLIBDIR}/lxp.so:textproc/luaexpat \
19
		${LUA_MODLIBDIR}/lfs.so:devel/luafilesystem-51 \
20
		${LUA_MODLIBDIR}/lfs.so:devel/luafilesystem \
20
		${LUA_MODLIBDIR}/bit.so:devel/lua51-bitop
21
		${LUA_MODLIBDIR}/bit.so:devel/lua-bitop
21
LIB_DEPENDS=	libidn.so:dns/libidn
22
LIB_DEPENDS=	libidn.so:dns/libidn
22
23
23
USES=		compiler:c11 cpe gmake lua:51 shebangfix ssl
24
USES=		compiler:c11 cpe gmake lua:52 ssl
24
SHEBANG_FILES=	prosody prosodyctl
25
LUA_PREMK=	yes
25
LUA_PREMK=	yes
26
HAS_CONFIGURE=	yes
26
HAS_CONFIGURE=	yes
27
CFLAGS+=	-I${OPENSSLINC}
27
CONFIGURE_ARGS=	--prefix="${PREFIX}" \
28
LDFLAGS+=	-L${OPENSSLLIB}
28
		--datadir="/var/db/prosody" \
29
CONFIGURE_ARGS=	--ostype=freebsd \
29
		--lua-version="${LUA_VER}" \
30
		--c-compiler="${CC}" \
31
		--linker="${CC}" \
32
		--with-lua-include="${LUA_INCDIR}" \
33
		--lua-suffix="${LUA_VER_STR}" \
30
		--lua-suffix="${LUA_VER_STR}" \
34
		--with-lua-include="${LUA_INCDIR}" \
31
		--with-lua-include="${LUA_INCDIR}" \
35
		--with-lua-lib="${LUA_LIBDIR}" \
32
		--with-lua-lib="${LUA_LIBDIR}" \
36
		--prefix="${PREFIX}"
33
		--with-random=arc4random \
34
		--c-compiler="${CC}" \
35
		--cflags="${CFLAGS}" \
36
		--add-cflags="-fPIC -std=c99 -I${LOCALBASE}/include -I${OPENSSLINC}" \
37
		--linker="${CC}" \
38
		--ldflags="${LDFLAGS}" \
39
		--add-ldflags="-shared -L${LOCALBASE}/lib -L${OPENSSLLIB}" \
40
		--no-example-certs
37
41
38
MAKEFILE=	GNUmakefile
42
MAKEFILE=	GNUmakefile
39
USERS=		prosody
43
USERS=		prosody
40
GROUPS=		${USERS}
44
GROUPS=		${USERS}
41
45
Lines 45-65 Link Here
45
PLIST_SUB=	PROSODY_USER=${USERS} \
49
PLIST_SUB=	PROSODY_USER=${USERS} \
46
		PROSODY_USER_regex=\b${USERS}\b \
50
		PROSODY_USER_regex=\b${USERS}\b \
47
		PROSODY_GROUP=${GROUPS} \
51
		PROSODY_GROUP=${GROUPS} \
48
		PROSODY_GROUP_regex=\b${GROUPS}\b
52
		PROSODY_GROUP_regex=\b${GROUPS}\b
49
53
50
OPTIONS_DEFINE=	LUAJIT
51
LUAJIT_DESC=		Run prosody using luajit
52
LUAJIT_LIB_DEPENDS=	libluajit-5.1.so:lang/luajit
53
54
.include <bsd.port.options.mk>
55
56
.if ${PORT_OPTIONS:MLUAJIT}
57
lua_CMD=	${LOCALBASE}/bin/luajit
58
.else
59
lua_CMD=	${LOCALBASE}/bin/${LUA_CMD}
60
.endif
61
62
post-install:
54
post-install:
63
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/prosody/util/*.so
55
	@${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/prosody/util/*.so
56
	@${MKDIR} ${STAGEDIR}/var/run/prosody
57
	@${RM} ${STAGEDIR}${ETCDIR}/certs/*
64
58
65
.include <bsd.port.mk>
59
.include <bsd.port.mk>
(-)files/patch-GNUmakefile (-3 / +6 lines)
Lines 1-20 Link Here
1
--- GNUmakefile.orig	2018-12-01 14:51:46.042219000 +0000
1
--- GNUmakefile.orig	2019-10-28 19:01:52.415208000 +0100
2
+++ GNUmakefile	2018-12-01 14:52:30.212140000 +0000
2
+++ GNUmakefile	2019-10-28 19:02:47.367580000 +0100
3
@@ -6,7 +6,7 @@
3
@@ -6,7 +6,7 @@
4
 MODULES = $(DESTDIR)$(LIBDIR)/prosody/modules
4
 MODULES = $(DESTDIR)$(LIBDIR)/prosody/modules
5
 SOURCE = $(DESTDIR)$(LIBDIR)/prosody
5
 SOURCE = $(DESTDIR)$(LIBDIR)/prosody
6
 DATA = $(DESTDIR)$(DATADIR)
6
 DATA = $(DESTDIR)$(DATADIR)
7
-MAN = $(DESTDIR)$(PREFIX)/share/man
7
-MAN = $(DESTDIR)$(PREFIX)/share/man
8
+MAN = $(DESTDIR)$(PREFIX)/man
8
+MAN = $(DESTDIR)$(PREFIX)/man
9
 
9
 
10
 INSTALLEDSOURCE = $(LIBDIR)/prosody
10
 INSTALLEDSOURCE = $(LIBDIR)/prosody
11
 INSTALLEDCONFIG = $(SYSCONFDIR)
11
 INSTALLEDCONFIG = $(SYSCONFDIR)
12
@@ -57,7 +57,7 @@
12
@@ -57,9 +57,10 @@
13
 	$(INSTALL_DATA) plugins/mod_mam/*.lua $(MODULES)/mod_mam
13
 	$(INSTALL_DATA) plugins/mod_mam/*.lua $(MODULES)/mod_mam
14
 	$(INSTALL_DATA) certs/* $(CONFIG)/certs
14
 	$(INSTALL_DATA) certs/* $(CONFIG)/certs
15
 	$(INSTALL_DATA) man/prosodyctl.man $(MAN)/man1/prosodyctl.1
15
 	$(INSTALL_DATA) man/prosodyctl.man $(MAN)/man1/prosodyctl.1
16
-	test -f $(CONFIG)/prosody.cfg.lua || $(INSTALL_DATA) prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua
16
-	test -f $(CONFIG)/prosody.cfg.lua || $(INSTALL_DATA) prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua
17
+	$(INSTALL_DATA) prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua.sample
17
+	$(INSTALL_DATA) prosody.cfg.lua.install $(CONFIG)/prosody.cfg.lua.sample
18
 	-test -f prosody.version && $(INSTALL_DATA) prosody.version $(SOURCE)/prosody.version
18
 	-test -f prosody.version && $(INSTALL_DATA) prosody.version $(SOURCE)/prosody.version
19
 	$(MAKE) install -C util-src
19
 	$(MAKE) install -C util-src
20
+	$(MAKE) install -C tools/migration
20
 
21
 
22
 clean:
23
 	rm -f prosody.install
(-)files/patch-migration (+39 lines)
Line 0 Link Here
1
--- tools/migration/Makefile.orig
2
+++ tools/migration/Makefile
3
@@ -3,11 +3,11 @@
4
 
5
 BIN = $(DESTDIR)$(PREFIX)/bin
6
 CONFIG = $(DESTDIR)$(SYSCONFDIR)
7
 SOURCE = $(DESTDIR)$(LIBDIR)/prosody
8
 DATA = $(DESTDIR)$(DATADIR)
9
-MAN = $(DESTDIR)$(PREFIX)/share/man
10
+MAN = $(DESTDIR)$(PREFIX)/man
11
 
12
 INSTALLEDSOURCE = $(LIBDIR)/prosody
13
 INSTALLEDCONFIG = $(SYSCONFDIR)
14
 INSTALLEDMODULES = $(LIBDIR)/prosody/modules
15
 INSTALLEDDATA = $(DATADIR)
16
@@ -20,20 +20,20 @@
17
 	install -d $(BIN) $(CONFIG) $(SOURCE) $(SOURCE)/migrator
18
 	install -d $(MAN)/man1
19
 	install -d $(SOURCE)/migrator
20
 	install -m755 ./prosody-migrator.install $(BIN)/prosody-migrator
21
 	install -m644 $(SOURCE_FILES) $(SOURCE)/migrator
22
-	test -e $(CONFIG)/migrator.cfg.lua || install -m644 migrator.cfg.lua.install $(CONFIG)/migrator.cfg.lua
23
+	install -m644 migrator.cfg.lua.install $(CONFIG)/migrator.cfg.lua.sample
24
 
25
 clean:
26
 	rm -f prosody-migrator.install
27
 	rm -f migrator.cfg.lua.install
28
 
29
 prosody-migrator.install: prosody-migrator.lua
30
-	sed "1s/\blua\b/$(RUNWITH)/; \
31
+	sed "1s/ lua$$/ $(RUNWITH)/; \
32
 		s|^CFG_SOURCEDIR=.*;$$|CFG_SOURCEDIR='$(INSTALLEDSOURCE)';|; \
33
 		s|^CFG_CONFIGDIR=.*;$$|CFG_CONFIGDIR='$(INSTALLEDCONFIG)';|;" \
34
 			< prosody-migrator.lua > prosody-migrator.install
35
 
36
 migrator.cfg.lua.install: migrator.cfg.lua
37
 	sed "s|^local data_path = .*;$$|local data_path = '$(INSTALLEDDATA)';|;" \
38
 		< migrator.cfg.lua > migrator.cfg.lua.install
39
(-)files/pkg-deinstall.in (-1 / +2 lines)
Lines 15-24 Link Here
15
	echo ""
15
	echo ""
16
	echo "     pw userdel -n %%USERS%%"
16
	echo "     pw userdel -n %%USERS%%"
17
	echo "     pw groupdel -n %%GROUPS%%"
17
	echo "     pw groupdel -n %%GROUPS%%"
18
	echo ""
18
	echo ""
19
	echo "     and to remove all server data:"
19
	echo "     and to remove all server data:"
20
	echo "     rm -rf  /usr/local/var/lib/prosody"
20
	echo "     rm -rf /var/db/prosody"
21
	echo "     rm -rf /var/run/prosody"
21
	echo ""
22
	echo ""
22
	;;
23
	;;
23
esac
24
esac
24
exit 0
25
exit 0
(-)files/prosody.in (-17 / +7 lines)
Lines 13-50 Link Here
13
#                Set it to YES to enable Prosody
13
#                Set it to YES to enable Prosody
14
14
15
. /etc/rc.subr
15
. /etc/rc.subr
16
16
17
name="prosody"
17
name="prosody"
18
rcvar=prosody_enable
18
rcvar="prosody_enable"
19
command="%%PREFIX%%/bin/prosodyctl"
19
command="prosodyctl"
20
20
21
load_rc_config $name
21
load_rc_config $name
22
22
23
prosody_enable=${prosody_enable:-"NO"}
23
prosody_enable=${prosody_enable:-"NO"}
24
pidfile=${prosody_pidfile:-"%%PREFIX%%/var/lib/prosody/prosody.pid"}
24
pidfile=${prosody_pidfile:-"/var/run/prosody/prosody.pid"}
25
25
26
extra_commands="reload status"
26
extra_commands="reload"
27
27
start_cmd="prosody_cmd start"
28
start_cmd="prosody_start"
29
stop_cmd="prosody_cmd stop"
28
stop_cmd="prosody_cmd stop"
30
reload_cmd="prosody_cmd reload"
29
reload_cmd="prosody_cmd reload"
31
restart_cmd="$stop_cmd; $start_cmd"
30
restart_cmd="prosody_cmd restart"
32
status_cmd="prosody_cmd status"
31
status_cmd="prosody_cmd status"
33
32
34
prosody_start()
33
export PATH="%%PREFIX%%/bin:$PATH"
35
{
36
	config="%%PREFIX%%/etc/prosody/prosody.cfg.lua"
37
	if grep -q '^daemonize[[:blank:]]*=[[:blank:]]*false' $config; then
38
		# Prosody's not going to daemonize on its own, use daemon(8)
39
		daemon $command start
40
	else
41
		$command start
42
	fi
43
}
44
34
45
prosody_cmd()
35
prosody_cmd()
46
{
36
{
47
	$command $1
37
	$command $1
48
}
38
}
49
39
50
run_rc_command "$1"
40
run_rc_command "$1"
(-)pkg-plist (-9 / +10 lines)
Lines 1-15 Link Here
1
bin/prosody
1
bin/prosody
2
bin/prosodyctl
2
bin/prosodyctl
3
%%ETCDIR%%/certs/GNUmakefile
3
bin/prosody-migrator
4
%%ETCDIR%%/certs/example.com.crt
4
@dir %%ETCDIR%%/certs
5
%%ETCDIR%%/certs/example.com.key
5
@sample %%ETCDIR%%/migrator.cfg.lua.sample
6
%%ETCDIR%%/certs/localhost.cnf
7
%%ETCDIR%%/certs/localhost.crt
8
%%ETCDIR%%/certs/localhost.key
9
%%ETCDIR%%/certs/makefile
10
%%ETCDIR%%/certs/openssl.cnf
11
@sample %%ETCDIR%%/prosody.cfg.lua.sample
6
@sample %%ETCDIR%%/prosody.cfg.lua.sample
12
%%LUA_LIBDIR%%/prosody/core/certmanager.lua
7
%%LUA_LIBDIR%%/prosody/core/certmanager.lua
13
%%LUA_LIBDIR%%/prosody/core/configmanager.lua
8
%%LUA_LIBDIR%%/prosody/core/configmanager.lua
14
%%LUA_LIBDIR%%/prosody/core/hostmanager.lua
9
%%LUA_LIBDIR%%/prosody/core/hostmanager.lua
15
%%LUA_LIBDIR%%/prosody/core/loggingmanager.lua
10
%%LUA_LIBDIR%%/prosody/core/loggingmanager.lua
Lines 21-30 Link Here
21
%%LUA_LIBDIR%%/prosody/core/sessionmanager.lua
16
%%LUA_LIBDIR%%/prosody/core/sessionmanager.lua
22
%%LUA_LIBDIR%%/prosody/core/stanza_router.lua
17
%%LUA_LIBDIR%%/prosody/core/stanza_router.lua
23
%%LUA_LIBDIR%%/prosody/core/statsmanager.lua
18
%%LUA_LIBDIR%%/prosody/core/statsmanager.lua
24
%%LUA_LIBDIR%%/prosody/core/storagemanager.lua
19
%%LUA_LIBDIR%%/prosody/core/storagemanager.lua
25
%%LUA_LIBDIR%%/prosody/core/usermanager.lua
20
%%LUA_LIBDIR%%/prosody/core/usermanager.lua
21
%%LUA_LIBDIR%%/prosody/migrator/jabberd14.lua
22
%%LUA_LIBDIR%%/prosody/migrator/mtools.lua
23
%%LUA_LIBDIR%%/prosody/migrator/prosody_files.lua
24
%%LUA_LIBDIR%%/prosody/migrator/prosody_sql.lua
26
%%LUA_LIBDIR%%/prosody/modules/adhoc/adhoc.%%LUA_LIBDIR%%.lua
25
%%LUA_LIBDIR%%/prosody/modules/adhoc/adhoc.%%LUA_LIBDIR%%.lua
27
%%LUA_LIBDIR%%/prosody/modules/adhoc/mod_adhoc.lua
26
%%LUA_LIBDIR%%/prosody/modules/adhoc/mod_adhoc.lua
28
%%LUA_LIBDIR%%/prosody/modules/mod_admin_adhoc.lua
27
%%LUA_LIBDIR%%/prosody/modules/mod_admin_adhoc.lua
29
%%LUA_LIBDIR%%/prosody/modules/mod_admin_telnet.lua
28
%%LUA_LIBDIR%%/prosody/modules/mod_admin_telnet.lua
30
%%LUA_LIBDIR%%/prosody/modules/mod_announce.lua
29
%%LUA_LIBDIR%%/prosody/modules/mod_announce.lua
Lines 142-151 Link Here
142
%%LUA_LIBDIR%%/prosody/util/array.lua
141
%%LUA_LIBDIR%%/prosody/util/array.lua
143
%%LUA_LIBDIR%%/prosody/util/async.lua
142
%%LUA_LIBDIR%%/prosody/util/async.lua
144
%%LUA_LIBDIR%%/prosody/util/cache.lua
143
%%LUA_LIBDIR%%/prosody/util/cache.lua
145
%%LUA_LIBDIR%%/prosody/util/caps.lua
144
%%LUA_LIBDIR%%/prosody/util/caps.lua
146
%%LUA_LIBDIR%%/prosody/util/compat.so
145
%%LUA_LIBDIR%%/prosody/util/compat.so
146
%%LUA_LIBDIR%%/prosody/util/crand.so
147
%%LUA_LIBDIR%%/prosody/util/dataforms.lua
147
%%LUA_LIBDIR%%/prosody/util/dataforms.lua
148
%%LUA_LIBDIR%%/prosody/util/datamanager.lua
148
%%LUA_LIBDIR%%/prosody/util/datamanager.lua
149
%%LUA_LIBDIR%%/prosody/util/datetime.lua
149
%%LUA_LIBDIR%%/prosody/util/datetime.lua
150
%%LUA_LIBDIR%%/prosody/util/debug.lua
150
%%LUA_LIBDIR%%/prosody/util/debug.lua
151
%%LUA_LIBDIR%%/prosody/util/dependencies.lua
151
%%LUA_LIBDIR%%/prosody/util/dependencies.lua
Lines 214-219 Link Here
214
%%LUA_LIBDIR%%/prosody/util/x509.lua
214
%%LUA_LIBDIR%%/prosody/util/x509.lua
215
%%LUA_LIBDIR%%/prosody/util/xml.lua
215
%%LUA_LIBDIR%%/prosody/util/xml.lua
216
%%LUA_LIBDIR%%/prosody/util/xmppstream.lua
216
%%LUA_LIBDIR%%/prosody/util/xmppstream.lua
217
%%LUA_LIBDIR%%/prosody/util/xpcall.lua
217
%%LUA_LIBDIR%%/prosody/util/xpcall.lua
218
man/man1/prosodyctl.1.gz
218
man/man1/prosodyctl.1.gz
219
@dir(%%PROSODY_USER%%,%%PROSODY_GROUP%%,) var/%%LUA_LIBDIR%%/prosody
219
@dir(%%PROSODY_USER%%,%%PROSODY_GROUP%%,) /var/db/prosody
220
@dir(%%PROSODY_USER%%,%%PROSODY_GROUP%%,) /var/run/prosody

Return to bug 241619