aboutsummaryrefslogtreecommitdiff
path: root/textproc/opensearch-dashboards/Makefile
blob: ae583c47b88f8079a53f42876296beeba8bc9130 (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
69
70
71
72
73
74
75
PORTNAME=	opensearch-dashboards
DISTVERSION=	1.1.0
DISTVERSIONSUFFIX=	-linux-x64
CATEGORIES=	textproc www
MASTER_SITES=	https://artifacts.opensearch.org/releases/bundle/${PORTNAME}/${DISTVERSION}/

MAINTAINER=	opensearch@FreeBSD.org
COMMENT=	Visualization dashboards for OpenSearch

LICENSE=	APACHE20
LICENSE_FILE=	${WRKSRC}/LICENSE.txt

BUILD_DEPENDS=	node14>=14.17.0:www/node14 \
		npm-node14>0:www/npm-node14
RUN_DEPENDS=	node14>=14.17.0:www/node14

USES=		python:build
USE_RC_SUBR=	${PORTNAME}

WRKSRC=		${WRKDIR}/${PORTNAME}-${PORTVERSION}

_DEVDIR=	${WRKDIR}/.devdir

post-patch:
	@${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|' -e 's|%%LOCALBASE%%|${LOCALBASE}|' -e 's|%%WRKSRC%%|${WRKSRC}|' \
		${WRKSRC}/bin/opensearch-dashboards \
		${WRKSRC}/bin/opensearch-dashboards-keystore \
		${WRKSRC}/bin/opensearch-dashboards-plugin \
		${WRKSRC}/node_modules/re2/binding.gyp \
		${WRKSRC}/plugins/reportsDashboards/server/routes/utils/constants.js
	${RM} \
		${WRKSRC}/bin/*.orig \
		${WRKSRC}/bin/*.bak \
		${WRKSRC}/node_modules/re2/binding.gyp.orig \
		${WRKSRC}/node_modules/re2/binding.gyp.bak \
		${WRKSRC}/plugins/reportsDashboards/server/routes/utils/constants.js.orig \
		${WRKSRC}/plugins/reportsDashboards/server/routes/utils/constants.js.bak
	${RM} -r ${WRKSRC}/plugins/reportsDashboards/.chromium

do-configure:
	(cd ${WRKSRC}/node_modules/re2 && \
		${SETENV} HOME=${WRKDIR} \
		${LOCALBASE}/lib/node_modules/npm/bin/node-gyp-bin/node-gyp configure \
		--python=${PYTHON_CMD} \
		--nodedir ${LOCALBASE} \
		--devdir=${_DEVDIR})

do-build:
	(cd ${WRKSRC}/node_modules/re2 && \
		${SETENV} HOME=${WRKDIR} \
		${LOCALBASE}/lib/node_modules/npm/bin/node-gyp-bin/node-gyp build \
		--devdir=${_DEVDIR})
	${RM} -r ${WRKSRC}/node_modules/re2/build/Release/.deps \
		${WRKSRC}/node_modules/re2/build/Release/obj.target

do-install:
	${MKDIR} ${STAGEDIR}${WWWDIR} ${STAGEDIR}${ETCDIR}
	${INSTALL_DATA} ${WRKSRC}/config/opensearch_dashboards.yml ${STAGEDIR}${ETCDIR}/opensearch_dashboards.yml.sample
	(cd ${WRKSRC} && \
		${COPYTREE_SHARE} "data node_modules package.json plugins src" ${STAGEDIR}${WWWDIR} && \
		${COPYTREE_BIN} bin ${STAGEDIR}${WWWDIR})
	${STRIP_CMD} ${STAGEDIR}${WWWDIR}/node_modules/re2/build/Release/re2.node

post-install:
	${ECHO} "@sample ${ETCDIR}/opensearch_dashboards.yml.sample" >> ${TMPPLIST}
	${FIND} -s ${STAGEDIR}${WWWDIR} -not -type d | ${SORT} | \
		${SED} -e 's#^${STAGEDIR}${PREFIX}/##' >> ${TMPPLIST}
	${ECHO} "@dir(www,www) ${WWWDIR}/data" >> ${TMPPLIST}
	${ECHO} "@dir ${WWWDIR}/plugins/reportsDashboards/node_modules/set-interval-async/test/resources/legacy" >> ${TMPPLIST}
	${ECHO} "@dir ${WWWDIR}/plugins/reportsDashboards/node_modules/set-interval-async/test/resources/fixed" >> ${TMPPLIST}
	${ECHO} "@dir ${WWWDIR}/plugins/reportsDashboards/node_modules/set-interval-async/test/resources/dynamic" >> ${TMPPLIST}
	${ECHO} "@dir ${WWWDIR}/plugins/reportsDashboards/node_modules/set-interval-async/examples/fixed" >> ${TMPPLIST}
	${ECHO} "@dir ${WWWDIR}/plugins/reportsDashboards/node_modules/set-interval-async/examples/dynamic" >> ${TMPPLIST}

.include <bsd.port.mk>