1 SUMMARY = "TCP/HTTP proxy and load balancer for high availability environments"
3 HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high \
4 availability environments. Indeed, it can: \
5 - route HTTP requests depending on statically assigned cookies \
6 - spread load among several servers while assuring server persistence \
7 through the use of HTTP cookies \
8 - switch to backup servers in the event a main server fails \
9 - accept connections to special ports dedicated to service monitoring \
10 - stop accepting connections without breaking existing ones \
11 - add, modify, and delete HTTP headers in both directions \
12 - block requests matching particular patterns \
13 - report detailed status to authenticated users from a URI \
14 intercepted by the application \
16 HOMEPAGE = "http://www.haproxy.org/"
19 LIC_FILES_CHKSUM = "file://LICENSE;md5=2d862e836f92129cdc0ecccc54eed5e0"
21 DEPENDS = "libpcre openssl zlib"
23 MAJOR_VER = "${@'.'.join(d.getVar('PV').split('.')[0:2])}"
27 STX_REPO = "config-files"
28 STX_SUBPATH = "haproxy-config"
31 https://www.haproxy.org/download/${MAJOR_VER}/src/haproxy-${PV}.tar.gz \
32 file://haproxy.service \
36 inherit systemd useradd
38 # create a user for running haproxy
39 HAP_USER_HOME = "${libdir}/haproxy"
40 USERADD_PACKAGES = "${PN}"
41 USERADD_PARAM_${PN} = "--system --home ${HAP_USER_HOME} --shell /sbin/nologin \
42 --groups haproxy --gid haproxy haproxy"
43 GROUPADD_PARAM_${PN} = "haproxy"
46 HAP_TARGET = "linux2628"
50 'TARGET=${HAP_TARGET}' \
53 'USE_PCRE=1' 'USE_PCRE_JIT=1' \
55 'USE_LINUX_TPROXY=1' \
58 EXTRA_OEMAKE_append_x86 = " USE_REGPARM=1"
59 EXTRA_OEMAKE_append_x86-64 = " USE_REGPARM=1"
67 oe_runmake CC="${CC}" CFLAGS="${CFLAGS}" SBINDIR="${sbindir}" \
69 ZLIB_INC=${STAGING_INCDIR} \
70 ZLIB_LIB=${STAGING_LIBDIR} \
71 PCRE_INC=${STAGING_INCDIR} \
72 PCRE_LIB=${STAGING_LIBDIR} \
73 SSL_INC=${STAGING_INCDIR} \
74 SSL_LIB=${STAGING_LIBDIR}
75 oe_runmake -C contrib/halog halog
76 oe_runmake -C contrib/iprange iprange
80 oe_runmake install-bin \
82 SBINDIR="${sbindir}" \
84 INCLUDEDIR=${includedir}
86 install -D -m 0644 ${WORKDIR}/haproxy.service ${D}${systemd_system_unitdir}/haproxy.service
87 sed -i -e 's#/usr/bin/haproxy#/usr/sbin/haproxy#g' ${D}${systemd_system_unitdir}/haproxy.service
89 install -D -m 0644 ${WORKDIR}/haproxy.cfg ${D}${sysconfdir}/haproxy/haproxy.cfg
91 # install ssl folder for certificate
92 install -m 700 -d ${D}/${sysconfdir}/ssl/haproxy
93 chown haproxy:haproxy ${D}/${sysconfdir}/ssl/haproxy
95 # install halog and iprange
96 install -D -m 755 contrib/halog/halog ${D}${bindir}/halog
97 install -D -m 755 contrib/iprange/iprange ${D}${bindir}/iprange
99 install -d -m 755 ${D}/${sysconfdir}/haproxy/errors/
100 install -m 755 ${STX_METADATA_PATH}/files/503.http ${D}/${sysconfdir}/haproxy/errors/503.http
102 install -p -D -m 0755 ${STX_METADATA_PATH}/files/haproxy.sh ${D}/${sysconfdir}/init.d/haproxy
105 DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit"
111 ${systemd_system_unitdir} \
113 RDEPENDS_${PN} = "openssl"
115 SYSTEMD_SERVICE_${PN} = "haproxy.service"
117 INSANE_SKIP_${PN} += "already-stripped"