diff options
author | 2015-03-23 09:27:00 +0100 | |
---|---|---|
committer | 2015-03-23 09:47:35 +0100 | |
commit | 27a5161778d3d85858893e976d3ec56c1d5c2ee8 (patch) | |
tree | 371ec6b635ceec36b6e7e5737ac64100b762a462 | |
parent | add ejabberd 15.03 (diff) | |
download | plab-27a5161778d3d85858893e976d3ec56c1d5c2ee8.tar.gz plab-27a5161778d3d85858893e976d3ec56c1d5c2ee8.tar.bz2 plab-27a5161778d3d85858893e976d3ec56c1d5c2ee8.zip |
update use flags for ejabberd 15.03
-rw-r--r-- | net-im/ejabberd/Manifest | 1 | ||||
-rw-r--r-- | net-im/ejabberd/ejabberd-15.03-r1.ebuild | 184 |
2 files changed, 185 insertions, 0 deletions
diff --git a/net-im/ejabberd/Manifest b/net-im/ejabberd/Manifest index 09ef7d9..259a468 100644 --- a/net-im/ejabberd/Manifest +++ b/net-im/ejabberd/Manifest @@ -4,5 +4,6 @@ AUX ejabberd.logrotate 203 SHA256 42f28222c6a5b7c691eb371085cccdef3fcba059a1e89f AUX ejabberd.service 288 SHA256 541a67871c8b55e9a58ba8b1b30559d5ea2854809a78f58980fc7a436fa92071 SHA512 5f682b845650cafe00706daf3accf56e306829b9da08f7c17dc168296453806fa6b639e5820f1129b0f459e8550c3fc5aea4e2cf1ec2db8429a7b66e68a065fa WHIRLPOOL 5873a1d4c10bf13df71007e41a5201703a8f55d0bd0b9f29e83c526bfbecce943227aba8df7218da5f93f5f2f2371cf9bb15bc7d06268542543961a0505ab5b9 AUX ejabberd.tmpfiles.conf 43 SHA256 2ee7fb4fb9c9c931ffa8c1dfa273e6658f3bbd37bb6ae25765b9e4f2a7459506 SHA512 8bdc297d5cb405e82c33627b36730992584d7f8b92d15c47933edd01ba6575983009c1f6607a21eee0280abdf7b51639d99d7836712a8d3629ec1e960b8a02c4 WHIRLPOOL f27e3a9bff1ab941c4a80fc5573d8541e40804f24b2f2e40e0f77c2ea2016e5c0b323e59674ed880df95037d0d82a956bc9ea984b5b371dd16e50858faa7e0d0 DIST ejabberd-15.03.tgz 3262151 SHA256 b685cd615ecd9a4f42701541e84c2a28ae534bc608d292b78145d9c59ea17233 SHA512 a0158feea561960b1e52a78f0724d0129a21890d58027a3643f78f5092b257cc7501c152673332162f340844ad8823d10741ef3ebefc3b4a6f684c1707d069d5 WHIRLPOOL c702085b47ddeb458e3290e211721d1cd8b20e206737773c58861abe01581f2bc361201b58b7dae48ce28d7684a5afc103776aff180b3c193d1de91398902973 +EBUILD ejabberd-15.03-r1.ebuild 6257 SHA256 4d88892d380cda560344f97849c3411a95f8f968146dcf8479113a64e52b0a3f SHA512 c33c4abce02be69cc8b2e4580150ec94270c8214e8c085ab071ef3bac333cde7188de18c1ee699907acff6bc2e75350d0cf88f14f093abb91f499e47a181a649 WHIRLPOOL 2f0c2168629b26c144e68f33a4a52cfcd8d5bececcc06c86e5dd6abb135efd757142c0e62516321d3b4f851c02b61f7e0274a59e7e3de0fd8946ae30899ae06f EBUILD ejabberd-15.03.ebuild 6048 SHA256 896f9ea5c662043221dd5a62554cbd8db85e8840593a862837331a074e4076ce SHA512 2a5340428384a876307c68767622388f5f97c3616445952ad08e0fdcdc632c18b1764084089140b846c7641eba6ea9ac5a51826154fcd048e8155aeaf0420ed3 WHIRLPOOL 70a2ea1372b8f2561e11dc2e2f77cf2924e446983ca911b5946186380458f27a4cd7818428c623c9a6b83098d53fd903be98fd142dd8dc2381a5b22fbfc97aba MISC metadata.xml 915 SHA256 9c1956a6be7e957bf41c3ac9b5b176a9edd963fc5c8055609461689e09e0cbc6 SHA512 7ce2467693ba5db6397e28fe71a5add944c005aadfe83d21ced82a830c26971a4e94b1273239e1c0a729f2bf8b2e46a603a65109b93d7f2695e764dddbb114b8 WHIRLPOOL 19ef3e6c81ccfe6aa11b8e796956a19cdc80e56645dea70b28e1a67db211b88f36893e196f243a839d40613c6ff8b421c73f0d72ffea925fe13dbdf484b59804 diff --git a/net-im/ejabberd/ejabberd-15.03-r1.ebuild b/net-im/ejabberd/ejabberd-15.03-r1.ebuild new file mode 100644 index 0000000..b599a9f --- /dev/null +++ b/net-im/ejabberd/ejabberd-15.03-r1.ebuild @@ -0,0 +1,184 @@ +EAPI=5 + +inherit eutils multilib pam ssl-cert systemd + +DESCRIPTION="The Erlang Jabber Daemon" +HOMEPAGE="http://www.ejabberd.im/ https://github.com/processone/ejabberd/" +SRC_URI="http://www.process-one.net/downloads/${PN}/${PV}/${P}.tgz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ~arm ~ia64 ppc ~sparc x86" +EJABBERD_MODULES="mod_irc" +IUSE="captcha debug elixir ldap mysql odbc pam pgsql tools +web zlib ${EJABBERD_MODULES}" + +DEPEND=">=net-im/jabber-base-0.01 + >=dev-libs/expat-1.95 + >=dev-libs/libyaml-0.1.4 + >=dev-lang/erlang-15.2.3.1[ssl] + elixir? ( >=dev-lang/elixir-1.0.3 ) + odbc? ( dev-db/unixODBC ) + ldap? ( =net-nds/openldap-2* ) + >=dev-libs/openssl-0.9.8e + captcha? ( media-gfx/imagemagick[truetype,png] ) + zlib? ( >=sys-libs/zlib-1.2.3 )" +RDEPEND="${DEPEND} + >=sys-apps/shadow-4.1.4.2-r3 + pam? ( virtual/pam )" + +S=${WORKDIR}/${P} + +# paths in net-im/jabber-base +JABBER_ETC="${EPREFIX}/etc/jabber" +JABBER_SPOOL="${EPREFIX}/var/spool/jabber" +JABBER_LOG="${EPREFIX}/var/log/jabber" +JABBER_DOC="${EPREFIX}/usr/share/doc/${P}" +# home folder for jabber user +JABBER_HOME="${EPREFIX}/var/lib/jabber" + +src_prepare() { + # don't install release notes (we'll do this manually) + sed '/install .* [.][.]\/doc\/[*][.]txt $(DOCDIR)/d' -i Makefile.in || die + # Set correct paths + sed -e "/^EJABBERDDIR[[:space:]]*=/{s:ejabberd:${P}:}" \ + -e "/^ETCDIR[[:space:]]*=/{s:@sysconfdir@/ejabberd:${JABBER_ETC}:}" \ + -e "/^LOGDIR[[:space:]]*=/{s:@localstatedir@/log/ejabberd:${JABBER_LOG}:}" \ + -e "/^SPOOLDIR[[:space:]]*=/{s:@localstatedir@/lib/ejabberd:${JABBER_SPOOL}:}" \ + -i Makefile.in || die + sed -e "/EJABBERDDIR=/{s:ejabberd:${P}:}" \ + -e "s|\(ETC_DIR=\){{sysconfdir}}.*|\1${JABBER_ETC}|" \ + -e "s|\(LOGS_DIR=\){{localstatedir}}.*|\1${JABBER_LOG}|" \ + -e "s|\(SPOOL_DIR=\){{localstatedir}}.*|\1${JABBER_SPOOL}|" \ + -i ejabberdctl.template || die + + # Set shell, so it'll work even in case jabber user have no shell + # This is gentoo specific I guess since other distributions may have + # ejabberd user with reall shell, while we share this user among different + # jabberd implementations. + sed '/^HOME/aSHELL=/bin/sh' -i ejabberdctl.template || die + sed '/^export HOME/aexport SHELL' -i ejabberdctl.template || die + + #sed -e "s:/share/doc/ejabberd/:${JABBER_DOC}:" -i web/ejabberd_web_admin.erl + + # fix up the ssl cert paths in ejabberd.cfg to use our cert + sed -e "s:/path/to/ssl.pem:/etc/ssl/ejabberd/server.pem:g" \ + -i ejabberd.yml.example || die "Failed sed ejabberd.yml.example (changing ssl patch)" + + # correct path to captcha script in default ejabberd.cfg + sed -e 's|\(captcha_cmd:[[:space:]]*"\).\+"|\1/usr/'$(get_libdir)'/erlang/lib/'${P}'/priv/bin/captcha.sh"}|' \ + -i ejabberd.yml.example || die "Failed sed ejabberd.yml.example (changing captcha script)" + + # disable mod_irc in ejabberd.cfg + if ! use mod_irc; then + sed -e "s/mod_irc:/## mod_irc:/" \ + -i ejabberd.yml.example || die "Failed sed ejabberd.yml.example (disable mod_irc)" + fi +} + +src_configure() { + econf \ + --docdir="${EPREFIX}/usr/share/doc/${P}/html" \ + --libdir="${EPREFIX}/usr/$(get_libdir)/erlang/lib/" \ + $(use_enable elixir) \ + $(use_enable mysql) \ + $(use_enable pam) \ + $(use_enable ldap eldap) \ + $(use_enable odbc) \ + $(use_enable pgsql) \ + $(use_enable tools) \ + $(use_enable web) \ + $(use_enable zlib ejabberd_zlib) \ + --enable-user=jabber +} + +src_compile() { + emake $(use debug && echo debug=true ejabberd_debug=true) +} + +src_install() { + default + + # Pam helper module permissions + # http://www.process-one.net/docs/ejabberd/guide_en.html + if use pam; then + pamd_mimic_system xmpp auth account || die "Cannot create pam.d file" + fowners root:jabber "/usr/$(get_libdir)/erlang/lib/${P}/priv/bin/epam" + fperms 4750 "/usr/$(get_libdir)/erlang/lib/${P}/priv/bin/epam" + fi + + newinitd "${FILESDIR}"/${PN}-3.initd ${PN} + newconfd "${FILESDIR}"/${PN}-3.confd ${PN} + systemd_dounit "${FILESDIR}"/${PN}.service + systemd_dotmpfilesd "${FILESDIR}"/${PN}.tmpfiles.conf + + insinto /etc/logrotate.d + newins "${FILESDIR}"/${PN}.logrotate ${PN} + + keepdir "${JABBER_HOME}" + fowners jabber:jabber "${JABBER_HOME}" + + # use system elixir if enabled + if use elixir; then + rm -f -- "${D}${EPREFIX}/usr/bin/elixir" + rm -f -- "${D}${EPREFIX}/usr/bin/iex" + rm -f -- "${D}${EPREFIX}/usr/bin/mix" + fi +} + +pkg_postinst() { + # give an home to jabber user + usermod -d "${JABBER_HOME}" jabber + + if [[ -z ${REPLACING_VERSIONS} ]] ; then + elog "For configuration instructions, please see" + elog "/usr/share/doc/${P}/html/guide.html, or the online version at" + elog "http://www.process-one.net/en/ejabberd/docs/guide_en/" + + if ! use web ; then + ewarn + ewarn "The web USE flag is off, this has disabled the web admin interface." + ewarn + fi + + local i ctlcfg new_ctlcfg + i=0 + ctlcfg=${EROOT}/etc/jabber/ejabberdctl.cfg + while :; do + new_ctlcfg=$(printf "${EROOT}/etc/jabber/._cfg%04d_ejabberdctl.cfg" ${i}) + [[ ! -e ${new_ctlcfg} ]] && break + ctlcfg=${new_ctlcfg} + ((i++)) + done + + ewarn + ewarn "Updating ${ctlcfg} (debug: ${new_ctlcfg})" + sed -e "/#ERLANG_NODE=/aERLANG_NODE=$EJABBERD_NODE" "${ctlcfg}" > "${new_ctlcfg}" || die + + if [[ -e ${EROOT}/var/run/jabber/.erlang.cookie ]]; then + ewarn "Moving .erlang.cookie..." + if [[ -e ${EROOT}/var/spool/jabber/.erlang.cookie ]]; then + mv -v "${EROOT}"/var/spool/jabber/.erlang.cookie{,bak} + fi + mv -v "${EROOT}"/var/{run/jabber,spool/jabber}/.erlang.cookie + fi + ewarn + ewarn "We'll try to handle upgrade automagically but, please, do your" + ewarn "own checks and do not forget to run 'etc-update'!" + ewarn "PLEASE! Run 'etc-update' now!" + fi + + SSL_ORGANIZATION="${SSL_ORGANIZATION:-Ejabberd XMPP Server}" + install_cert /etc/ssl/ejabberd/server + # Fix ssl cert permissions bug #369809 + chown root:jabber "${EROOT}/etc/ssl/ejabberd/server.pem" + chmod 0440 "${EROOT}/etc/ssl/ejabberd/server.pem" + if [[ -e ${EROOT}/etc/jabber/ssl.pem ]]; then + ewarn + ewarn "The location of SSL certificates has changed. If you are" + ewarn "upgrading from ${CATEGORY}/${PN}-2.0.5* or earlier you might" + ewarn "want to move your old certificates from /etc/jabber into" + ewarn "/etc/ssl/ejabberd/, update config files and" + ewarn "rm /etc/jabber/ssl.pem to avoid this message." + ewarn + fi +} |