-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
95 lines (74 loc) · 3.32 KB
/
Makefile
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# New ports collection makefile for: graphite-web
# Date created: 2011-07-22
# Whom: Scott Sanders <[email protected]>
#
# $FreeBSD$
#
PORTNAME= graphite-web
PORTVERSION= 0.9.8
CATEGORIES= net-mgmt python
MASTER_SITES= http://launchpad.net/graphite/1.0/${PORTVERSION}/+download/
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
MAINTAINER= [email protected]
COMMENT= Graphite is a highly scalable real-time graphing system
LICENSE= ASL
MAKE_JOBS_SAFE= yes
USE_PYTHON= 2.4+
USE_PYDISTUTILS=yes
PYDISTUTILS_NOEGGINFO= yes
PYDISTUTILS_INSTALLARGS+= --install-data=${WWWDIR} \
--install-lib=${WWWDIR}
FETCH_ARGS= "-pRr" # default '-AFpr' prevents 302 redirects by launchpad
RUN_DEPENDS+= ${PYTHON_LIBDIR}/site-packages/cairo/__init__.py:${PORTSDIR}/graphics/py-cairo \
${PYTHON_LIBDIR}/site-packages/django/__init__.py:${PORTSDIR}/www/py-django \
${PYTHON_LIBDIR}/site-packages/whisper.py:${PORTSDIR}/databases/py-whisper
OPTIONS= APACHE "Use apache as webserver" on \
CARBON "Build carbon backend " on \
MODPYTHON3 "Enable mod_python3 support" off \
MODWSGI3 "Enable mod_wsgi3 support" on \
SQLITE3 "Enable sqlite3 support" on \
MYSQL "Enable MySQL support" off
GRAPHITE_DBDIR?= "/var/db/graphite"
GRAPHITE_LOGDIR?= "/var/log/graphite"
.include <bsd.port.options.mk>
.if defined (WITH_CARBON)
RUN_DEPENDS+= ${PYTHON_LIBDIR}/site-packages/carbon/__init__.py:${PORTSDIR}/net-mgmt/py-carbon
.endif
.if defined (WITH_APACHE)
USE_APACHE_RUN= 2.0+
.endif
.if defined(WITH_MODPYTHON3)
RUN_DEPENDS+= ${LOCALBASE}/${APACHEMODDIR}/mod_python.so:${PORTSDIR}/www/mod_python3
.endif
.if defined(WITH_MODWSGI3)
RUN_DEPENDS+= ${LOCALBASE}/${APACHEMODDIR}/mod_wsgi.so:${PORTSDIR}/www/mod_wsgi3
.endif
.if defined(WITH_MYSQL)
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}MySQLdb>=1.2.2:${PORTSDIR}/databases/py-MySQLdb
.endif
.if defined(WITH_MODPYTHON3) && !defined(WITH_APACHE)
IGNORE= "mod_python3 needs Apache, please select Apache"
.endif
.if defined(WITH_MODWSGI3) && !defined(WITH_APACHE)
IGNORE= "mod_wsgi3 needs Apache, please select Apache"
.endif
post-patch:
@${RM} -f ${WRKSRC}/setup.cfg
@${REINPLACE_CMD} -e "s|/opt/graphite|${GRAPHITE_BASE}|g" ${WRKSRC}/conf/graphite.wsgi.example
@${REINPLACE_CMD} -e "s|/opt/graphite|${GRAPHITE_BASE}|g" ${WRKSRC}/examples/example-graphite-vhost.conf
@${ECHO_MSG} "********************************************************************"
@${ECHO_MSG} "Please note that this port overrides the default installation layout"
@${ECHO_MSG} "for Graphite by modifying settings.py until the software is able to"
@${ECHO_MSG} "configure its own layout."
@${ECHO_MSG} "********************************************************************"
@${REINPLACE_CMD} -e "s|^\(GRAPHITE_ROOT = \).*|\1'${WWWDIR}/'|" \
-e "s|^\(WEBAPP_DIR = \).*|\1GRAPHITE_ROOT + 'webapp/'|" \
-e "s|^\(WEB_DIR = \).*|\1GRAPHITE_ROOT + 'graphite/'|" \
-e "s|^\(CONF_DIR = \).*|\1'${ETCDIR}/graphite/'|" \
-e "s|^\(CONTENT_DIR = \).*|\1WEBAPP_DIR + 'content/'|" \
-e "s|^\(STORAGE_DIR = \).*|\1'${GRAPHITE_DBDIR}/graphite/'|" \
-e "s|^\(LOG_DIR = \).*|\1'${GRAPHITE_LOGDIR}/'|" \
-e "s|^\(THIRDPARTY_DIR = \).*|\1GRAPHITE_ROOT + 'thirdparty/'|" ${WRKSRC}/webapp/graphite/settings.py
@${REINPLACE_CMD} -e "s|%%GRAPHITE_DBDIR%%|${GRAPHITE_DBDIR}|g" \
-e "s|%%EXAMPLESDIR%%|${EXAMPLESDIR}|g" ${WRKSRC}/setup.py
.include <bsd.port.mk>