aboutsummaryrefslogtreecommitdiffstats
path: root/main/varnish/APKBUILD
blob: 762541f4abd419f66b7eb8efd8ddc96b6ab6a79d (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: Leonardo Arena <rnalrd@alpinelinux.org>
# Contributor: V.Krishn <vkrishn4@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=varnish
pkgver=4.1.9
pkgrel=0
pkgdesc="High-performance HTTP accelerator"
url="http://www.varnish-cache.org/"
arch="all"
license="BSD"
depends="gcc libc-dev libgcc"
depends_dev=
makedepends="$depends_dev pcre-dev ncurses-dev libedit-dev py-docutils
	linux-headers"
install="varnish.pre-install"
subpackages="$pkgname-dev $pkgname-doc $pkgname-libs $pkgname-geoip"
pkgusers="varnish"
pkggroups="varnish"
source="http://varnish-cache.org/_downloads/varnish-$pkgver.tgz
	fix-compat-execinfo.patch
	fix-stack-overflow.patch
	musl-mode_t.patch

	varnishd.initd
	varnishd.confd
	varnishd.logrotate
	maxminddb.vcl
	"

_builddir="$srcdir"/varnish-$pkgver

# secfixes:
#   4.1.9-r0:
#   - CVE-2017-8807
#   4.1.2-r2:
#   - CVE-2017-12425

prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

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

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install || return 1
	install -Dm755 "$srcdir"/varnishd.initd "$pkgdir"/etc/init.d/varnishd \
		|| return 1
	install -Dm644 "$srcdir"/varnishd.confd "$pkgdir"/etc/conf.d/varnishd \
		|| return 1
	install -Dm644 "$srcdir"/varnishd.logrotate \
		"$pkgdir"/etc/logrotate.d/varnishd || return 1
	install -d -o varnish -g varnish \
		"$pkgdir"/var/cache/varnish \
		"$pkgdir"/var/log/varnish \
		"$pkgdir"/var/lib/varnish \
		|| return 1
	install -d "$pkgdir"/etc/varnish || return 1
}

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
}

md5sums="d537dd5a89ad6d6ac77d93f04b2374f8  varnish-4.1.9.tgz
2fec4f98c892e07d97d93a7bb8529fea  fix-compat-execinfo.patch
e345a5241e68b4763de33f6c7db3350e  fix-stack-overflow.patch
54d12d231c505c95ae3ae09487b5dde4  musl-mode_t.patch
a3d78275f93f59fd4ebad1d09fc41c9e  varnishd.initd
1ed5a6de82e6204400229fa79a54d9a7  varnishd.confd
a6cb8a43c9465699cf956dc992998225  varnishd.logrotate
2cbaa46b9da9f78ecf4c906730f7c5e3  maxminddb.vcl"
sha256sums="22d884aad87e585ce5f3b4a6d33442e3a855162f27e48358c7c93af1b5f2fc87  varnish-4.1.9.tgz
66a281c03bcf0c01bc8215fe39a3b6a593751fb2034824b471596d517554e183  fix-compat-execinfo.patch
24eb8f4614be262ad9b4486ef61f1520b5259237eb2ec9034715aa7100d09ab4  fix-stack-overflow.patch
f96b6dab0e68e169cffceb63776e312d8585bc2a46dfcc5fa2b1ec5e953ad624  musl-mode_t.patch
fda5d424ecb2279195ab85bb9c834fe59999fa9b753cad61d5475520e98263dc  varnishd.initd
c252697811103e9846069b4d4de750105d79960a289ea1f7fcf1e99f682fb5dc  varnishd.confd
017173cb42bb60f853063b7fbc843120c547e501233ce2299e1066b5d81e4d5e  varnishd.logrotate
fd6c810a6099b1b0c2eb572aec239e3f51debc52a6c32fce715f265d7b1a1f85  maxminddb.vcl"
sha512sums="c51d75f65030b0cbfea48565a85af41b77597b29ae45388346796edf33bb15e5ab488c34f98497c5caf77fe594118e97bbaf5c397b4a7d16c31decfbc69eed60  varnish-4.1.9.tgz
e4c3b8fe85ccb3f37c69561b981f89c757acc5534379afec551b7eabc2fe8661e3566513f4bfea9192af8576fc587b34170008f5818038c17c412ac64b27cf51  fix-compat-execinfo.patch
a5b9d6f25b2ed11656f961b6a17d173b2fc9f9ef4f2562a69b07ff1d180117eb7e8da0299bf23054f0044c9abd67d76d8e3e92fb2847638ab507562c1a4c577d  fix-stack-overflow.patch
8758bef9039a2cca23b7302668bd49f1ea07f54835512a8a9558bb9ed5de1c0fca53f2085ccd298fe0c6579fc81c3b583a85f4f6b25b6ad85f89bf3be04afb70  musl-mode_t.patch
146387f493fb2323e7720fa495fca101ea7435ac8e4b57c8f7a02f2d9c7faedb1188465fb4a59a67600cf8b3c9cce9946cd52e31c1d348c2a5f042c1eeb21226  varnishd.initd
f2b4f88c1cea5d8576bf5c6ea82ee841c1fa9dd10daaef668c262669c2d3bc9d151f3c491f8678717047cf0d161c25b4104dd4d29bc8ddb44dd749b7f58c39e7  varnishd.confd
8fb1cba86ede5eff28a494f6b1da1a651d66383cdeb63922104407f28903dea0c643155b6d7ac8353b8c63d480a6c5b43a70c7252bc51ee73317c33a1844c52c  varnishd.logrotate
69f088819cff6d4441813be284f4117f232d08908515bd15d96bd5bb9d41ba7100657a52fd408d44c396d004366062ae22fbf08e2a983cd8023b554539ccf596  maxminddb.vcl"