summaryrefslogtreecommitdiff
path: root/databases/py-carbon/Makefile
blob: 616317fd3a2cf3455a08eb02bac10b96c70399e2 (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
73
74
75
76
# $NetBSD: Makefile,v 1.5 2017/02/14 10:26:28 wiz Exp $

DISTNAME=	carbon-0.9.15
PKGNAME=	${PYPKGPREFIX}-${DISTNAME}
CATEGORIES=	databases
GITHUB_PROJECT=	carbon
MASTER_SITES=	${MASTER_SITE_GITHUB:=graphite-project/}

MAINTAINER=	riz@NetBSD.org
HOMEPAGE=	http://launchpad.net/graphite
COMMENT=	Backend storage application for graphite
LICENSE=	apache-2.0

DEPENDS+=	${PYPKGPREFIX}-twisted-[0-9]*:../../net/py-twisted
DEPENDS+=	${PYPKGPREFIX}-whisper>=${PKGVERSION_NOREV}:../../databases/py-whisper

USE_LANGUAGES=	# none

PYTHON_VERSIONS_INCOMPATIBLE=	34 35 36 # py-whisper

.include "../../mk/bsd.prefs.mk"
.include "options.mk"

BUILD_DEFS+=	VARBASE GRAPHITE_USER GRAPHITE_GROUP GRAPHITE_DIR

RCD_SCRIPTS=		carbon-aggregator carbon-cache carbon-relay
FILES_SUBST+=		GRAPHITE_USER=${GRAPHITE_USER} GRAPHITE_GROUP=${GRAPHITE_GROUP} \
			GRAPHITE_DIR=${GRAPHITE_DIR}

OWN_DIRS_PERMS+= ${GRAPHITE_DIR} ${WWW_USER} ${GRAPHITE_GROUP} 0775
OWN_DIRS_PERMS+= ${GRAPHITE_DIR}/lists ${GRAPHITE_USER} ${GRAPHITE_GROUP} 0755
OWN_DIRS_PERMS+= ${GRAPHITE_DIR}/rrd ${GRAPHITE_USER} ${GRAPHITE_GROUP} 0755
OWN_DIRS_PERMS+= ${GRAPHITE_DIR}/whisper ${GRAPHITE_USER} ${GRAPHITE_GROUP} 0755
OWN_DIRS_PERMS+= ${GRAPHITE_LOG_DIR} ${GRAPHITE_USER} ${GRAPHITE_GROUP} 0755
OWN_DIRS_PERMS+= ${VARBASE}/run/graphite ${GRAPHITE_USER} ${GRAPHITE_GROUP} 0755


SUBST_CLASSES+=		dirs
SUBST_STAGE.dirs=	pre-configure
SUBST_MESSAGE.dirs=	Patching default storage directory
SUBST_FILES.dirs=	setup.py conf/*
SUBST_VARS.dirs=	GRAPHITE_DIR GRAPHITE_EGDIR GRAPHITE_USER PREFIX \
			PKG_SYSCONFDIR VARBASE

# NetBSD has posix_fallocate in libc, but fs can't actually use it.
SUBST_CLASSES.NetBSD+=	fallocate
SUBST_STAGE.fallocate=	pre-configure
SUBST_MESSAGE.fallocate=Patching for NetBSD defaults
SUBST_FILES.fallocate=	conf/carbon.conf.example
SUBST_SED.fallocate=	-e 's,^\(WHISPER_FALLOCATE_CREATE *= *\)\(.*\),\1False,'

PKG_SYSCONFSUBDIR=	graphite

GRAPHITE_CONF_FILES=	aggregation-rules.conf			\
			blacklist.conf				\
			carbon.amqp.conf			\
			carbon.conf				\
			relay-rules.conf			\
			rewrite-rules.conf			\
			storage-aggregation.conf		\
			storage-schemas.conf			\
			whitelist.conf

.for file in ${GRAPHITE_CONF_FILES}
CONF_FILES+=		${GRAPHITE_EGDIR}/${file}.example \
			${PKG_SYSCONFDIR}/${file}
.endfor

PYSETUPINSTALLARGS=	--prefix=${PREFIX}			\
			--install-lib=${PREFIX}/${PYSITELIB}

INSTALLATION_DIRS+=	share/examples/graphite

.include "../../databases/py-carbon/Makefile.common"
.include "../../lang/python/distutils.mk"
.include "../../mk/bsd.pkg.mk"