summaryrefslogtreecommitdiff
path: root/net-im/prosody
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-03-20 00:40:44 +0000
commit4cbcc855382a06088e2f016f62cafdbcb7e40665 (patch)
tree356496503d52354aa6d9f2d36126302fed5f3a73 /net-im/prosody
parentfcc5224904648a8e6eb528d7603154160a20022f (diff)
gentoo resync : 20.03.2022
Diffstat (limited to 'net-im/prosody')
-rw-r--r--net-im/prosody/Manifest10
-rw-r--r--net-im/prosody/files/prosody-0.12.0-gentoo.patch29
-rw-r--r--net-im/prosody/files/prosody.initd-r646
-rw-r--r--net-im/prosody/files/prosody.service-r317
-rw-r--r--net-im/prosody/files/prosody.tmpfilesd-r21
-rw-r--r--net-im/prosody/prosody-0.11.12.ebuild102
-rw-r--r--net-im/prosody/prosody-0.11.13.ebuild2
-rw-r--r--net-im/prosody/prosody-0.12.0.ebuild164
8 files changed, 265 insertions, 106 deletions
diff --git a/net-im/prosody/Manifest b/net-im/prosody/Manifest
index cd3642707cec..12cffc0ca87a 100644
--- a/net-im/prosody/Manifest
+++ b/net-im/prosody/Manifest
@@ -1,9 +1,13 @@
AUX prosody-0.11.7-gentoo.patch 1419 BLAKE2B 30a1ef43f6d3b00a07f621dc701e97ba45fb8b6d6ed67f95e5feff7bad32a4d037f0d00301c60bb05e1d5cb85bc1b78451ca0a989d7fda893f8b433ee50cc2f5 SHA512 9f5490ce156ef7d69f8daee7f274edc4d56da93dcbcfaf1a28f33ee8a0b5c6cb6a8f4f6f50cfd0cd3defad1ae90603803e6328ca3e160c4b3fa6aeadbd7104f3
+AUX prosody-0.12.0-gentoo.patch 1447 BLAKE2B e61e747c393b0b70795db0fc63e24abf684ceb3dbdc10c7567e59774f8cd1fbf8da50f749661ee567dcaa8dca5a04a25ff8b1705164da95bdf675f4d7d9639a2 SHA512 8914cc41b102a5f01f640cbb9188bb9c3e522f21f45ce753efebdfeb5b1313ff856af42731eea9822c62a1f21768d950091371150f5dc7a9dac93331f089e032
AUX prosody.initd-r5 987 BLAKE2B 3e381f48cbc9c5361bdc6cb9ab4a13daf055cd35389036b4ed2efb6df4c5ea5bb4ff43947bdb29d09b263a7eb0ed7ffeda8425723f4e0a76387245ae02a2661f SHA512 56e8e5524c6b383355bb1106ffaac614196dd48a8d9fd1f62ece87fbe6278f7d2ea7a683027dd6dcfeb2bc7331d84e95868f8c0501dfc7e11ef77aa08ebdde17
+AUX prosody.initd-r6 1114 BLAKE2B a988b584eb49d21261776fa0a651dc01d3943a5a75c9bfeb5462c373bfb38cf0bbb3e48ae36990d9079932c5af7296d1970de928b2d027d01001c630982edfe3 SHA512 b72ebe1fa53a884f2074aae4871c10daccafdaa6bbef2b2400d2954a667c5794c9a9d2568a36c28850b05b1cc2fe97c4beef899a4b26ecacb027c9b90ed6f24f
AUX prosody.service-r2 228 BLAKE2B 61741cb7ecf64777b516a1fcb4e8e8c5c7b9c5d92dafbf7f691c36910f41d0b81d701bf8f287aea89fa368071c0c94a38f56ff3134055eb01842b578d8b57991 SHA512 0499588d1fd6e970575785b4bdaf631428601bec8a57051558c1d4c82bc74462f17d7568b8d433b14f15c51c94b181f4240d9f4574d51dcfeda291f0a68eb6f1
+AUX prosody.service-r3 439 BLAKE2B abd128f236f2c28f54542388a38aaa3d0e5030510dddc16240273de90c13ddee62d01d26d7c9e1be0635dc59ad9ca5e93a30f2b5fa42106489a95d26a037314a SHA512 b540e5d4389439cdd2886f9ccaf189d20ffcaf29a982a26e4ed296b0c529df95aade88751d22919cb36b27db94530dade754044d50cee2e5244d37983b933517
AUX prosody.tmpfilesd-r1 36 BLAKE2B dfb5025508cc62b4cd53de35b83f47bfee61821fbfe3301c1b67a4324ab753067cd3ecd84f56ae9a0241395a50d90ce2ec49c9333dc3378798a290e638a56cf9 SHA512 13a99fb925f7c3584dbfcbc98b3b929b67e165f70d700a25a861e512becd8a21ca48ee385da67ead23beeb68a43aaa10a2cfd342d1b3184883fede5d985cb599
-DIST prosody-0.11.12.tar.gz 439656 BLAKE2B 593bb24d7e84ed337e8d8a11b387ac50abd27ea62be0fd18e8c8441472c09565a6603ccb070250b620b3f50f4d1e33fad579f988e68250c083b8a9aa25a8e03b SHA512 cd03ee8b02ffaa478b5329d9942d833cfed2d8bf720bf580a2082d681e7d333bc34f45041cea7234bee75f1a0e7c07983a685fe2ac9b31d51a0dbb36e87ba5d2
+AUX prosody.tmpfilesd-r2 39 BLAKE2B 1e004bf2bf1495d219c12bea1973206fae135fb4a5b453c6692f0143413626ec83889bb84b5086a6e507d3b8af14877b3820f3d9560df17e1ca49e2cbee85e0b SHA512 81b855c6bf496f0e6f20c41b8be5538c4edd1fbc6e4f2ca6e9a2d0a06bd5237223a4d42bcbdb75746cb01e46ff0eb36dac6952d9c076c6a72d1bbd733aca07eb
DIST prosody-0.11.13.tar.gz 439816 BLAKE2B 8ace9001fe93d6349c744d17c7bccbf18c8704615cea856efcadd2de54430a64241cf7930345163e7bb6067aa4731da15dde4fc7f3ddb868b0680facc5368230 SHA512 7616785536b7b51767a26963a80c961ef2403609e1e78dda3f88cf68c00d5bb899278c70a22b006b58c36c62cbb1bbd390a9298bad5b8d6524928a1cd5457813
-EBUILD prosody-0.11.12.ebuild 2857 BLAKE2B 0d8254cac3b9616f02c374f308efaa073b77ca204952f788db5785409028b6dd8f162c7267f09de11e3327f83b434c23af57cda997594c2b4ec06f62d7cd091a SHA512 2603123885f1e0f696835c26a06e052b11998205d6cb78030222280760201f368facccd573fe767a2754ce0b378223a180fa3b545858a93aec715c7aa3f6d24d
-EBUILD prosody-0.11.13.ebuild 2859 BLAKE2B fc318edc0ee24b64b2a2dde1ee08f46cce57379e68cd9efcd1f9186fb51808bb58ab4d7b83b4ccbbaaf88632d4daca922e6e0136f6391567ea16d672750b20a7 SHA512 b594518da924cebc7d58a72aab64a3b10cc4d64f3056bd4f0ba34ac3087a773e4fc07db392842996beb619de0018aff196fa9f2283af9a9996b9e8cdd89e8a5e
+DIST prosody-0.12.0.tar.gz 610330 BLAKE2B 14694ee95dc6eb6d053278a9d7718fd7487fe7ef862b4e2ee0d57f2b60cdeb22d1c74eac4a4df7447ea3e9ff57fb3734a9c9997f2767ed3aa04682f265b82185 SHA512 b7144a413a5bc72b1e677504d5ced6583c7399c8334b39b4c9157da60f951300832b34a1d47703a0b217caa4f1d3a0f52ab59cef08b27c6b43e876e1dffca3ce
+EBUILD prosody-0.11.13.ebuild 2857 BLAKE2B 0d8254cac3b9616f02c374f308efaa073b77ca204952f788db5785409028b6dd8f162c7267f09de11e3327f83b434c23af57cda997594c2b4ec06f62d7cd091a SHA512 2603123885f1e0f696835c26a06e052b11998205d6cb78030222280760201f368facccd573fe767a2754ce0b378223a180fa3b545858a93aec715c7aa3f6d24d
+EBUILD prosody-0.12.0.ebuild 5131 BLAKE2B 32986fdee941501782c3a6f211401e0b53b404e5823d466bd3b89ec16a475d8b5f5fd874c028167ace137d7856556b3010341f3878b846210b63440c6ba35520 SHA512 52c336be8e9a097c0d3a76b487d63b37cbd4d925107e7cc6b9ee187a05612ca03f53fba9aa6c98044c134d06f303a4e13802e7421c081ec2d7a7fdfbfcdedb9f
MISC metadata.xml 670 BLAKE2B 448bf5ede2b6f09940c51fdff4642e18be22d9c3dac637271c7c8bcfde1b4af0853e2623c55c00efcd8757ef863ac37fdb895606e572911a62a1c9d5f32cc693 SHA512 6177b8e3d2ed1aeeae2f369dc693283a3f811953f71be0e004eea402aa421d89973dbefe79c8fd198e9f9f82e4b345552dc3a2c3597c05927dc1a518cacbaf1d
diff --git a/net-im/prosody/files/prosody-0.12.0-gentoo.patch b/net-im/prosody/files/prosody-0.12.0-gentoo.patch
new file mode 100644
index 000000000000..3b2ba75b15c8
--- /dev/null
+++ b/net-im/prosody/files/prosody-0.12.0-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 prosody:prosody (uid:gid) for all Jabber related services.
++prosody_user = "prosody"
++prosody_group = "prosody"
++
++-- 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/prosody/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)
+@@ -26,7 +35,9 @@
+ -- This option allows you to specify additional locations where Prosody
+ -- will search first for modules. For additional modules you can install, see
+ -- the community module repository at 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/modules", "/usr/GENTOO_LIBDIR/prosody/community-modules" };
+
+ -- This is the list of modules Prosody will load on startup.
+ -- Documentation for bundled modules can be found at: https://prosody.im/doc/modules
diff --git a/net-im/prosody/files/prosody.initd-r6 b/net-im/prosody/files/prosody.initd-r6
new file mode 100644
index 000000000000..e4138c597b23
--- /dev/null
+++ b/net-im/prosody/files/prosody.initd-r6
@@ -0,0 +1,46 @@
+#!/sbin/openrc-run
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+extra_started_commands="reload"
+name="Prosody XMPP server"
+prosody_config="/etc/prosody/prosody.cfg.lua"
+prosody_data="/var/lib/prosody"
+prosody_logs="/var/log/prosody"
+prosody_pid="/run/prosody"
+pidfile="${prosody_pid}/prosody.pid"
+
+command="/usr/bin/prosody"
+command_args="--daemonize"
+commandctl="/usr/bin/prosodyctl"
+command_group="prosody"
+command_user="prosody"
+
+checkconfig() {
+ if [ ! -f "${prosody_config}" ]; then
+ eerror "Please create ${prosody_config} before starting Prosody!"
+ return 1
+ fi
+
+ ${commandctl} check config
+ return $?
+}
+
+depend() {
+ need net
+ 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 "${prosody_data}"
+ checkpath -d -m 0750 -o "${command_user}:${command_group}" -q "${prosody_logs}"
+ checkpath -d -m 0750 -o "${command_user}:${command_group}" -q "${prosody_pid}"
+}
diff --git a/net-im/prosody/files/prosody.service-r3 b/net-im/prosody/files/prosody.service-r3
new file mode 100644
index 000000000000..dec39e4b0b22
--- /dev/null
+++ b/net-im/prosody/files/prosody.service-r3
@@ -0,0 +1,17 @@
+[Unit]
+Description=Prosody XMPP server
+After=network.target
+
+[Service]
+Group=prosody
+PIDFile=/run/prosody/prosody.pid
+ExecStart=/usr/bin/prosody --daemonize
+ExecReload=/bin/kill -HUP $MAINPID
+User=prosody
+ExecStartPre=!/bin/mkdir -p /var/log/prosody
+ExecStartPre=!/bin/mkdir -p /var/lib/prosody
+ExecStartPre=!/bin/chown -R prosody /var/log/prosody
+ExecStartPre=!/bin/chown -R prosody /var/lib/prosody
+
+[Install]
+WantedBy=multi-user.target
diff --git a/net-im/prosody/files/prosody.tmpfilesd-r2 b/net-im/prosody/files/prosody.tmpfilesd-r2
new file mode 100644
index 000000000000..78949f3db82c
--- /dev/null
+++ b/net-im/prosody/files/prosody.tmpfilesd-r2
@@ -0,0 +1 @@
+d /run/prosody 750 prosody prosody - -
diff --git a/net-im/prosody/prosody-0.11.12.ebuild b/net-im/prosody/prosody-0.11.12.ebuild
deleted file mode 100644
index 1b9f77dd5703..000000000000
--- a/net-im/prosody/prosody-0.11.12.ebuild
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-LUA_COMPAT=( lua5-{1..3} luajit )
-LUA_REQ_USE="deprecated(+)"
-
-inherit lua-single 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 ~arm64 x86"
-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
-}
diff --git a/net-im/prosody/prosody-0.11.13.ebuild b/net-im/prosody/prosody-0.11.13.ebuild
index 9a4dc0782f50..1b9f77dd5703 100644
--- a/net-im/prosody/prosody-0.11.13.ebuild
+++ b/net-im/prosody/prosody-0.11.13.ebuild
@@ -14,7 +14,7 @@ SRC_URI="https://prosody.im/downloads/source/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
-KEYWORDS="~amd64 ~arm ~arm64 ~x86"
+KEYWORDS="amd64 ~arm ~arm64 x86"
IUSE="icu +idn +libevent mysql postgres selinux +sqlite +ssl test +zlib"
REQUIRED_USE="
^^ ( icu idn )
diff --git a/net-im/prosody/prosody-0.12.0.ebuild b/net-im/prosody/prosody-0.12.0.ebuild
new file mode 100644
index 000000000000..e9cab9fb7d64
--- /dev/null
+++ b/net-im/prosody/prosody-0.12.0.ebuild
@@ -0,0 +1,164 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+LUA_COMPAT=( lua5-{1..4} luajit )
+LUA_REQ_USE="deprecated(+)"
+
+inherit lua-single 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 ~arm64 ~x86"
+IUSE="icu +idn +libevent ldap mysql postgres selinux +sqlite +ssl test +zlib"
+REQUIRED_USE="
+ ^^ ( icu idn )
+ ${LUA_REQUIRED_USE}
+"
+RESTRICT="!test? ( test )"
+
+DEPEND="
+ acct-group/prosody
+ acct-user/prosody
+ $(lua_gen_cond_dep 'dev-lua/luaexpat[${LUA_USEDEP}]')
+ $(lua_gen_cond_dep 'dev-lua/luafilesystem[${LUA_USEDEP}]')
+ dev-lua/luarocks[${LUA_SINGLE_USEDEP}]
+ $(lua_gen_cond_dep 'dev-lua/luasocket[${LUA_USEDEP}]')
+ $(lua_gen_cond_dep 'dev-lua/lua-unbound[${LUA_USEDEP}]')
+ $(lua_gen_cond_dep 'dev-lua/readline[${LUA_USEDEP}]')
+ icu? ( dev-libs/icu:= )
+ idn? ( net-dns/libidn:= )
+ ldap? ( $(lua_gen_cond_dep 'dev-lua/lualdap[${LUA_USEDEP}]') )
+ 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.12.0-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/lib/prosody"
+ --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/prosody"
+ --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/lib/prosody
+
+ newinitd "${FILESDIR}"/prosody.initd-r6 prosody
+ systemd_newunit "${FILESDIR}"/prosody.service-r3 prosody.service
+
+ newtmpfiles "${FILESDIR}"/prosody.tmpfilesd-r2 prosody.conf
+}
+
+pkg_postinst() {
+ local migrate_to_prosody_user="false"
+ tmpfiles_process prosody.conf
+
+ if [[ ${REPLACING_VERSIONS} ]]; then
+ for v in ${REPLACING_VERSIONS}; do
+ if ver_test "${v}" -lt 0.12.0; then
+ migrate_to_prosody_user="true"
+ break
+ fi
+ done
+ fi
+
+ # Sarting with >=0.12.0, the prosody configuration is now in
+ # /etc/prosody and no longer in /etc/jabber.
+ # See if we need to migrate the configuration. Furthermore,
+ # prosody no longer runs under the, shared via net-im/jabber-base,
+ # 'jabber' use, but under its own user.
+ # This increase isolation and hence robustness and security.
+ if ${migrate_to_prosody_user}; then
+ local -A dirs_to_migrate=(
+ [/etc/jabber]=/etc/prosody
+ [/var/log/jabber]=/var/log/prosody
+ [/var/spool/jabber]=/var/lib/prosody
+ )
+
+ for src_dir in "${!dirs_to_migrate[@]}"; do
+ local eroot_src_dir="${EROOT}/${src_dir}"
+ local eroot_dst_dir="${EROOT}/${dirs_to_migrate[${src_dir}]}"
+
+ cp -r "${eroot_src_dir}"/. "${eroot_dst_dir}" || die "Could not copy ${eroot_src_dir} to ${eroot_dst_dir}"
+
+ if [[ -f "${eroot_dst_dir}"/.keep_net-im_jabber-base-0 ]]; then
+ rm "${eroot_dst_dir}"/.keep_net-im_jabber-base-0 || die
+ fi
+
+ if ! use prefix; then
+ chown --recursive prosody:prosody "${eroot_dst_dir}" || die
+ fi
+ done
+
+ # Update configuration file to match new pathes and permissions
+ local mysedargs=(
+ -e "'s#/etc/jabber#/etc/prosody#g'"
+ -e "'s#/run/jabber#/run/prosody#g'"
+ -e "'s#/var/log/jabber#/var/log/prosody#g'"
+ -e "'s/prosody_user.*/prosody_user = \"prosody\";/g'"
+ -e "'s/prosody_group.*/prosody_group = \"prosody\";/g'"
+ -i /etc/prosody/prosody.cfg.lua
+ )
+
+ eval sed "${mysedargs[@]}" || die
+
+ ewarn "Newer versions of the prosody (Gentoo) package use ${EROOT}/etc/prosody"
+ ewarn "(just as upstream) and *not* anymore ${EROOT}/etc/jabber."
+ ewarn "The files from ${EROOT}/etc/jabber where copied to ${EROOT}/etc/prosody."
+ ewarn "Also prosody's spool directory became ${EROOT}/var/lib/prosody (was ${EROOT}/var/spool/jabbber)."
+ ewarn "Please check your configuration."
+ fi
+}