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

prepare() {
Timo Teräs's avatar
Timo Teräs committed
28
	default_prepare
Jakub Jirutka's avatar
Jakub Jirutka committed
29
	cd "$builddir"
Timo Teräs's avatar
Timo Teräs committed
30
31
32
33
34

	# disable broken tests
	# see: https://github.com/antirez/redis/issues/2814
	#      https://github.com/antirez/redis/issues/3810
	sed -i -e '/integration\/aof/d' \
Jakub Jirutka's avatar
Jakub Jirutka committed
35
		-e '/integration\/logging/d' \
Timo Teräs's avatar
Timo Teräs committed
36
		tests/test_helper.tcl
Natanael Copa's avatar
Natanael Copa committed
37
38
39
}

build() {
Jakub Jirutka's avatar
Jakub Jirutka committed
40
	cd "$builddir"
Natanael Copa's avatar
Natanael Copa committed
41
42
	make PREFIX=/usr \
		INSTALL_BIN="$pkgdir"/usr/bin \
43
		MALLOC=libc \
Timo Teräs's avatar
Timo Teräs committed
44
45
46
47
48
49
		all
}

check() {
	cd "$builddir"
	make test
Natanael Copa's avatar
Natanael Copa committed
50
51
52
}

package() {
Jakub Jirutka's avatar
Jakub Jirutka committed
53
	cd "$builddir"
54

Jakub Jirutka's avatar
Jakub Jirutka committed
55
	make install PREFIX=/usr INSTALL_BIN="$pkgdir/usr/bin"
Natanael Copa's avatar
Natanael Copa committed
56

Jakub Jirutka's avatar
Jakub Jirutka committed
57
58
59
60
	cd "$pkgdir"

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

61
62
63
	# 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
64
	install -D -m 755 "$srcdir"/redis.initd etc/init.d/redis
65
	install -D -m 755 "$srcdir"/redis-sentinel.initd etc/init.d/redis-sentinel
Jakub Jirutka's avatar
Jakub Jirutka committed
66
67
68
69
70
71
	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
72
73
}

Jakub Jirutka's avatar
Jakub Jirutka committed
74
sha512sums="0978dabaf637e61889d492fd3629acd58ca8fb0c0088cdd7036ffd1a7ed3f018c107039d4c96bd61d0b7d35757df2366d051f57d77ffb5642aca0e5651b30603  redis-4.0.10.tar.gz
75
5fd8a478771642b9c0dc285f1d95896f7680b94c7edab0ce60ad19ba0c2979028c7d9b0afb846dbf3e1be146ec5ded52ebb059a5b25b0a8e52bf8e57f18c0cf4  makefile-dont-duplicate-binary.patch
76
c8a35e3c30be99fef8678acb2502f424bcca478dcc1ef1750f8c8c8e9e9c462f97586159f32ebba84b6a4eb398a9d568e3200241fb0de1f96293c9fdaafb06c9  redis.conf.patch
77
d9bbb3fcc69022633d7fea3227c41d8777422ce9778623efb6aa539468fc51d2d1de09d364e21c7c8b45c61e7bbc7aaaf22745257d60ea937f77a8673facf286  sentinel.conf.patch
78
f6dcdad1edd6b5fb6aa28ba774bfc8aba035f316695da261fb2ad291b76f00f177479f9d74434d06c26bd15f131edc9a2f55c9880758cf0987800d2031069738  redis.initd
79
80
81
6752e99df632b14d62a3266929e80c3d667be5c270e4f34e0dcf2b7f9b1754fe0ce9d4569fa413dbbe207e406ff2848a64e0c47629997536ae1d14ca84ebd56b  redis.confd
e7a60a090df53eef05d58d73709f07536135a93efb34e48ad933e3859d3d1c0f476975a3232df18f57476bf7fc3b0548471e1c86445878457ac8507b3da71384  redis-sentinel.initd
bf2def2077a989047e9bfff8a7f754bcdf96e020fd4a470f8967ee1fca601e11f044cfb3742f00e932cc013e0d0b199045d78c8878a0e529715c9f77786d353f  redis.logrotate"