summaryrefslogtreecommitdiffstats
path: root/net-mgmt/phpweathermap/Makefile
blob: 6aaf458db389d6e32bbe7c83113ef55e6dd7b94f (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
# Created by: Hsin-Han You <hhyou@cs.nctu.edu.tw>
# $FreeBSD$

PORTNAME=	phpweathermap
PORTVERSION=	0.97a
PORTREVISION=	2
CATEGORIES=	net-mgmt www
MASTER_SITES=	http://www.network-weathermap.com/files/
DISTNAME=	php-weathermap-${PORTVERSION}

MAINTAINER=	hhyou@cs.nctu.edu.tw
COMMENT=	Network visualisation tool with web editor

LICENSE=	GPLv2
LICENSE_FILE=	${WRKSRC}/COPYING

RUN_DEPENDS=	${LOCALBASE}/share/pear/Console/Getopt.php:${PORTSDIR}/devel/pear \
		rrdtool:${PORTSDIR}/databases/rrdtool

NO_BUILD=	yes
NO_ARCH=	yes
USES=		zip
USE_PHP=	gd

WM_FILES=	HTML_ImageMap.class.php WeatherMap.functions.php \
		WeatherMapLink.class.php WeatherMapNode.class.php \
		Weathermap.class.php weathermap.conf

WM_WWW_FILES=	overlib.js editor-config.php-dist editor.css \
		editor.inc.php editor.js editor.php

WM_WWW_DIRS=	editor-resources images docs

PORTDOCS=	CHANGES COPYING README
WRKSRC=		${WRKDIR}/weathermap

SUB_FILES=	pkg-message

PLIST_SUB=	WWWOWN=${WWWOWN} WWWGRP=${WWWGRP}

OPTIONS_DEFINE=	DOCS EXAMPLES

post-patch:
	${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|g' ${WRKSRC}/editor.php
	${REINPLACE_CMD} -e 's|%%DATADIR%%|${DATADIR}|g' \
			    -e 's|%%PREFIX%%|${PREFIX}|'  ${WRKSRC}/weathermap

do-install:
	@${MKDIR} ${STAGEDIR}/${DATADIR}/www/configs
	@${INSTALL_SCRIPT} ${WRKSRC}/weathermap ${STAGEDIR}/${PREFIX}/bin/phpweathermap
	@for i in ${WM_FILES}; do \
		${INSTALL_DATA} ${WRKSRC}/$$i ${STAGEDIR}/${DATADIR}/$$i; \
	done
	@for i in ${WM_WWW_FILES}; do \
		${INSTALL_DATA} ${WRKSRC}/$$i ${STAGEDIR}/${DATADIR}/www/$$i; \
	done
	@${CP} -R ${WRKSRC}/lib ${STAGEDIR}/${DATADIR}
	@(cd ${WRKSRC} && ${COPYTREE_SHARE} "${WM_WWW_DIRS}" ${STAGEDIR}/${DATADIR}/www)

do-install-EXAMPLES-on:
	@(cd ${WRKSRC} && ${COPYTREE_SHARE} "random-bits" ${STAGEDIR}/${EXAMPLESDIR})
	${FIND} ${STAGEDIR}/${EXAMPLESDIR} -type f -print0 | ${XARGS} -0 ${CHMOD} 644
	${FIND} ${STAGEDIR}/${EXAMPLESDIR} -type d -print0 | ${XARGS} -0 ${CHMOD} 755

do-install-DOCS-on:
	@${MKDIR} ${STAGEDIR}/${DOCSDIR}
	${INSTALL_DATA} ${PORTDOCS:S,^,${WRKSRC}/,} ${STAGEDIR}/${DOCSDIR}

.include <bsd.port.mk>
OpenPOWER on IntegriCloud