aboutsummaryrefslogtreecommitdiffstats
path: root/main/varnish/APKBUILD
blob: 7f320249a75fd55d4386af3944fa0266a67695f6 (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Contributor: Pedro Filipe <xpecex@outlook.com>
# Contributor: Leonardo Arena <rnalrd@alpinelinux.org>
# Contributor: V.Krishn <vkrishn4@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=varnish
pkgver=6.5.2
pkgrel=0
pkgdesc="High-performance HTTP accelerator"
url="https://www.varnish-cache.org/"
arch="all"
license="BSD-2-Clause"
options="!check" # tests fail
depends="gcc libc-dev libgcc"
makedepends="pcre-dev ncurses-dev libedit-dev py3-docutils
	linux-headers libexecinfo-dev py3-sphinx"
install="$pkgname.pre-install"
subpackages="$pkgname-dbg $pkgname-dev $pkgname-doc $pkgname-libs $pkgname-geoip::noarch $pkgname-openrc"
pkgusers="varnish"
pkggroups="varnish"
source="https://varnish-cache.org/_downloads/varnish-$pkgver.tgz
	musl-include-vpf.patch
	musl-include-vsb.patch
	varnishd.initd
	varnishd.confd
	varnishlog.initd
	varnishlog.confd
	varnishncsa.initd
	varnishncsa.confd
	varnishd.logrotate
	maxminddb.vcl"


# secfixes:
#   6.5.2-r0:
#     - CVE-2021-36740
#   6.2.1-r0:
#     - CVE-2019-15892
#   5.2.1-r0:
#     - CVE-2017-8807
#   5.1.3-r0:
#     - CVE-2017-12425


build() {
	cd "$builddir"
	./configure \
		--build="$CBUILD" \
		--host="$CHOST" \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--localstatedir=/var/lib \
		--without-jemalloc
	make
}

check() {
	cd "$builddir"

	make -j1 check || {
		find . -name 'test-suite.log' -print -exec cat '{}' \;
		return 1
	}
}

package() {
	cd "$builddir"

	make DESTDIR="$pkgdir" install

	local i; for i in $source; do
		case $i in
		*.initd) install -Dm755 "$srcdir/$i" \
				"$pkgdir/etc/init.d/${i%.*}" ;;
		*.confd) install -Dm644 "$srcdir/$i" \
				"$pkgdir/etc/conf.d/${i%.*}" ;;
		esac
	done
	install -Dm644 "$srcdir"/varnishd.logrotate \
		"$pkgdir"/etc/logrotate.d/varnishd
	install -d -o varnish -g varnish -m750 \
		"$pkgdir"/var/cache/varnish \
		"$pkgdir"/var/log/varnish \
		"$pkgdir"/var/lib/varnish
	install -d -o root -g varnish -m750 "$pkgdir"/etc/varnish
}

libs() {
	pkgdesc="Libraries for varnish"

	mkdir -p "$subpkgdir"/usr/lib
	mv "$pkgdir"/usr/lib/*.so.* "$subpkgdir"/usr/lib/
}

geoip() {
	pkgdesc="Maxmind GeoIP2 lookup plugin for varnish"
	depends="libmaxminddb-dev"

	install -m755 -D "$srcdir"/maxminddb.vcl \
		"$subpkgdir"/usr/lib/varnish/plugins/maxminddb.vcl
}

sha512sums="
31673eaa95e5d3413cd3a4a6fb324c1f0ad2efb22b75409fc0e02c61446787eb167bd530ee5b0a199da4fc76cc36f3603984d86781f856cc6a4aac48260fe4ef  varnish-6.5.2.tgz
2123668169b055f2d88f9b5b8e0877ca8b3cbfcd61e03d91fd7d0513b3267e4ef01a4d858cc6a3298cca0a49aaea2f92ff4fd9c0baf52a6c67b452a53f7e54d0  musl-include-vpf.patch
c51c8964880990c2b01807b2a38d886b146736a918bda9ea2e032c50085bf6745cab3cccb4ee4c561ab936a8b7cfb278cfcb758543ea6c605c15b8973c9f10ce  musl-include-vsb.patch
5ac7867e85cbd721f903c524ed4b524423d9dada4acfeefb0e543214a208828df5cc4efe2f012991bea6b38c2b223c24b17d3890ec4ed2c57d2b441b8e5a6900  varnishd.initd
98c8901e53f3c6adb908b9eb01fd441ea53f3c54d4a79aecb1fb1eddfa2fc93de3d0de403a4464a9baff15873b3a20623837e3a37cb225e924a329e32b9e37d6  varnishd.confd
c67a7898f40849989edcbe74e1a418e196f48e178ca30126bc13db226e4f4c2c2ba74d9d0650ef68ed88732917fc06b80ef1f62c2d9d2c14a89f26fd25aed0f7  varnishlog.initd
88fe9b545a2b25d6e6e45f1cfecbeca5f503bc1fbe95856386e568edee41b487b162cddceba8cb152b0a37d8d96635a76c0715fc69d87d6c667ac403ebae0bb7  varnishlog.confd
e0b7d67bbd710f0a17b77837c581f128e6b746eff2b12e81d03d1ad040037e95bb00fb8007d89bc6dab18cfa659456078f310ac268f104774ef85ad068efecca  varnishncsa.initd
a5426ff66b89d2afb6273f05e4117b3eec5ce0162a624d52c92b418960f72e58bd01224165613221af76ec241bd98e1eb985b2ef7b83a5b615e9ece67234dcc8  varnishncsa.confd
51cc6d46ff7439de93977ab87dfb0af399458c1e446475696f73342ae7a0c1a8ca8fc6e79e593659f1af30716a5f8a1ee5e3b1f5e7b35df40b45d47e7b0f2ffd  varnishd.logrotate
69f088819cff6d4441813be284f4117f232d08908515bd15d96bd5bb9d41ba7100657a52fd408d44c396d004366062ae22fbf08e2a983cd8023b554539ccf596  maxminddb.vcl
"