aboutsummaryrefslogtreecommitdiffstats
path: root/main/redis/APKBUILD
blob: fb936c4381e5d0179673bc0aa883f0d60583372f (plain)
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
# Contributor: V.Krishn <vkrishn4@gmail.com>
# Contributor: Eivind Uggedal <eu@eju.no>
# Maintainer: TBK <alpine@jjtc.eu>
pkgname=redis
pkgver=5.0.5
pkgrel=0
pkgdesc="Advanced key-value store"
url="https://redis.io/"
arch="all"
license="BSD-3-Clause"
pkgusers="redis"
pkggroups="redis"
makedepends="linux-headers"
checkdepends="tcl procps"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-openrc"
source="http://download.redis.io/releases/$pkgname-$pkgver.tar.gz
	makefile-dont-duplicate-binary.patch
	redis.conf.patch
	sentinel.conf.patch
	$pkgname.initd
	$pkgname.confd
	$pkgname-sentinel.initd
	$pkgname.logrotate
	"
builddir="$srcdir/$pkgname-$pkgver"

# secfixes:
#   5.0.4-r0:
#     - CVE-2019-10192
#     - CVE-2019-10193

prepare() {
	default_prepare
	cd "$builddir"

	# Disable broken tests:
	# integration/logging.tcl is not working because musl does not provide BACKTRACE like glibc
	# https://github.com/antirez/redis/blob/5.0.4/src/config.h#L64-L67
	sed -i -e '/integration\/logging/d' \
		tests/test_helper.tcl
}

build() {
	cd "$builddir"
	case "$CARCH" in mips|mipsel*) _libatomic="-latomic";; esac
	make PREFIX=/usr \
		INSTALL_BIN="$pkgdir"/usr/bin \
		MALLOC=libc \
		FINAL_LIBS="-lm -ldl -pthread $_libatomic" \
		all
}

check() {
	cd "$builddir"
	make test
}

package() {
	cd "$builddir"

	make install PREFIX=/usr INSTALL_BIN="$pkgdir/usr/bin"

	cd "$pkgdir"

	install -D -m 644 "$builddir"/redis.conf etc/redis.conf

	# This file must be writable for redis, otherwise Sentinel fails to start.
	install -D -m 644 -o redis -g redis "$builddir"/sentinel.conf etc/sentinel.conf

	install -D -m 755 "$srcdir"/redis.initd etc/init.d/redis
	install -D -m 755 "$srcdir"/redis-sentinel.initd etc/init.d/redis-sentinel
	install -D -m 644 "$srcdir"/redis.confd etc/conf.d/redis
	install -D -m 644 "$srcdir"/redis.logrotate etc/logrotate.d/redis

	install -d -o redis -g redis \
		var/lib/redis \
		var/log/redis
}

sha512sums="78215ec02b7184e05788c7a368146ea53095a877a0e09174b4c9f175aeb9ba9174023c19e33bf62e4513b848e1841538d398e7c0a651c5c947255c1691cb4586  redis-5.0.5.tar.gz
0bfe894843a0b0b1800c5ff1c570cbc631d0bf94e5911210ae8780f57e661c8a61bb7309181fb8492392747deb340025a5380db168418aaf46b273a8120a4169  makefile-dont-duplicate-binary.patch
c8a35e3c30be99fef8678acb2502f424bcca478dcc1ef1750f8c8c8e9e9c462f97586159f32ebba84b6a4eb398a9d568e3200241fb0de1f96293c9fdaafb06c9  redis.conf.patch
e8cd03ab08b354d7d852cc43719ef537586c024f3911e27f0be052de471d3e6c1af947313ba0b045af3f2212afd41eb0cd4e0464cc6568853cfbfd4718b09fa5  sentinel.conf.patch
f6dcdad1edd6b5fb6aa28ba774bfc8aba035f316695da261fb2ad291b76f00f177479f9d74434d06c26bd15f131edc9a2f55c9880758cf0987800d2031069738  redis.initd
6752e99df632b14d62a3266929e80c3d667be5c270e4f34e0dcf2b7f9b1754fe0ce9d4569fa413dbbe207e406ff2848a64e0c47629997536ae1d14ca84ebd56b  redis.confd
e7a60a090df53eef05d58d73709f07536135a93efb34e48ad933e3859d3d1c0f476975a3232df18f57476bf7fc3b0548471e1c86445878457ac8507b3da71384  redis-sentinel.initd
bf2def2077a989047e9bfff8a7f754bcdf96e020fd4a470f8967ee1fca601e11f044cfb3742f00e932cc013e0d0b199045d78c8878a0e529715c9f77786d353f  redis.logrotate"