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])}"
25 SRCREV_FORMAT = "opendev"
26 SRCREV_opendev = "d778e862571957ece3c404c0c37d325769772fde"
27 SUBPATH0 = "haproxy-config"
28 DSTSUFX0 = "stx-configfiles"
31 git://opendev.org/starlingx/config-files.git;protocol=https;destsuffix=${DSTSUFX0};branch="r/stx.3.0";subpath=${SUBPATH0};name=opendev \
32 https://www.haproxy.org/download/${MAJOR_VER}/src/haproxy-${PV}.tar.gz \
33 file://haproxy.service \
37 inherit systemd useradd
39 # create a user for running haproxy
40 HAP_USER_HOME = "${libdir}/haproxy"
41 USERADD_PACKAGES = "${PN}"
42 USERADD_PARAM_${PN} = "--system --home ${HAP_USER_HOME} --shell /sbin/nologin \
43 --groups haproxy --gid haproxy haproxy"
44 GROUPADD_PARAM_${PN} = "haproxy"
47 HAP_TARGET = "linux2628"
51 'TARGET=${HAP_TARGET}' \
54 'USE_PCRE=1' 'USE_PCRE_JIT=1' \
56 'USE_LINUX_TPROXY=1' \
59 EXTRA_OEMAKE_append_x86 = " USE_REGPARM=1"
60 EXTRA_OEMAKE_append_x86-64 = " USE_REGPARM=1"
68 oe_runmake CC="${CC}" CFLAGS="${CFLAGS}" SBINDIR="${sbindir}" \
70 ZLIB_INC=${STAGING_INCDIR} \
71 ZLIB_LIB=${STAGING_LIBDIR} \
72 PCRE_INC=${STAGING_INCDIR} \
73 PCRE_LIB=${STAGING_LIBDIR} \
74 SSL_INC=${STAGING_INCDIR} \
75 SSL_LIB=${STAGING_LIBDIR}
76 oe_runmake -C contrib/halog halog
77 oe_runmake -C contrib/iprange iprange
81 oe_runmake install-bin \
83 SBINDIR="${sbindir}" \
85 INCLUDEDIR=${includedir}
87 install -D -m 0644 ${WORKDIR}/haproxy.service ${D}${systemd_system_unitdir}/haproxy.service
88 sed -i -e 's#/usr/bin/haproxy#/usr/sbin/haproxy#g' ${D}${systemd_system_unitdir}/haproxy.service
90 install -D -m 0644 ${WORKDIR}/haproxy.cfg ${D}${sysconfdir}/haproxy/haproxy.cfg
92 # install ssl folder for certificate
93 install -m 700 -d ${D}/${sysconfdir}/ssl/haproxy
94 chown haproxy:haproxy ${D}/${sysconfdir}/ssl/haproxy
96 # install halog and iprange
97 install -D -m 755 contrib/halog/halog ${D}${bindir}/halog
98 install -D -m 755 contrib/iprange/iprange ${D}${bindir}/iprange
100 install -d -m 755 ${D}/${sysconfdir}/haproxy/errors/
101 install -m 755 ${WORKDIR}/stx-configfiles/files/503.http ${D}/${sysconfdir}/haproxy/errors/503.http
103 install -p -D -m 0755 ${WORKDIR}/stx-configfiles/files/haproxy.sh ${D}/${sysconfdir}/init.d/haproxy
106 DISTRO_FEATURES_BACKFILL_CONSIDERED_remove = "sysvinit"
112 ${systemd_system_unitdir} \
114 RDEPENDS_${PN} = "openssl"
116 SYSTEMD_SERVICE_${PN} = "haproxy.service"
118 INSANE_SKIP_${PN} += "already-stripped"