aboutsummaryrefslogtreecommitdiffstats
path: root/main/haproxy/APKBUILD
blob: d0ac768d2e5a116d5d15aea3c68cb74bc0f4524b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# Contributor: Jeff Bilyk <jbilyk@gmail.com>
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Milan P. Stanić <mps@arvanta.net>
pkgname=haproxy
# NOTE: Upgrade only to LTS versions announced on upstream site url!
# Using LTS versions is easier to keep it in good shape for stable releases
pkgver=2.4.8
_pkgmajorver=${pkgver%.*}
pkgrel=0
pkgdesc="A TCP/HTTP reverse proxy for high availability environments"
url="https://www.haproxy.org/"
arch="all"
license="(GPL-2.0-or-later AND GPL-2.1-or-later) WITH OpenSSL-Exception"
_luaver=5.4
options="!check textrels" # FIXME: depends on vtest
# riscv64 build reports textrels
makedepends="pcre-dev openssl1.1-compat-dev linux-headers lua$_luaver-dev zlib-dev"
install="haproxy.pre-install haproxy.pre-upgrade"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://www.haproxy.org/download/$_pkgmajorver/src/haproxy-$pkgver.tar.gz
	haproxy-openssl-3.patch
	haproxy.initd
	haproxy.cfg"

# secfixes:
#   2.1.4-r0:
#     - CVE-2020-11100

build() {
	case "$CARCH" in mips|mipsel*|riscv64) _carchflags="ADDLIB=-latomic";; esac
	make \
		$_carchflags \
		TARGET=linux-musl \
		USE_PCRE=1 \
		USE_OPENSSL=1 \
		USE_ZLIB=1 \
		USE_LUA=1 \
		USE_NS=1 \
		USE_PROMEX=1 \
		LUA_LIB=/usr/lib/lua$_luaver \
		LUA_INC=/usr/include/lua$_luaver
}

check() {
	make reg-tests
}

package() {
	make install \
		DESTDIR="$pkgdir" PREFIX=/usr DOCDIR=/usr/share/doc/haproxy
	install -d \
		"$pkgdir"/var/lib/haproxy
	install -D -m 755 \
		"$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -D -m 644 \
		"$srcdir"/haproxy.cfg \
		"$pkgdir"/etc/haproxy/haproxy.cfg
}

sha512sums="
8e1d28191a8c26d46989359a213444f30a09e439d32b5ab6cb01a3ca267788fc7677dd14deaa43a7f6c7741cbf6c8fcf6cdd5cf927d23e48f82b9e7723d8a6f9  haproxy-2.4.8.tar.gz
f766b2e9f9e2e4d236e571e7d7dfc59e864d5e6e7fe8008275d4ad9665e3b519e2ae9833c1c2f41f7af12cfd2c1b17a7620caa80426086fd4020dc5527465854  haproxy-openssl-3.patch
4aa8fc812079baf1d17cf9484a9b44568c3dd94f35243a57a4a7868e7f88146a4e94c80ea8ab86f1b08a524567e269a3ec119b67fc679f6bd0d9f1c70ce4f080  haproxy.initd
26bc8f8ac504fcbaec113ecbb9bb59b9da47dc8834779ebbb2870a8cadf2ee7561b3a811f01e619358a98c6c7768e8fdd90ab447098c05b82e788c8212c4c41f  haproxy.cfg
"