APKBUILD 3.02 KB
Newer Older
Natanael Copa's avatar
Natanael Copa committed
1
# Contributor: V.Krishn <vkrishn4@gmail.com>
2
# Contributor: Eivind Uggedal <eu@eju.no>
3
# Maintainer: TBK <alpine@jjtc.eu>
Natanael Copa's avatar
Natanael Copa committed
4
pkgname=redis
5
pkgver=6.0.4
Andy Postnikov's avatar
Andy Postnikov committed
6
pkgrel=0
Natanael Copa's avatar
Natanael Copa committed
7
pkgdesc="Advanced key-value store"
8
url="https://redis.io/"
Natanael Copa's avatar
Natanael Copa committed
9
arch="all"
TBK's avatar
TBK committed
10
license="BSD-3-Clause"
TBK's avatar
TBK committed
11 12
pkgusers="redis"
pkggroups="redis"
13
makedepends="linux-headers"
14
checkdepends="tcl procps"
15
install="$pkgname.pre-install $pkgname.post-install"
TBK's avatar
TBK committed
16
subpackages="$pkgname-openrc"
17
source="http://download.redis.io/releases/redis-$pkgver.tar.gz
18
	makefile-dont-duplicate-binary.patch
19
	redis.conf.patch
20
	sentinel.conf.patch
Jakub Jirutka's avatar
Jakub Jirutka committed
21 22
	$pkgname.initd
	$pkgname.confd
23 24
	$pkgname-sentinel.initd
	$pkgname.logrotate
Natanael Copa's avatar
Natanael Copa committed
25
	"
Natanael Copa's avatar
Natanael Copa committed
26

Leo's avatar
Leo committed
27
# secfixes:
28 29
#   5.0.8-r0:
#     - CVE-2015-8080
Leo's avatar
Leo committed
30 31 32 33
#   5.0.4-r0:
#     - CVE-2019-10192
#     - CVE-2019-10193

Natanael Copa's avatar
Natanael Copa committed
34
prepare() {
Timo Teräs's avatar
Timo Teräs committed
35
	default_prepare
TBK's avatar
TBK committed
36 37 38 39
	# 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' \
Timo Teräs's avatar
Timo Teräs committed
40
		tests/test_helper.tcl
Natanael Copa's avatar
Natanael Copa committed
41 42 43
}

build() {
TBK's avatar
TBK committed
44 45 46 47
	case "$CARCH" in
		mips|mipsel*) _libatomic="-latomic";;
	esac

Natanael Copa's avatar
Natanael Copa committed
48 49
	make PREFIX=/usr \
		INSTALL_BIN="$pkgdir"/usr/bin \
50
		MALLOC=libc \
51
		FINAL_LIBS="-lm -ldl -pthread $_libatomic" \
Timo Teräs's avatar
Timo Teräs committed
52 53 54 55 56
		all
}

check() {
	make test
Natanael Copa's avatar
Natanael Copa committed
57 58 59
}

package() {
Jakub Jirutka's avatar
Jakub Jirutka committed
60
	make install PREFIX=/usr INSTALL_BIN="$pkgdir/usr/bin"
Natanael Copa's avatar
Natanael Copa committed
61

Jakub Jirutka's avatar
Jakub Jirutka committed
62 63 64 65
	cd "$pkgdir"

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

66 67 68
	# 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

Jakub Jirutka's avatar
Jakub Jirutka committed
69
	install -D -m 755 "$srcdir"/redis.initd etc/init.d/redis
70
	install -D -m 755 "$srcdir"/redis-sentinel.initd etc/init.d/redis-sentinel
Jakub Jirutka's avatar
Jakub Jirutka committed
71 72 73 74 75 76
	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
Natanael Copa's avatar
Natanael Copa committed
77 78
}

79
sha512sums="8b0922fd7a9d03d4c21d4822da2c7b16a79c65151d3084b03bbacb35dfc2213a0847115c36ffbe8cc1e7b8664ed142e1e05e9f3f262a5e8a043849b398c7547d  redis-6.0.4.tar.gz
TBK's avatar
TBK committed
80 81
0a7c165307a01ee89935b160fd38628d9982fc5061fae9a51d80a4932437d9504a53af74be15d0505d0d496d24bbdb6cb45dcf2cf50bddb2d4e34f5cf0fd52c2  makefile-dont-duplicate-binary.patch
72fcc8d828efe30889c48e9c336e2cdf47c2efd73e7d44eb4bf17972e9f3a1dcea1a01a072eedb0e3c08ad77d3f1ac45249e0f82f4a5f60586a7ede0c840d2f5  redis.conf.patch
82
a5dc411c2bd7edf61400e29accb375275dd888fda72a8f7e3889be475010c695a22f536be818ef9441e47285c00b451966db924362a7f56806586078c9e3ff8c  sentinel.conf.patch
83
f6dcdad1edd6b5fb6aa28ba774bfc8aba035f316695da261fb2ad291b76f00f177479f9d74434d06c26bd15f131edc9a2f55c9880758cf0987800d2031069738  redis.initd
84 85 86
6752e99df632b14d62a3266929e80c3d667be5c270e4f34e0dcf2b7f9b1754fe0ce9d4569fa413dbbe207e406ff2848a64e0c47629997536ae1d14ca84ebd56b  redis.confd
e7a60a090df53eef05d58d73709f07536135a93efb34e48ad933e3859d3d1c0f476975a3232df18f57476bf7fc3b0548471e1c86445878457ac8507b3da71384  redis-sentinel.initd
bf2def2077a989047e9bfff8a7f754bcdf96e020fd4a470f8967ee1fca601e11f044cfb3742f00e932cc013e0d0b199045d78c8878a0e529715c9f77786d353f  redis.logrotate"