# Copyright 2014 Alexander Scheuermann # Distributed under the terms of the GNU General Public License v2 require \ systemd-service [ systemd_files=[ prosody.service ] ] \ lua [ multibuild=false whitelist="5.1 5.2 5.3 5.4" ] SUMMARY="A lua based Jabber/XMPP server" HOMEPAGE="https://prosody.im" UPSTREAM_DOCUMENTATION=" ${HOMEPAGE}/doc/configure/ [[ lang = en description = [ Configuration ] ]] " DOWNLOADS="https://prosody.im/downloads/source/${PNV}.tar.gz" LICENCES="MIT" SLOT="0" PLATFORMS="~amd64" MYOPTIONS=" icu [[ description = [ internationalized domain names through icu instead of libidn ] ]] ( providers: libressl openssl ) [[ number-selected = exactly-one ]] " DEPENDENCIES=" build+run: user/prosody group/prosody icu? ( dev-libs/icu:= ) !icu? ( net-dns/libidn ) providers:libressl? ( dev-libs/libressl:= ) providers:openssl? ( dev-libs/openssl:= ) run: dev-lua/luaexpat[>=1.3.0][lua_abis:*(-)?] dev-lua/luafilesystem[~>1.0][lua_abis:*(-)?] dev-lua/luasec[>=0.7][lua_abis:*(-)?] dev-lua/luasocket[>=3.0.0][lua_abis:*(-)?] suggestion: dev-lua/lualdap[lua_abis:*(-)?] [[ description = [ LDAP authentication ] ]] dev-lua/luadbi[>=0.6][lua_abis:*(-)?] [[ description = [ SQL database support (SQLite3, MySQL, PostgreSQL) ] ]] " # We don't have "busted" (yet) RESTRICT="test" src_prepare() { expatch "${FILES}"/prosody.cfg.lua.dist.patch edo sed -i makefile -i tools/migration/Makefile \ -e 's:MAN = $(DESTDIR)$(PREFIX)/share/man:MAN = $(DESTDIR)/usr/share/man:' default } src_configure() { local args=( --ostype=linux --prefix=/usr/$(exhost --target)/ --libdir=/usr/$(exhost --target)/lib --sysconfdir=/etc/prosody --datadir=/var/lib/prosody --c-compiler="${CC}" --add-cflags="${CFLAGS}" --linker="${CC}" --add-ldflags="${LDFLAGS}" --lua-suffix="$(lua_get_abi)" --with-lua=/usr --runwith=lua --with-lua-include=/usr/$(exhost --target)/include/lua$(lua_get_abi) --with-lua-lib=/usr/$(exhost --target)/lib --with-ssl=crypto --no-example-certs ) if option icu; then args+=( --idn-library=icu ) else args+=( --idn-library=idn ) fi edo ./configure "${args[@]}" } src_install() { default install_systemd_files keepdir /var/lib/prosody edo chown prosody:prosody "${IMAGE}"/var/lib/prosody }