aboutsummaryrefslogtreecommitdiffstats
path: root/testing/redis/APKBUILD
blob: 2d215a5b194ea3474c77dd5b0c29b95f0cd107aa (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
# Contributor: V.Krishn <vkrishn4@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=redis
pkgver=2.4.16
pkgrel=0
pkgdesc="Advanced key-value store"
url="http://redis.googlecode.com"
arch="all"
license="BSD"
depends=""
depends_dev=""
makedepends=""
install="redis.pre-install"
subpackages=""
pkgusers="redis"
pkggroups="redis"
source="http://redis.googlecode.com/files/$pkgname-$pkgver.tar.gz
        redis.initd
        redis.logrotate
        redis.confd"

_builddir="$srcdir"/$pkgname-$pkgver
prepare() {
	cd "$_builddir"
        sed -i -e 's|^daemonize .*|daemonize yes|' \
		-e 's|^dir .*|dir /var/lib/redis/|' \
		-e 's|^logfile .*|logfile /var/log/redis/redis\.log|' \
		-e 's|^pidfile .*|pidfile /var/run/redis/redis\.pid|' \
		-e 's|^loglevel .*|loglevel notice|' \
		redis.conf || return 1
}

build() {
	cd "$_builddir"
	export CFLAGS="$CFLAGS -std=c99" 
	make PREFIX=/usr \
		INSTALL_BIN="$pkgdir"/usr/bin \
		FORCE_LIBC_MALLOC=yes \
		all || return 1
}

package() {
	cd "$_builddir"
	mkdir -p "$pkgdir"/usr/bin
	install -d -o redis -g redis \
		"$pkgdir"/var/lib/redis \
		"$pkgdir"/var/log/redis \
		"$pkgdir"/var/run/redis \
		|| return 1
	
	install -D -m755 "$_builddir/COPYING" \
		"$pkgdir/usr/share/licenses/redis/COPYING" || return 1
        install -D -m755 "$srcdir/redis.initd" "$pkgdir/etc/init.d/redis" \
		&& install -Dm644 "$srcdir/redis.logrotate" \
			"$pkgdir/etc/logrotate.d/redis" \
		&& install -Dm644 "$srcdir/redis.confd" \
			"$pkgdir/etc/conf.d/redis" \
		|| return 1
        install -D -m644 "$_builddir/redis.conf" "$pkgdir/etc/redis.conf" \
		|| retrun 1

	make PREFIX=/usr \
		INSTALL_BIN="$pkgdir/usr/bin" \
		FORCE_LIBC_MALLOC=yes \
		install || return 1
}


md5sums="6b3fffc8c58ebc0849a1046695d4556b  redis-2.4.16.tar.gz
7fb0daf8dcfcda6fd6291dc0291ce579  redis.initd
f49b80f4418f456dbf865a32443d4d1d  redis.logrotate
bf204d560e41b854297c60aff8d862d5  redis.confd"