diff -Naur zabbixgentoo/zabbix-3.0.3-r1.ebuild zabbixssl/zabbix-3.0.3-r1.ebuild --- zabbixgentoo/zabbix-3.0.3-r1.ebuild 2016-06-15 12:34:47.000000000 +0200 +++ zabbixssl/zabbix-3.0.3-r1.ebuild 2016-06-20 14:42:15.441181122 +0200 @@ -18,9 +18,17 @@ WEBAPP_MANUAL_SLOT="yes" KEYWORDS="~amd64 ~x86" 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" REQUIRED_USE="|| ( agent frontend proxy server ) proxy? ( ^^ ( mysql oracle postgres sqlite odbc ) ) server? ( ^^ ( mysql oracle postgres sqlite odbc ) ) + ssl? ( + ^^ ( + zabbix_ssl_gnutls + zabbix_ssl_mbedtls + zabbix_ssl_openssl + ) + ) static? ( !oracle !snmp )" COMMON_DEPEND="snmp? ( net-analyzer/net-snmp ) @@ -38,9 +46,19 @@ 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:=[-bindist] + ) + ) java? ( virtual/jdk:* ) - odbc? ( dev-db/unixODBC ) - ssl? ( dev-libs/openssl:=[-bindist] )" + odbc? ( dev-db/unixODBC )" RDEPEND="${COMMON_DEPEND} proxy? ( net-analyzer/fping ) @@ -119,6 +137,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) \ $(use_enable proxy) \ @@ -138,7 +177,7 @@ $(use_with ssh ssh2) \ $(use_with libxml2) \ $(use_with odbc unixodbc) \ - $(use_with ssl openssl) \ + "${myconf[@]}" \ || die "econf failed" }