Prune x11/xpra
[dports.git] / www / grafana2 / Makefile
1 # $FreeBSD$
2
3 PORTNAME=       grafana
4 PORTVERSION=    2.6.0
5 DISTVERSIONPREFIX=      v
6 PORTREVISION=   3
7 CATEGORIES=     www
8 MASTER_SITES=   http://files.bartelmess.io/public/:static_assets
9 PKGNAMESUFFIX=  2
10 DISTFILES=      grafana-static-${PORTVERSION}.tar.gz:static_assets
11
12 MAINTAINER=     thomas@bartelmess.io
13 COMMENT=        Dashboard and graph editor for Graphite, InfluxDB & OpenTSDB
14
15 LICENSE=        APACHE20
16
17 BUILD_DEPENDS=  ${LOCALBASE}/bin/go:lang/go
18
19 ONLY_FOR_ARCHS= i386 amd64
20
21 USE_RC_SUBR=    grafana2
22
23 USES=   compiler
24
25 USE_GITHUB=     yes
26 GH_SUBDIR=      src/github.com/${PORTNAME}/${PORTNAME}
27 GH_TUPLE= \
28           BurntSushi:toml:v0.1.0-21-g056c9bc:toml/src/github.com/BurntSushi/toml \
29           Unknwon:macaron:93de4f3:macaron/src/github.com/Unknwon/macaron \
30           Unknwon:com:d9bcf40:com/src/github.com/Unknwon/com \
31           davecgh:go-spew:2df1748:go_spew/src/github.com/davecgh/go-spew \
32           go-bufio:bufio:v1:bufio/src/gopkg.in/bufio.v1 \
33           macaron-contrib:binding:0fbe4b9:binding/src/github.com/macaron-contrib/binding \
34           macaron-contrib:session:31e841d:session/src/github.com/macaron-contrib/session \
35           jmespath:go-jmespath:0.2.2:go_jmespath/src/github.com/jmespath/go-jmespath \
36           lib:pq:go1.0-cutoff-13-g19eeca3:pq/src/github.com/lib/pq \
37           jtolds:gls:f1ac7f4:gls/src/github.com/jtolds/gls \
38           go-asn1-ber:asn1-ber:v1:asn1_ber/src/gopkg.in/asn1-ber.v1 \
39           go-xorm:core:be6e7ac:core/src/github.com/go-xorm/core \
40           go-xorm:xorm:v0.4.2-58-ge2889e5:xorm/src/github.com/go-xorm/xorm \
41           go-ini:ini:v0-16-g1772191:ini/src/gopkg.in/ini.v1 \
42           aws:aws-sdk-go:v1.0.0:aws_sdk_go/src/github.com/aws/aws-sdk-go \
43           mattn:go-sqlite3:e28cd44:go_sqlite3/src/github.com/mattn/go-sqlite3 \
44           go-ldap:ldap:v1-19-g83e6542:ldap/src/github.com/go-ldap/ldap \
45           go-redis:redis:v2.3.2:redis/src/gopkg.in/redis.v2 \
46           gosimple:slug:8d25846:slug/src/github.com/gosimple/slug \
47           streadway:amqp:150b7f2:amqp/src/github.com/streadway/amqp \
48           golang:oauth2:c58fcf0:oauth2/src/golang.org/x/oauth2 \
49           golang:net:972f0c5:net/src/golang.org/x/net \
50           smartystreets:goconvey:1.5.0-356-gfbc0a1c:goconvey/src/github.com/smartystreets/goconvey \
51           rainycape:unidecode:836ef0a:unidecode/src/github.com/rainycape/unidecode \
52           go-sql-driver:mysql:v1.2-26-g9543750:mysql/src/github.com/go-sql-driver/mysql
53
54 GRAFANA_USER?=  grafana
55 GRAFANA_GROUP?= grafana
56
57 USERS=  ${GRAFANA_USER}
58 GROUPS= ${GRAFANA_GROUP}
59
60 GRAFANAHOMEDIR= ${PREFIX}/share/grafana/
61 GRAFANADATADIR= /var/db/${PKGBASE}/
62 GRAFANALOGDIR=  /var/log/${PKGBASE}/
63 GRAFANAPIDDIR=  /var/run/${PKGBASE}/
64
65 SUB_FILES=      grafana2 grafana2.conf
66 SUB_LIST+=      GRAFANA_USER=${GRAFANA_USER} \
67         GRAFANA_GROUP=${GRAFANA_GROUP} \
68         GRAFANADATADIR=${GRAFANADATADIR} \
69         GRAFANALOGDIR=${GRAFANALOGDIR} \
70         GRAFANAPIDDIR=${GRAFANAPIDDIR} \
71         GRAFANAHOMEDIR=${GRAFANAHOMEDIR}
72
73 PLIST_SUB+=     GRAFANAHOMEDIR=${GRAFANAHOMEDIR}
74
75 post-extract:
76         ${RM} -r ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/public
77         ${MV} ${WRKDIR}/public  ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/
78         ${RM} ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/public/.DS_Store
79         ${RM} ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/public/app/.DS_Store
80         ${RM} ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/public/._.DS_Store
81         ${RM} ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/public/app/._.DS_Store
82
83 do-build:
84         @cd ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}; \
85                 ${SETENV} ${MAKE_ENV} ${BUILD_ENV} GOPATH=${WRKSRC} go run build.go build
86
87 do-install:
88         ${INSTALL_PROGRAM} ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/bin/grafana-server \
89         ${STAGEDIR}${PREFIX}/bin/grafana-server
90         cd ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME} && \
91         ${COPYTREE_SHARE} public ${STAGEDIR}${PREFIX}/share/${PORTNAME}
92         ${MKDIR} ${STAGEDIR}${GRAFANAPIDDIR}
93         ${MKDIR} ${STAGEDIR}${GRAFANALOGDIR}
94         ${MKDIR} ${STAGEDIR}${GRAFANAHOMEDIR}
95         ${MKDIR} ${STAGEDIR}${GRAFANADATADIR}
96         ${MKDIR} ${STAGEDIR}${GRAFANAHOMEDIR}/conf
97         ${MKDIR} ${STAGEDIR}${GRAFANAHOMEDIR}/data
98         ${MKDIR} ${STAGEDIR}${GRAFANAHOMEDIR}/data/log
99         ${INSTALL_DATA} ${WRKSRC}/src/github.com/${PORTNAME}/${PORTNAME}/conf/defaults.ini \
100         ${STAGEDIR}${GRAFANAHOMEDIR}/conf/defaults.ini
101         ${INSTALL_DATA} ${WRKDIR}/grafana2.conf ${STAGEDIR}${PREFIX}/etc/grafana2.conf.sample
102
103 .include <bsd.port.pre.mk>
104
105 # golang assumes that if clang is in use, it is called "clang" and not "cc". If
106 # it's called "cc", go fails.
107 .if ${COMPILER_TYPE} == clang
108 BUILD_ENV=      CC=clang
109 .endif
110
111 .include <bsd.port.post.mk>