commit: 854a066195255ea06c385b8768ea0f751e320169 parent 8f7d4ac2ed49927dc3e8b543d379a6f2a46aec71 Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me> Date: Sat, 26 Jun 2021 10:17:00 +0200 net-im/prosody: Temporary new ebuild until 0.12.0Diffstat:
A | net-im/prosody/files/prosody-0.11.7-gentoo.patch | 29 | +++++++++++++++++++++++++++++ |
A | net-im/prosody/files/prosody.initd-r5 | 44 | ++++++++++++++++++++++++++++++++++++++++++++ |
A | net-im/prosody/files/prosody.service-r2 | 13 | +++++++++++++ |
A | net-im/prosody/files/prosody.tmpfilesd-r1 | 1 | + |
A | net-im/prosody/metadata.xml | 19 | +++++++++++++++++++ |
A | net-im/prosody/prosody-0.11.9999.ebuild | 101 | +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
6 files changed, 207 insertions(+), 0 deletions(-)
diff --git a/net-im/prosody/files/prosody-0.11.7-gentoo.patch 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-r5 b/net-im/prosody/files/prosody.initd-r5 @@ -0,0 +1,44 @@ +#!/sbin/openrc-run +# Copyright 1999-2021 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" +commandctl="/usr/bin/prosodyctl" +command_group="jabber" +command_user="jabber" + +checkconfig() { + if [ ! -f "${prosody_config}" ]; then + eerror "Please create ${prosody_config} before starting Prosody!" + return 1 + fi + + ${commandctl} check 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-r2 b/net-im/prosody/files/prosody.service-r2 @@ -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=/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 @@ -0,0 +1 @@ +d /run/jabber 750 jabber jabber - - diff --git a/net-im/prosody/metadata.xml b/net-im/prosody/metadata.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="person" proxied="yes"> + <email>contact@hacktivis.me</email> + <name>Haelwenn (lanodan) Monnier</name> + </maintainer> + <longdescription> + Prosody is a modern XMPP communication server. + It aims to be easy to set up and configure, + and efficient with system resources. + Additionally, for developers it aims to be easy to extend + and give a flexible system on which to rapidly develop + added functionality, or prototype new protocols. + </longdescription> + <use> + <flag name="libevent">Use libevent for event handling</flag> + </use> +</pkgmetadata> diff --git a/net-im/prosody/prosody-0.11.9999.ebuild b/net-im/prosody/prosody-0.11.9999.ebuild @@ -0,0 +1,101 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +LUA_COMPAT=( lua5-{1..3} luajit ) +LUA_REQ_USE="deprecated(+)" + +inherit lua-single systemd tmpfiles toolchain-funcs mercurial + +DESCRIPTION="Prosody is a modern XMPP communication server" +HOMEPAGE="https://prosody.im/" +EHG_REPO_URI="https://hg.prosody.im/trunk" + +LICENSE="MIT" +SLOT="0" +IUSE="icu +idn +libevent mysql postgres selinux +sqlite +ssl test +zlib" +REQUIRED_USE=" + ^^ ( icu idn ) + ${LUA_REQUIRED_USE} +" +RESTRICT="!test? ( test )" + +DEPEND=" + $(lua_gen_cond_dep 'dev-lua/luaexpat[${LUA_USEDEP}]') + $(lua_gen_cond_dep 'dev-lua/luafilesystem[${LUA_USEDEP}]') + $(lua_gen_cond_dep 'dev-lua/luasocket[${LUA_USEDEP}]') + net-im/jabber-base + icu? ( dev-libs/icu:= ) + idn? ( net-dns/libidn:= ) + libevent? ( $(lua_gen_cond_dep 'dev-lua/luaevent[${LUA_USEDEP}]') ) + dev-libs/openssl:0= + lua_single_target_lua5-1? ( $(lua_gen_cond_dep 'dev-lua/lua-bit32[lua_targets_lua5-1(-)]') ) + mysql? ( $(lua_gen_cond_dep 'dev-lua/luadbi[mysql,${LUA_USEDEP}]') ) + postgres? ( $(lua_gen_cond_dep 'dev-lua/luadbi[postgres,${LUA_USEDEP}]') ) + sqlite? ( $(lua_gen_cond_dep 'dev-lua/luadbi[sqlite,${LUA_USEDEP}]') ) + ssl? ( $(lua_gen_cond_dep 'dev-lua/luasec[${LUA_USEDEP}]') ) + zlib? ( $(lua_gen_cond_dep 'dev-lua/lua-zlib[${LUA_USEDEP}]') ) + ${LUA_DEPS} +" + +RDEPEND=" + ${DEPEND} + selinux? ( sec-policy/selinux-jabber ) +" + +BDEPEND=" + virtual/pkgconfig + test? ( $(lua_gen_cond_dep 'dev-lua/busted[${LUA_USEDEP}]') ) +" + +PATCHES=( "${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=( + --add-cflags="${CFLAGS}" + --add-ldflags="${LDFLAGS}" + --c-compiler="$(tc-getCC)" + --datadir="${EPREFIX}/var/spool/jabber" + --idn-library="$(usex idn 'idn' 'icu')" + --libdir="${EPREFIX}/usr/$(get_libdir)" + --linker="$(tc-getCC)" + --lua-version="$(usex lua_single_target_luajit '5.1' $(ver_cut 1-2 $(lua_get_version)))" + --no-example-certs + --ostype="linux" + --prefix="${EPREFIX}/usr" + --runwith="${ELUA}" + --sysconfdir="${EPREFIX}/etc/jabber" + --with-lua-include="${EPREFIX}/$(lua_get_include_dir)" + --with-lua-lib="${EPREFIX}/$(lua_get_cmod_dir)" + ) + + # Since the configure script is handcrafted, + # and yells at unknown options, do not use 'econf'. + ./configure "${myeconfargs[@]}" || die + + rm makefile || die + mv GNUmakefile Makefile || die +} + +src_install() { + default + + keepdir /var/spool/jabber + + newinitd "${FILESDIR}"/prosody.initd-r5 prosody + systemd_newunit "${FILESDIR}"/prosody.service-r2 prosody.service + + newtmpfiles "${FILESDIR}"/prosody.tmpfilesd-r1 prosody.conf +} + +pkg_postinst() { + tmpfiles_process prosody.conf +}