From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 0AF86138359 for ; Sat, 10 Oct 2020 15:57:40 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 116C1E080E; Sat, 10 Oct 2020 15:57:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DF299E080E for ; Sat, 10 Oct 2020 15:57:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 6C178340DF6 for ; Sat, 10 Oct 2020 15:57:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id D2574EC for ; Sat, 10 Oct 2020 15:57:35 +0000 (UTC) From: "Conrad Kostecki" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Conrad Kostecki" Message-ID: <1602345443.21185d1a53f9597691eff67f05f7ac4fa0a3c769.conikost@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: net-im/prosody/files/, net-im/prosody/ X-VCS-Repository: repo/gentoo X-VCS-Files: net-im/prosody/files/prosody-0.11.7-bit32.patch net-im/prosody/files/prosody-0.11.7-gentoo.patch net-im/prosody/files/prosody.initd-r4 net-im/prosody/files/prosody.service-r1 net-im/prosody/files/prosody.tmpfilesd-r1 net-im/prosody/prosody-0.11.7-r1.ebuild X-VCS-Directories: net-im/prosody/ net-im/prosody/files/ X-VCS-Committer: conikost X-VCS-Committer-Name: Conrad Kostecki X-VCS-Revision: 21185d1a53f9597691eff67f05f7ac4fa0a3c769 X-VCS-Branch: master Date: Sat, 10 Oct 2020 15:57:35 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 76876524-3f7e-4723-b4f2-9fcbb47e1eef X-Archives-Hash: 00be8d72a52e1528b6f5c88f3280c07c commit: 21185d1a53f9597691eff67f05f7ac4fa0a3c769 Author: Conrad Kostecki gentoo org> AuthorDate: Sat Oct 10 15:53:20 2020 +0000 Commit: Conrad Kostecki gentoo org> CommitDate: Sat Oct 10 15:57:23 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21185d1a net-im/prosody: switch to bit32, update init scripts Since dev-lua/LuaBitOp is not supported on >=lua-5.2, switching to dev-lua/lua-bit32 as an alternative, since it's supported by upstream. Also updated the init scripts, since starting with prosodyctl is not recomended and current init scripts warns about not using it. Closes: https://bugs.gentoo.org/407079 Package-Manager: Portage-3.0.8, Repoman-3.0.1 Signed-off-by: Conrad Kostecki gentoo.org> net-im/prosody/files/prosody-0.11.7-bit32.patch | 20 +++++ net-im/prosody/files/prosody-0.11.7-gentoo.patch | 29 +++++++ net-im/prosody/files/prosody.initd-r4 | 43 +++++++++++ net-im/prosody/files/prosody.service-r1 | 13 ++++ net-im/prosody/files/prosody.tmpfilesd-r1 | 1 + net-im/prosody/prosody-0.11.7-r1.ebuild | 96 ++++++++++++++++++++++++ 6 files changed, 202 insertions(+) diff --git a/net-im/prosody/files/prosody-0.11.7-bit32.patch b/net-im/prosody/files/prosody-0.11.7-bit32.patch new file mode 100644 index 00000000000..fb7b55f6bbe --- /dev/null +++ b/net-im/prosody/files/prosody-0.11.7-bit32.patch @@ -0,0 +1,20 @@ +# HG changeset patch +# User Kim Alvefur +# Date 1601928749 -7200 +# Node ID e17b98feb0b7cad6539ee25c5cc7728911349a6d +# Parent c3eefb517b7b934dbf4f78244c18f7e91b852846 +util.dependencies: Check for bitop library same way as net.websocket.frames (fixes #1594) + +diff -r c3eefb517b7b -r e17b98feb0b7 util/dependencies.lua +--- a/util/dependencies.lua ++++ b/util/dependencies.lua +@@ -90,7 +90,7 @@ + }, "SSL/TLS support will not be available"); + end + +- local bit = _G.bit32 or softreq"bit"; ++ local bit = softreq"bit" or softreq"bit32"; + + if not bit then + missingdep("lua-bitops", { + diff --git a/net-im/prosody/files/prosody-0.11.7-gentoo.patch b/net-im/prosody/files/prosody-0.11.7-gentoo.patch new file mode 100644 index 00000000000..e571066874b --- /dev/null +++ b/net-im/prosody/files/prosody-0.11.7-gentoo.patch @@ -0,0 +1,29 @@ +--- a/prosody.cfg.lua.dist ++++ b/prosody.cfg.lua.dist +@@ -17,6 +17,15 @@ + -- Settings in this section apply to the whole server and are the default settings + -- for any virtual hosts + ++-- Prosody will use this user and group for launching the service. ++-- Gentoo uses by default jabber:jabber (uid:gid) for all Jabber related services. ++prosody_user = "jabber" ++prosody_group = "jabber" ++ ++-- Prosody will create this pid file after it has been successfully started. ++-- Please don't change that path, as it's being used by the Gentoo init scripts. ++pidfile = "/run/jabber/prosody.pid" ++ + -- This is a (by default, empty) list of accounts that are admins + -- for the server. Note that you must create the accounts separately + -- (see https://prosody.im/doc/creating_accounts for info) +@@ -30,7 +39,9 @@ + -- Prosody will always look in its source directory for modules, but + -- this option allows you to specify additional locations where Prosody + -- will look for modules first. For community modules, see https://modules.prosody.im/ +---plugin_paths = {} ++-- The default included path is for the optional net-im/prosody-modules package, ++-- which provides additional community maintained modules. ++plugin_paths = { "/usr/GENTOO_LIBDIR/prosody/community-modules" }; + + -- This is the list of modules Prosody will load on startup. + -- It looks for mod_modulename.lua in the plugins folder, so make sure that exists too. diff --git a/net-im/prosody/files/prosody.initd-r4 b/net-im/prosody/files/prosody.initd-r4 new file mode 100644 index 00000000000..1282e9dc456 --- /dev/null +++ b/net-im/prosody/files/prosody.initd-r4 @@ -0,0 +1,43 @@ +#!/sbin/openrc-run +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +name="Prosody XMPP server" +extra_started_commands="reload" +jabber_pid="/run/jabber" +jabber_logs="/var/log/jabber" +pidfile="${jabber_pid}/prosody.pid" +prosody_config="/etc/jabber/prosody.cfg.lua" + +command="/usr/bin/prosody" +command_group="jabber" +command_user="jabber" + +checkconfig() { + if [ ! -f "${prosody_config}" ]; then + eerror "Please create ${prosody_config} before starting Prosody!" + return 1 + fi + + luac -p "${prosody_config}" + return $? +} + +depend() { + need net + provide jabber-server + use dns postgresql +} + +reload() { + ebegin "Reloading configuration" + start-stop-daemon --signal HUP --pidfile "${pidfile}" + eend $? +} + +start_pre() { + checkconfig || return 1 + + checkpath -d -m 0750 -o "${command_user}:${command_group}" -q "${jabber_logs}" + checkpath -d -m 0750 -o "${command_user}:${command_group}" -q "${jabber_pid}" +} diff --git a/net-im/prosody/files/prosody.service-r1 b/net-im/prosody/files/prosody.service-r1 new file mode 100644 index 00000000000..608423869fd --- /dev/null +++ b/net-im/prosody/files/prosody.service-r1 @@ -0,0 +1,13 @@ +[Unit] +Description=Prosody XMPP server +After=network.target + +[Service] +Group=jabber +PIDFile=/run/jabber/prosody.pid +ExecStart=/usr/bin/prosody +ExecReload=/usr/bin/kill -HUP $MAINPID +User=jabber + +[Install] +WantedBy=multi-user.target diff --git a/net-im/prosody/files/prosody.tmpfilesd-r1 b/net-im/prosody/files/prosody.tmpfilesd-r1 new file mode 100644 index 00000000000..7fcdd539dec --- /dev/null +++ b/net-im/prosody/files/prosody.tmpfilesd-r1 @@ -0,0 +1 @@ +d /run/jabber 750 jabber jabber - - diff --git a/net-im/prosody/prosody-0.11.7-r1.ebuild b/net-im/prosody/prosody-0.11.7-r1.ebuild new file mode 100644 index 00000000000..89566c865a5 --- /dev/null +++ b/net-im/prosody/prosody-0.11.7-r1.ebuild @@ -0,0 +1,96 @@ +# Copyright 1999-2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit systemd tmpfiles toolchain-funcs + +DESCRIPTION="Prosody is a modern XMPP communication server" +HOMEPAGE="https://prosody.im/" +SRC_URI="https://prosody.im/downloads/source/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~amd64 ~arm ~x86" +IUSE="+libevent libressl luajit mysql postgres +sqlite +ssl test +zlib" +RESTRICT="!test? ( test )" + +COMMON_DEPEND=" + || ( + >=dev-lang/lua-5.2:* + dev-lua/lua-bit32 + ) + net-dns/libidn + net-im/jabber-base + libressl? ( dev-libs/libressl:= ) + !libressl? ( dev-libs/openssl:0= ) + luajit? ( dev-lang/luajit:2 ) + !luajit? ( dev-lang/lua:0 ) +" + +DEPEND=" + ${COMMON_DEPEND} + test? ( dev-lua/busted ) +" + +RDEPEND=" + ${COMMON_DEPEND} + dev-lua/luaexpat + dev-lua/luafilesystem + dev-lua/luasocket + libevent? ( dev-lua/luaevent ) + mysql? ( dev-lua/luadbi[mysql] ) + postgres? ( dev-lua/luadbi[postgres] ) + sqlite? ( dev-lua/luadbi[sqlite] ) + ssl? ( dev-lua/luasec ) + zlib? ( dev-lua/lua-zlib ) +" + +PATCHES=( + "${FILESDIR}/${PN}-0.11.7-bit32.patch" + "${FILESDIR}/${PN}-0.11.7-gentoo.patch" +) + +src_prepare() { + default + + # Set correct plugin path for optional net-im/prosody-modules package + sed -e "s/GENTOO_LIBDIR/$(get_libdir)/g" -i prosody.cfg.lua.dist || die +} + +src_configure() { + local myeconfargs=( + --c-compiler="$(tc-getCC)" + --datadir="${EPREFIX}/var/spool/jabber" + --libdir="${EPREFIX}/usr/$(get_libdir)" + --linker="$(tc-getCC)" + --ostype="linux" + --prefix="${EPREFIX}/usr" + --runwith="$(usex luajit luajit lua)" + --sysconfdir="${EPREFIX}/etc/jabber" + --with-lua-include="${EPREFIX}/usr/include" + --with-lua-lib="${EPREFIX}/usr/$(get_libdir)/lua" + ) + + # Since the configure script is handcrafted, + # and yells at unknown options, do not use 'econf'. + ./configure ${myeconfargs[@]} --cflags="${CFLAGS} -Wall -fPIC" --ldflags="${LDFLAGS} -shared" || die + + rm makefile || die + mv GNUmakefile Makefile || die +} + +src_install() { + default + + newinitd "${FILESDIR}"/prosody.initd-r4 prosody + systemd_newunit "${FILESDIR}"/prosody.service-r1 prosody.service + + newtmpfiles "${FILESDIR}"/prosody.tmpfilesd-r1 prosody.conf + + keepdir /var/spool/jabber +} + +pkg_postinst() { + tmpfiles_process prosody.conf +}