summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBertrand Jacquin <bertrand@jacquin.bzh>2016-09-18 00:46:16 +0100
committerChristian Ruppert <idl0r@gentoo.org>2016-09-28 21:53:50 +0200
commitb85b0dc514e1429589ef18ca6415016f19118dbd (patch)
treef9db774460b759018bc5d9c1f0f1b963c1a6f1d1 /net-proxy/haproxy
parentnet-proxy/haproxy: Use an array to define emake arguments (diff)
downloadgentoo-b85b0dc514e1429589ef18ca6415016f19118dbd.tar.gz
gentoo-b85b0dc514e1429589ef18ca6415016f19118dbd.tar.bz2
gentoo-b85b0dc514e1429589ef18ca6415016f19118dbd.zip
net-proxy/haproxy: Define haproxy_use() to condence emake arguments creation
Package-Manager: portage-2.2.28 Closes: https://github.com/gentoo/gentoo/pull/2293 Signed-off-by: Christian Ruppert <idl0r@gentoo.org>
Diffstat (limited to 'net-proxy/haproxy')
-rw-r--r--net-proxy/haproxy/haproxy-1.6.9.ebuild58
-rw-r--r--net-proxy/haproxy/haproxy-9999.ebuild58
2 files changed, 30 insertions, 86 deletions
diff --git a/net-proxy/haproxy/haproxy-1.6.9.ebuild b/net-proxy/haproxy/haproxy-1.6.9.ebuild
index 3052698c1e31..a0703717fcd7 100644
--- a/net-proxy/haproxy/haproxy-1.6.9.ebuild
+++ b/net-proxy/haproxy/haproxy-1.6.9.ebuild
@@ -35,6 +35,12 @@ S="${WORKDIR}/${MY_P}"
DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS )
+haproxy_use() {
+ (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
+
+ usex "${1}" "USE_${2}=1" "USE_${2}="
+}
+
pkg_setup() {
enewgroup haproxy
enewuser haproxy -1 -1 -1 haproxy
@@ -60,54 +66,20 @@ src_compile() {
USE_GETADDRINFO=1
)
- if use crypt ; then
- args+=( USE_LIBCRYPT=1 )
- else
- args+=( USE_LIBCRYPT= )
- fi
+ args+=( $(haproxy_use crypt LIBCRYPT) )
# bug 541042
-# if use lua; then
-# args+=( USE_LUA=1 )
-# else
- args+=( USE_LUA= )
-# fi
+# args+=( $(haproxy_use lua LUA) )
- if use net_ns; then
- args+=( USE_NS=1 )
- else
- args+=( USE_NS= )
- fi
+ args+=( $(haproxy_use net_ns NS) )
+ args+=( $(haproxy_use pcre PCRE) )
+ args+=( $(haproxy_use pcre-jit PCRE_JIT) )
- if use pcre ; then
- args+=( USE_PCRE=1 )
- else
- args+=( USE_PCRE= )
- fi
+# args+=( $(haproxy_use kernel_linux LINUX_SPLICE) )
+# args+=( $(haproxy_use kernel_linux LINUX_TPROXY) )
- if use pcre-jit; then
- args+=( USE_PCRE_JIT=1 )
- else
- args+=( USE_PCRE_JIT= )
- fi
-
-# if use kernel_linux; then
-# args+=( USE_LINUX_SPLICE=1 USE_LINUX_TPROXY=1 )
-# else
-# args+=( USE_LINUX_SPLICE= USE_LINUX_TPROXY= )
-# fi
-
- if use ssl ; then
- args+=( USE_OPENSSL=1 )
- else
- args+=( USE_OPENSSL= )
- fi
-
- if use zlib ; then
- args+=( USE_ZLIB=1 )
- else
- args+=( USE_ZLIB= )
- fi
+ args+=( $(haproxy_use ssl OPENSSL) )
+ args+=( $(haproxy_use zlib ZLIB) )
# For now, until the strict-aliasing breakage will be fixed
append-cflags -fno-strict-aliasing
diff --git a/net-proxy/haproxy/haproxy-9999.ebuild b/net-proxy/haproxy/haproxy-9999.ebuild
index a140ddb0af61..9499a5117790 100644
--- a/net-proxy/haproxy/haproxy-9999.ebuild
+++ b/net-proxy/haproxy/haproxy-9999.ebuild
@@ -35,6 +35,12 @@ S="${WORKDIR}/${MY_P}"
DOCS=( CHANGELOG CONTRIBUTING MAINTAINERS )
+haproxy_use() {
+ (( $# != 2 )) && die "${FUNCNAME} <USE flag> <make option>"
+
+ usex "${1}" "USE_${2}=1" "USE_${2}="
+}
+
pkg_setup() {
enewgroup haproxy
enewuser haproxy -1 -1 -1 haproxy
@@ -60,54 +66,20 @@ src_compile() {
USE_GETADDRINFO=1
)
- if use crypt ; then
- args+=( USE_LIBCRYPT=1 )
- else
- args+=( USE_LIBCRYPT= )
- fi
+ args+=( $(haproxy_use crypt LIBCRYPT) )
# bug 541042
-# if use lua; then
-# args+=( USE_LUA=1 )
-# else
- args+=( USE_LUA= )
-# fi
+# args+=( $(haproxy_use lua LUA) )
- if use net_ns; then
- args+=( USE_NS=1 )
- else
- args+=( USE_NS= )
- fi
+ args+=( $(haproxy_use net_ns NS) )
+ args+=( $(haproxy_use pcre PCRE) )
+ args+=( $(haproxy_use pcre-jit PCRE_JIT) )
- if use pcre ; then
- args+=( USE_PCRE=1 )
- else
- args+=( USE_PCRE= )
- fi
+# args+=( $(haproxy_use kernel_linux LINUX_SPLICE) )
+# args+=( $(haproxy_use kernel_linux LINUX_TPROXY) )
- if use pcre-jit; then
- args+=( USE_PCRE_JIT=1 )
- else
- args+=( USE_PCRE_JIT= )
- fi
-
-# if use kernel_linux; then
-# args+=( USE_LINUX_SPLICE=1 USE_LINUX_TPROXY=1 )
-# else
-# args+=( USE_LINUX_SPLICE= USE_LINUX_TPROXY= )
-# fi
-
- if use ssl ; then
- args+=( USE_OPENSSL=1 )
- else
- args+=( USE_OPENSSL= )
- fi
-
- if use zlib ; then
- args+=( USE_ZLIB=1 )
- else
- args+=( USE_ZLIB= )
- fi
+ args+=( $(haproxy_use ssl OPENSSL) )
+ args+=( $(haproxy_use zlib ZLIB) )
# For now, until the strict-aliasing breakage will be fixed
append-cflags -fno-strict-aliasing