summaryrefslogtreecommitdiff
path: root/packages/dev-db/redis/redis-5.0.3.exheres-0
blob: 0ef88d6eb7d4c3ce6e3673f2351b3e97e510594d (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
# Copyright 2012 Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
# Distributed under the terms of the GNU General Public License v2

require github [ user=antirez ]
require systemd-service

SUMMARY="Open source in-memory key-value store"
DESCRIPTION="
Redis is an open source, advanced key-value store. It is often referred to as a data structure
server since keys can contain strings, hashes, lists, sets and sorted sets.
"
HOMEPAGE="https://redis.io/"
DOWNLOADS="http://download.redis.io/releases/${PNV}.tar.gz"

LICENCES="redis"
SLOT="0"
PLATFORMS="~amd64"
MYOPTIONS=""

DEPENDENCIES="
    run:
        group/redis
        user/redis
    test:
        dev-lang/tcl
"

DEFAULT_SRC_COMPILE_PARAMS=( AR=${AR} )

src_prepare() {
    default
    edo sed -i deps/Makefile \
        -e "s:./configure:& AR=${AR}:" \
        -e "s:(MAKE):& RANLIB=${RANLIB}:"
    edo sed -i deps/hiredis/Makefile \
        -e "s:=ar:=$(exhost --tool-prefix)ar:"
}

src_test() {
    esandbox allow_net --connect inet:127.0.0.1@11111
    esandbox allow_net inet:127.0.0.1@11111
    esandbox allow_net --connect inet:127.0.0.1@20000-30000
    esandbox allow_net inet:127.0.0.1@20000-30000

    emake test

    esandbox disallow_net --connect inet:127.0.0.1@11111
    esandbox disallow_net inet:127.0.0.1@11111
    esandbox disallow_net --connect inet:127.0.0.1@20000-30000
    esandbox disallow_net inet:127.0.0.1@20000-30000
}

src_install() {
    emake PREFIX="${IMAGE}/usr/$(exhost --target)" install
    install_systemd_files
    insinto /etc
    doins redis.conf sentinel.conf
    diropts -m 0755 -o redis -g redis
    keepdir /var/db/redis/{,.rdb}
}