Gentoo Archives: gentoo-commits

From: Conrad Kostecki <conikost@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-im/prosody/files/, net-im/prosody/
Date: Sat, 10 Oct 2020 15:57:40
Message-Id: 1602345443.21185d1a53f9597691eff67f05f7ac4fa0a3c769.conikost@gentoo
1 commit: 21185d1a53f9597691eff67f05f7ac4fa0a3c769
2 Author: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
3 AuthorDate: Sat Oct 10 15:53:20 2020 +0000
4 Commit: Conrad Kostecki <conikost <AT> gentoo <DOT> org>
5 CommitDate: Sat Oct 10 15:57:23 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21185d1a
7
8 net-im/prosody: switch to bit32, update init scripts
9
10 Since dev-lua/LuaBitOp is not supported on >=lua-5.2, switching to
11 dev-lua/lua-bit32 as an alternative, since it's supported by upstream.
12
13 Also updated the init scripts, since starting with prosodyctl is not
14 recomended and current init scripts warns about not using it.
15
16 Closes: https://bugs.gentoo.org/407079
17 Package-Manager: Portage-3.0.8, Repoman-3.0.1
18 Signed-off-by: Conrad Kostecki <conikost <AT> gentoo.org>
19
20 net-im/prosody/files/prosody-0.11.7-bit32.patch | 20 +++++
21 net-im/prosody/files/prosody-0.11.7-gentoo.patch | 29 +++++++
22 net-im/prosody/files/prosody.initd-r4 | 43 +++++++++++
23 net-im/prosody/files/prosody.service-r1 | 13 ++++
24 net-im/prosody/files/prosody.tmpfilesd-r1 | 1 +
25 net-im/prosody/prosody-0.11.7-r1.ebuild | 96 ++++++++++++++++++++++++
26 6 files changed, 202 insertions(+)
27
28 diff --git a/net-im/prosody/files/prosody-0.11.7-bit32.patch b/net-im/prosody/files/prosody-0.11.7-bit32.patch
29 new file mode 100644
30 index 00000000000..fb7b55f6bbe
31 --- /dev/null
32 +++ b/net-im/prosody/files/prosody-0.11.7-bit32.patch
33 @@ -0,0 +1,20 @@
34 +# HG changeset patch
35 +# User Kim Alvefur <zash@××××.se>
36 +# Date 1601928749 -7200
37 +# Node ID e17b98feb0b7cad6539ee25c5cc7728911349a6d
38 +# Parent c3eefb517b7b934dbf4f78244c18f7e91b852846
39 +util.dependencies: Check for bitop library same way as net.websocket.frames (fixes #1594)
40 +
41 +diff -r c3eefb517b7b -r e17b98feb0b7 util/dependencies.lua
42 +--- a/util/dependencies.lua
43 ++++ b/util/dependencies.lua
44 +@@ -90,7 +90,7 @@
45 + }, "SSL/TLS support will not be available");
46 + end
47 +
48 +- local bit = _G.bit32 or softreq"bit";
49 ++ local bit = softreq"bit" or softreq"bit32";
50 +
51 + if not bit then
52 + missingdep("lua-bitops", {
53 +
54
55 diff --git a/net-im/prosody/files/prosody-0.11.7-gentoo.patch b/net-im/prosody/files/prosody-0.11.7-gentoo.patch
56 new file mode 100644
57 index 00000000000..e571066874b
58 --- /dev/null
59 +++ b/net-im/prosody/files/prosody-0.11.7-gentoo.patch
60 @@ -0,0 +1,29 @@
61 +--- a/prosody.cfg.lua.dist
62 ++++ b/prosody.cfg.lua.dist
63 +@@ -17,6 +17,15 @@
64 + -- Settings in this section apply to the whole server and are the default settings
65 + -- for any virtual hosts
66 +
67 ++-- Prosody will use this user and group for launching the service.
68 ++-- Gentoo uses by default jabber:jabber (uid:gid) for all Jabber related services.
69 ++prosody_user = "jabber"
70 ++prosody_group = "jabber"
71 ++
72 ++-- Prosody will create this pid file after it has been successfully started.
73 ++-- Please don't change that path, as it's being used by the Gentoo init scripts.
74 ++pidfile = "/run/jabber/prosody.pid"
75 ++
76 + -- This is a (by default, empty) list of accounts that are admins
77 + -- for the server. Note that you must create the accounts separately
78 + -- (see https://prosody.im/doc/creating_accounts for info)
79 +@@ -30,7 +39,9 @@
80 + -- Prosody will always look in its source directory for modules, but
81 + -- this option allows you to specify additional locations where Prosody
82 + -- will look for modules first. For community modules, see https://modules.prosody.im/
83 +---plugin_paths = {}
84 ++-- The default included path is for the optional net-im/prosody-modules package,
85 ++-- which provides additional community maintained modules.
86 ++plugin_paths = { "/usr/GENTOO_LIBDIR/prosody/community-modules" };
87 +
88 + -- This is the list of modules Prosody will load on startup.
89 + -- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too.
90
91 diff --git a/net-im/prosody/files/prosody.initd-r4 b/net-im/prosody/files/prosody.initd-r4
92 new file mode 100644
93 index 00000000000..1282e9dc456
94 --- /dev/null
95 +++ b/net-im/prosody/files/prosody.initd-r4
96 @@ -0,0 +1,43 @@
97 +#!/sbin/openrc-run
98 +# Copyright 1999-2020 Gentoo Authors
99 +# Distributed under the terms of the GNU General Public License v2
100 +
101 +name="Prosody XMPP server"
102 +extra_started_commands="reload"
103 +jabber_pid="/run/jabber"
104 +jabber_logs="/var/log/jabber"
105 +pidfile="${jabber_pid}/prosody.pid"
106 +prosody_config="/etc/jabber/prosody.cfg.lua"
107 +
108 +command="/usr/bin/prosody"
109 +command_group="jabber"
110 +command_user="jabber"
111 +
112 +checkconfig() {
113 + if [ ! -f "${prosody_config}" ]; then
114 + eerror "Please create ${prosody_config} before starting Prosody!"
115 + return 1
116 + fi
117 +
118 + luac -p "${prosody_config}"
119 + return $?
120 +}
121 +
122 +depend() {
123 + need net
124 + provide jabber-server
125 + use dns postgresql
126 +}
127 +
128 +reload() {
129 + ebegin "Reloading configuration"
130 + start-stop-daemon --signal HUP --pidfile "${pidfile}"
131 + eend $?
132 +}
133 +
134 +start_pre() {
135 + checkconfig || return 1
136 +
137 + checkpath -d -m 0750 -o "${command_user}:${command_group}" -q "${jabber_logs}"
138 + checkpath -d -m 0750 -o "${command_user}:${command_group}" -q "${jabber_pid}"
139 +}
140
141 diff --git a/net-im/prosody/files/prosody.service-r1 b/net-im/prosody/files/prosody.service-r1
142 new file mode 100644
143 index 00000000000..608423869fd
144 --- /dev/null
145 +++ b/net-im/prosody/files/prosody.service-r1
146 @@ -0,0 +1,13 @@
147 +[Unit]
148 +Description=Prosody XMPP server
149 +After=network.target
150 +
151 +[Service]
152 +Group=jabber
153 +PIDFile=/run/jabber/prosody.pid
154 +ExecStart=/usr/bin/prosody
155 +ExecReload=/usr/bin/kill -HUP $MAINPID
156 +User=jabber
157 +
158 +[Install]
159 +WantedBy=multi-user.target
160
161 diff --git a/net-im/prosody/files/prosody.tmpfilesd-r1 b/net-im/prosody/files/prosody.tmpfilesd-r1
162 new file mode 100644
163 index 00000000000..7fcdd539dec
164 --- /dev/null
165 +++ b/net-im/prosody/files/prosody.tmpfilesd-r1
166 @@ -0,0 +1 @@
167 +d /run/jabber 750 jabber jabber - -
168
169 diff --git a/net-im/prosody/prosody-0.11.7-r1.ebuild b/net-im/prosody/prosody-0.11.7-r1.ebuild
170 new file mode 100644
171 index 00000000000..89566c865a5
172 --- /dev/null
173 +++ b/net-im/prosody/prosody-0.11.7-r1.ebuild
174 @@ -0,0 +1,96 @@
175 +# Copyright 1999-2020 Gentoo Authors
176 +# Distributed under the terms of the GNU General Public License v2
177 +
178 +EAPI=7
179 +
180 +inherit systemd tmpfiles toolchain-funcs
181 +
182 +DESCRIPTION="Prosody is a modern XMPP communication server"
183 +HOMEPAGE="https://prosody.im/"
184 +SRC_URI="https://prosody.im/downloads/source/${P}.tar.gz"
185 +
186 +LICENSE="MIT"
187 +SLOT="0"
188 +KEYWORDS="~amd64 ~arm ~x86"
189 +IUSE="+libevent libressl luajit mysql postgres +sqlite +ssl test +zlib"
190 +RESTRICT="!test? ( test )"
191 +
192 +COMMON_DEPEND="
193 + || (
194 + >=dev-lang/lua-5.2:*
195 + dev-lua/lua-bit32
196 + )
197 + net-dns/libidn
198 + net-im/jabber-base
199 + libressl? ( dev-libs/libressl:= )
200 + !libressl? ( dev-libs/openssl:0= )
201 + luajit? ( dev-lang/luajit:2 )
202 + !luajit? ( dev-lang/lua:0 )
203 +"
204 +
205 +DEPEND="
206 + ${COMMON_DEPEND}
207 + test? ( dev-lua/busted )
208 +"
209 +
210 +RDEPEND="
211 + ${COMMON_DEPEND}
212 + dev-lua/luaexpat
213 + dev-lua/luafilesystem
214 + dev-lua/luasocket
215 + libevent? ( dev-lua/luaevent )
216 + mysql? ( dev-lua/luadbi[mysql] )
217 + postgres? ( dev-lua/luadbi[postgres] )
218 + sqlite? ( dev-lua/luadbi[sqlite] )
219 + ssl? ( dev-lua/luasec )
220 + zlib? ( dev-lua/lua-zlib )
221 +"
222 +
223 +PATCHES=(
224 + "${FILESDIR}/${PN}-0.11.7-bit32.patch"
225 + "${FILESDIR}/${PN}-0.11.7-gentoo.patch"
226 +)
227 +
228 +src_prepare() {
229 + default
230 +
231 + # Set correct plugin path for optional net-im/prosody-modules package
232 + sed -e "s/GENTOO_LIBDIR/$(get_libdir)/g" -i prosody.cfg.lua.dist || die
233 +}
234 +
235 +src_configure() {
236 + local myeconfargs=(
237 + --c-compiler="$(tc-getCC)"
238 + --datadir="${EPREFIX}/var/spool/jabber"
239 + --libdir="${EPREFIX}/usr/$(get_libdir)"
240 + --linker="$(tc-getCC)"
241 + --ostype="linux"
242 + --prefix="${EPREFIX}/usr"
243 + --runwith="$(usex luajit luajit lua)"
244 + --sysconfdir="${EPREFIX}/etc/jabber"
245 + --with-lua-include="${EPREFIX}/usr/include"
246 + --with-lua-lib="${EPREFIX}/usr/$(get_libdir)/lua"
247 + )
248 +
249 + # Since the configure script is handcrafted,
250 + # and yells at unknown options, do not use 'econf'.
251 + ./configure ${myeconfargs[@]} --cflags="${CFLAGS} -Wall -fPIC" --ldflags="${LDFLAGS} -shared" || die
252 +
253 + rm makefile || die
254 + mv GNUmakefile Makefile || die
255 +}
256 +
257 +src_install() {
258 + default
259 +
260 + newinitd "${FILESDIR}"/prosody.initd-r4 prosody
261 + systemd_newunit "${FILESDIR}"/prosody.service-r1 prosody.service
262 +
263 + newtmpfiles "${FILESDIR}"/prosody.tmpfilesd-r1 prosody.conf
264 +
265 + keepdir /var/spool/jabber
266 +}
267 +
268 +pkg_postinst() {
269 + tmpfiles_process prosody.conf
270 +}