logo

overlay

My own overlay for experimentations, use with caution, no support is provided git clone https://hacktivis.me/git/overlay.git

prosody-0.11.9999.ebuild (2819B)


  1. # Copyright 1999-2021 Gentoo Authors
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=7
  4. LUA_COMPAT=( lua5-{1..3} luajit )
  5. LUA_REQ_USE="deprecated(+)"
  6. inherit lua-single systemd tmpfiles toolchain-funcs mercurial
  7. DESCRIPTION="Prosody is a modern XMPP communication server"
  8. HOMEPAGE="https://prosody.im/"
  9. EHG_REPO_URI="https://hg.prosody.im/trunk"
  10. LICENSE="MIT"
  11. SLOT="0"
  12. IUSE="icu +idn +libevent mysql postgres selinux +sqlite +ssl test +zlib"
  13. REQUIRED_USE="
  14. ^^ ( icu idn )
  15. ${LUA_REQUIRED_USE}
  16. "
  17. RESTRICT="!test? ( test )"
  18. DEPEND="
  19. $(lua_gen_cond_dep 'dev-lua/luaexpat[${LUA_USEDEP}]')
  20. $(lua_gen_cond_dep 'dev-lua/luafilesystem[${LUA_USEDEP}]')
  21. $(lua_gen_cond_dep 'dev-lua/luasocket[${LUA_USEDEP}]')
  22. net-im/jabber-base
  23. icu? ( dev-libs/icu:= )
  24. idn? ( net-dns/libidn:= )
  25. libevent? ( $(lua_gen_cond_dep 'dev-lua/luaevent[${LUA_USEDEP}]') )
  26. dev-libs/openssl:0=
  27. lua_single_target_lua5-1? ( $(lua_gen_cond_dep 'dev-lua/lua-bit32[lua_targets_lua5-1(-)]') )
  28. mysql? ( $(lua_gen_cond_dep 'dev-lua/luadbi[mysql,${LUA_USEDEP}]') )
  29. postgres? ( $(lua_gen_cond_dep 'dev-lua/luadbi[postgres,${LUA_USEDEP}]') )
  30. sqlite? ( $(lua_gen_cond_dep 'dev-lua/luadbi[sqlite,${LUA_USEDEP}]') )
  31. ssl? ( $(lua_gen_cond_dep 'dev-lua/luasec[${LUA_USEDEP}]') )
  32. zlib? ( $(lua_gen_cond_dep 'dev-lua/lua-zlib[${LUA_USEDEP}]') )
  33. ${LUA_DEPS}
  34. "
  35. RDEPEND="
  36. ${DEPEND}
  37. selinux? ( sec-policy/selinux-jabber )
  38. "
  39. BDEPEND="
  40. virtual/pkgconfig
  41. test? ( $(lua_gen_cond_dep 'dev-lua/busted[${LUA_USEDEP}]') )
  42. "
  43. PATCHES=( "${FILESDIR}/${PN}-0.11.7-gentoo.patch" )
  44. src_prepare() {
  45. default
  46. # Set correct plugin path for optional net-im/prosody-modules package
  47. sed -e "s/GENTOO_LIBDIR/$(get_libdir)/g" -i prosody.cfg.lua.dist || die
  48. }
  49. src_configure() {
  50. local myeconfargs=(
  51. --add-cflags="${CFLAGS}"
  52. --add-ldflags="${LDFLAGS}"
  53. --c-compiler="$(tc-getCC)"
  54. --datadir="${EPREFIX}/var/spool/jabber"
  55. --idn-library="$(usex idn 'idn' 'icu')"
  56. --libdir="${EPREFIX}/usr/$(get_libdir)"
  57. --linker="$(tc-getCC)"
  58. --lua-version="$(usex lua_single_target_luajit '5.1' $(ver_cut 1-2 $(lua_get_version)))"
  59. --no-example-certs
  60. --ostype="linux"
  61. --prefix="${EPREFIX}/usr"
  62. --runwith="${ELUA}"
  63. --sysconfdir="${EPREFIX}/etc/jabber"
  64. --with-lua-include="${EPREFIX}/$(lua_get_include_dir)"
  65. --with-lua-lib="${EPREFIX}/$(lua_get_cmod_dir)"
  66. )
  67. # Since the configure script is handcrafted,
  68. # and yells at unknown options, do not use 'econf'.
  69. ./configure "${myeconfargs[@]}" || die
  70. rm makefile || die
  71. mv GNUmakefile Makefile || die
  72. }
  73. src_install() {
  74. default
  75. keepdir /var/spool/jabber
  76. newinitd "${FILESDIR}"/prosody.initd-r5 prosody
  77. systemd_newunit "${FILESDIR}"/prosody.service-r2 prosody.service
  78. newtmpfiles "${FILESDIR}"/prosody.tmpfilesd-r1 prosody.conf
  79. }
  80. pkg_postinst() {
  81. tmpfiles_process prosody.conf
  82. }