--- zabbix-3.0.2.ebuild 2016-04-19 11:43:36.000000000 +0200 +++ zabbix-3.0.2.ebuild.encryption 2016-04-21 12:59:29.000000000 +0200 @@ -17,7 +17,8 @@ SLOT="0" WEBAPP_MANUAL_SLOT="yes" KEYWORDS="~amd64 ~x86" -IUSE="agent java curl frontend ipv6 xmpp ldap libxml2 mysql openipmi oracle postgres proxy server ssh snmp sqlite odbc static" +IUSE="agent java curl frontend ipv6 xmpp ldap libxml2 mysql openipmi oracle postgres proxy server ssh ssl snmp sqlite odbc static" +IUSE+=" zabbix_ssl_gnutls zabbix_ssl_mbedtls +zabbix_ssl_openssl" COMMON_DEPEND="snmp? ( net-analyzer/net-snmp ) ldap? ( @@ -34,6 +35,17 @@ curl? ( net-misc/curl ) openipmi? ( sys-libs/openipmi ) ssh? ( net-libs/libssh2 ) + ssl? ( + zabbix_ssl_gnutls? ( + >=net-libs/gnutls-3.1.18:0= + ) + zabbix_ssl_mbedtls? ( + >=net-libs/mbedtls-1.3.9:0= + ) + zabbix_ssl_openssl? ( + >=dev-libs/openssl-1.0.1:0= + ) + ) java? ( virtual/jdk:* ) odbc? ( dev-db/unixODBC )" @@ -53,6 +65,15 @@ DEPEND="${COMMON_DEPEND} virtual/pkgconfig" +REQUIRED_USE=" + ssl? ( + ^^ ( + zabbix_ssl_gnutls + zabbix_ssl_mbedtls + zabbix_ssl_openssl + ) + )" + S=${WORKDIR}/${MY_P} ZABBIXJAVA_BASE="opt/zabbix_java" @@ -204,6 +225,27 @@ } src_configure() { + # We make use of the fact that later flags override earlier ones + # So start with all ssl providers off until proven otherwise + local myconf=() + myconf+=( --without-gnutls --without-mbedtls --without-openssl ) + if use ssl ; then + if use zabbix_ssl_gnutls; then + einfo "SSL provided by gnutls" + myconf+=( --with-gnutls ) + elif use zabbix_ssl_mbedtls; then + einfo "SSL provided by mbedtls" + myconf+=( --with-mbedtls ) + elif use zabbix_ssl_openssl; then + einfo "SSL provided by openssl" + myconf+=( --with-openssl ) + else + eerror "We can't be here because of REQUIRED_USE." + fi + else + einfo "SSL disabled" + fi + econf \ $(use_enable server) \ @@ -224,6 +266,7 @@ $(use_with ssh ssh2) \ $(use_with libxml2) \ $(use_with odbc unixodbc) \ + "${myconf[@]}" \ || die "econf failed" }