diff options
author | Amadeusz Żołnowski <aidecoe@gentoo.org> | 2017-05-28 19:06:04 +0100 |
---|---|---|
committer | Amadeusz Żołnowski <aidecoe@gentoo.org> | 2017-05-28 19:06:26 +0100 |
commit | 0912204c84b553560a7a48ad1393b7906cccf351 (patch) | |
tree | 2c44bef595f5cea749807b2c7bd2b743c5e779e4 /net-im/ejabberd | |
parent | dev-haskell/stack: new package, asked by Harri Nieminen (diff) | |
download | gentoo-0912204c84b553560a7a48ad1393b7906cccf351.tar.gz gentoo-0912204c84b553560a7a48ad1393b7906cccf351.tar.bz2 gentoo-0912204c84b553560a7a48ad1393b7906cccf351.zip |
net-im/ejabberd: Disable mod_irc if nls USE flag is disbled
mod_irc is only required for mod_irc. If nls support is disabled,
disable mod_irc in example configuration file and warn user if he/she
has mod_irc enabled in configuration. Otherwise ejabberd will fail to
start.
Gentoo-Bug: 603822
Package-Manager: Portage-2.3.5, Repoman-2.3.2
Diffstat (limited to 'net-im/ejabberd')
-rw-r--r-- | net-im/ejabberd/ejabberd-16.09.ebuild | 21 | ||||
-rw-r--r-- | net-im/ejabberd/ejabberd-17.01-r1.ebuild | 21 | ||||
-rw-r--r-- | net-im/ejabberd/ejabberd-17.01.ebuild | 21 | ||||
-rw-r--r-- | net-im/ejabberd/ejabberd-17.04.ebuild | 21 |
4 files changed, 84 insertions, 0 deletions
diff --git a/net-im/ejabberd/ejabberd-16.09.ebuild b/net-im/ejabberd/ejabberd-16.09.ebuild index 5621156189ea..99e4a3aabcc2 100644 --- a/net-im/ejabberd/ejabberd-16.09.ebuild +++ b/net-im/ejabberd/ejabberd-16.09.ebuild @@ -107,6 +107,15 @@ customize_epam_wrapper() { || die 'failed to install epam-wrapper' } +# Disable mod_irc in example configuration file. +disable_mod_irc() { + local needs_iconv='needs dev-erlang/iconv (+nls USE flag)' + sed -r \ + -e "s@^(\s*)(mod_irc\s*:.*$)@\1## \2 # ${needs_iconv}@" \ + -i "${S}/ejabberd.yml.example" \ + || die 'failed to modify example config' +} + # Check if there already exists a certificate. ejabberd_cert_exists() { local cert @@ -138,6 +147,12 @@ get_ejabberd_path() { echo "/usr/$(get_libdir)/${P}" } +# Check whether mod_irc is enabled in ejabberd configuration on target system. +is_mod_irc_enabled() { + egrep '^(\s*)(mod_irc\s*:.*$)' \ + "${EROOT%/}${JABBER_ETC}/ejabberd.yml" +} + # Make ejabberd.service for systemd from upstream provided template. make_ejabberd_service() { sed -r \ @@ -184,6 +199,7 @@ src_prepare() { make_ejabberd_service skip_docs adjust_config + use nls || disable_mod_irc customize_epam_wrapper "${FILESDIR}/epam-wrapper" # Fix bug #591862. ERL_LIBS should point directly to ejabberd directory @@ -294,4 +310,9 @@ pkg_postinst() { chmod g+r "${EROOT%/}${epam_path}" \ || die "failed to correct ${epam_path} permissions" fi + + if ! use nls && is_mod_irc_enabled; then + ewarn "nls support (dev-erlang/iconv) is required by mod_irc. Either rebuild ejabberd" + ewarn "with nls enabled or disable mod_irc in ${EROOT%/}${JABBER_ETC}/ejabberd.yml." + fi } diff --git a/net-im/ejabberd/ejabberd-17.01-r1.ebuild b/net-im/ejabberd/ejabberd-17.01-r1.ebuild index 6ee9e157db6b..7c2e9586ebdf 100644 --- a/net-im/ejabberd/ejabberd-17.01-r1.ebuild +++ b/net-im/ejabberd/ejabberd-17.01-r1.ebuild @@ -108,6 +108,15 @@ customize_epam_wrapper() { || die 'failed to install epam-wrapper' } +# Disable mod_irc in example configuration file. +disable_mod_irc() { + local needs_iconv='needs dev-erlang/iconv (+nls USE flag)' + sed -r \ + -e "s@^(\s*)(mod_irc\s*:.*$)@\1## \2 # ${needs_iconv}@" \ + -i "${S}/ejabberd.yml.example" \ + || die 'failed to modify example config' +} + # Check if there already exists a certificate. ejabberd_cert_exists() { local cert @@ -139,6 +148,12 @@ get_ejabberd_path() { echo "/usr/$(get_libdir)/${P}" } +# Check whether mod_irc is enabled in ejabberd configuration on target system. +is_mod_irc_enabled() { + egrep '^(\s*)(mod_irc\s*:.*$)' \ + "${EROOT%/}${JABBER_ETC}/ejabberd.yml" +} + # Make ejabberd.service for systemd from upstream provided template. make_ejabberd_service() { sed -r \ @@ -198,6 +213,7 @@ src_prepare() { make_ejabberd_service skip_docs adjust_config + use nls || disable_mod_irc customize_epam_wrapper "${FILESDIR}/epam-wrapper" rebar_fix_include_path fast_xml @@ -299,4 +315,9 @@ pkg_postinst() { if ! ejabberd_cert_exists; then ejabberd_cert_install fi + + if ! use nls && is_mod_irc_enabled; then + ewarn "nls support (dev-erlang/iconv) is required by mod_irc. Either rebuild ejabberd" + ewarn "with nls enabled or disable mod_irc in ${EROOT%/}${JABBER_ETC}/ejabberd.yml." + fi } diff --git a/net-im/ejabberd/ejabberd-17.01.ebuild b/net-im/ejabberd/ejabberd-17.01.ebuild index a55828a551ec..061059b61832 100644 --- a/net-im/ejabberd/ejabberd-17.01.ebuild +++ b/net-im/ejabberd/ejabberd-17.01.ebuild @@ -108,6 +108,15 @@ customize_epam_wrapper() { || die 'failed to install epam-wrapper' } +# Disable mod_irc in example configuration file. +disable_mod_irc() { + local needs_iconv='needs dev-erlang/iconv (+nls USE flag)' + sed -r \ + -e "s@^(\s*)(mod_irc\s*:.*$)@\1## \2 # ${needs_iconv}@" \ + -i "${S}/ejabberd.yml.example" \ + || die 'failed to modify example config' +} + # Check if there already exists a certificate. ejabberd_cert_exists() { local cert @@ -139,6 +148,12 @@ get_ejabberd_path() { echo "/usr/$(get_libdir)/${P}" } +# Check whether mod_irc is enabled in ejabberd configuration on target system. +is_mod_irc_enabled() { + egrep '^(\s*)(mod_irc\s*:.*$)' \ + "${EROOT%/}${JABBER_ETC}/ejabberd.yml" +} + # Make ejabberd.service for systemd from upstream provided template. make_ejabberd_service() { sed -r \ @@ -185,6 +200,7 @@ src_prepare() { make_ejabberd_service skip_docs adjust_config + use nls || disable_mod_irc customize_epam_wrapper "${FILESDIR}/epam-wrapper" rebar_fix_include_path fast_xml @@ -298,4 +314,9 @@ pkg_postinst() { chmod g+r "${EROOT%/}${epam_path}" \ || die "failed to correct ${epam_path} permissions" fi + + if ! use nls && is_mod_irc_enabled; then + ewarn "nls support (dev-erlang/iconv) is required by mod_irc. Either rebuild ejabberd" + ewarn "with nls enabled or disable mod_irc in ${EROOT%/}${JABBER_ETC}/ejabberd.yml." + fi } diff --git a/net-im/ejabberd/ejabberd-17.04.ebuild b/net-im/ejabberd/ejabberd-17.04.ebuild index 8b82f975af87..1cec62f2eba2 100644 --- a/net-im/ejabberd/ejabberd-17.04.ebuild +++ b/net-im/ejabberd/ejabberd-17.04.ebuild @@ -108,6 +108,15 @@ customize_epam_wrapper() { || die 'failed to install epam-wrapper' } +# Disable mod_irc in example configuration file. +disable_mod_irc() { + local needs_iconv='needs dev-erlang/iconv (+nls USE flag)' + sed -r \ + -e "s@^(\s*)(mod_irc\s*:.*$)@\1## \2 # ${needs_iconv}@" \ + -i "${S}/ejabberd.yml.example" \ + || die 'failed to modify example config' +} + # Check if there already exists a certificate. ejabberd_cert_exists() { local cert @@ -139,6 +148,12 @@ get_ejabberd_path() { echo "/usr/$(get_libdir)/${P}" } +# Check whether mod_irc is enabled in ejabberd configuration on target system. +is_mod_irc_enabled() { + egrep '^(\s*)(mod_irc\s*:.*$)' \ + "${EROOT%/}${JABBER_ETC}/ejabberd.yml" +} + # Make ejabberd.service for systemd from upstream provided template. make_ejabberd_service() { sed -r \ @@ -198,6 +213,7 @@ src_prepare() { make_ejabberd_service skip_docs adjust_config + use nls || disable_mod_irc customize_epam_wrapper "${FILESDIR}/epam-wrapper" rebar_fix_include_path fast_xml @@ -300,4 +316,9 @@ pkg_postinst() { if ! ejabberd_cert_exists; then ejabberd_cert_install fi + + if ! use nls && is_mod_irc_enabled; then + ewarn "nls support (dev-erlang/iconv) is required by mod_irc. Either rebuild ejabberd" + ewarn "with nls enabled or disable mod_irc in ${EROOT%/}${JABBER_ETC}/ejabberd.yml." + fi } |