aboutsummaryrefslogtreecommitdiffstats
path: root/databases/redis/Makefile
blob: 3e9955d4452b7667943a1db08bbf4646651cece7 (plain) (blame)
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
# New ports collection makefile for:    redis
# Date created:    03 Jul 2009
# Whom:        Sergey Skvortsov <skv@protey.ru>
#
# $FreeBSD$
#

PORTNAME=   redis
PORTVERSION=    2.2.13
CATEGORIES= databases
MASTER_SITES=   GOOGLE_CODE

MAINTAINER= osa@FreeBSD.org
COMMENT=    A persistent key-value database with built-in net interface

LIB_DEPENDS=    execinfo.1:${PORTSDIR}/devel/libexecinfo

CFLAGS+=    -I${LOCALBASE}/include

CONFLICTS?= redis-scripting-2.*

USE_GMAKE=  yes
USE_RC_SUBR=    redis.sh
BIN_FILES=  redis-benchmark redis-check-aof redis-check-dump \
        redis-cli redis-server

PKGMESSAGE= ${WRKDIR}/pkg-message

PORTDOCS=   *

USERS=  redis
GROUPS= redis

REDIS_DBDIR?=   /var/db/redis
REDIS_RUNDIR?=  /var/run/redis
REDIS_LOGDIR?=  /var/log/redis

SUB_FILES=  pkg-message
SUB_LIST+=  PORTNAME=${PORTNAME} \
    REDIS_USER=${USERS} \
    REDIS_DBDIR=${REDIS_DBDIR} \
    REDIS_LOGDIR=${REDIS_LOGDIR} \
    REDIS_RUNDIR=${REDIS_RUNDIR}

PLIST_SUB+= REDIS_USER=${USERS} \
    REDIS_GROUP=${GROUPS} \
    REDIS_LOGDIR=${REDIS_LOGDIR} \
    REDIS_DBDIR=${REDIS_DBDIR} \
    REDIS_RUNDIR=${REDIS_RUNDIR}

post-build:
    ${SED} ${SUB_LIST:S/$/!g/:S/^/ -e s!%%/:S/=/%%!/} \
        ${WRKSRC}/redis.conf > ${WRKDIR}/redis.conf

do-install:
    ${INSTALL_PROGRAM} ${BIN_FILES:C!^!${WRKSRC}/src/!} ${PREFIX}/bin/
    ${INSTALL_DATA} ${WRKDIR}/redis.conf ${PREFIX}/etc/redis.conf.sample
.if !defined(NOPORTDOCS)
    @${MKDIR} ${DOCSDIR}
    @cd ${WRKSRC}/doc && ${COPYTREE_SHARE} . ${DOCSDIR}
.endif

post-install:
.for d in ${REDIS_LOGDIR} ${REDIS_RUNDIR} ${REDIS_DBDIR}
    [ -d ${d} ] || ${MKDIR} ${d} && ${CHOWN} ${USERS}:${GROUPS} ${d}
.endfor

.include <bsd.port.mk>