Makefile 2.02 KB
Newer Older
sunpoet's avatar
sunpoet committed
1
# Created by: Sunpoet Po-Chuan Hsieh <sunpoet@sunpoet.net>
2
3
4
# $FreeBSD$

PORTNAME=	weather
sunpoet's avatar
sunpoet committed
5
PORTVERSION=	2.3
6
7
CATEGORIES=	astro python
MASTER_SITES=	http://fungi.yuggoth.org/weather/src/ \
8
		LOCAL/sunpoet
9

10
MAINTAINER=	sunpoet@FreeBSD.org
11
COMMENT=	Utility to provide current weather conditions and forecasts
12

sunpoet's avatar
sunpoet committed
13
LICENSE=	ISCL
sunpoet's avatar
sunpoet committed
14
LICENSE_FILE=	${WRKSRC}/LICENSE
sunpoet's avatar
sunpoet committed
15

16
NO_ARCH=	yes
sunpoet's avatar
sunpoet committed
17
USES=		python shebangfix tar:xz
18

sunpoet's avatar
sunpoet committed
19
PLIST_FILES=	bin/${PORTNAME} \
20
		%%PYTHON_SITELIBDIR%%/${PORTNAME}.py \
sunpoet's avatar
sunpoet committed
21
		%%PYTHON_SITELIBDIR%%/${PYCACHE_DIR}${PYCACHE_FILE}.pyc \
sunpoet's avatar
sunpoet committed
22
		%%PYTHON_SITELIBDIR%%/${PYCACHE_DIR}${PYCACHE_FILE}.${PYTHON_PYOEXTENSION} \
sunpoet's avatar
sunpoet committed
23
24
		man/man1/${PORTNAME}.1.gz \
		man/man5/${PORTNAME}rc.5.gz
25
PORTDATA=	airports places stations zctas zones
26

27
SHEBANG_FILES=	${PORTNAME}
28

sunpoet's avatar
sunpoet committed
29
30
.include <bsd.port.pre.mk>

31
.if ${PYTHON_REL} < 3200
sunpoet's avatar
sunpoet committed
32
33
34
35
36
37
38
PYCACHE_DIR=	# empty
PYCACHE_FILE=	${PORTNAME}
.else
PYCACHE_DIR=	__pycache__/
PYCACHE_FILE=	${PORTNAME}.cpython-${PYTHON_SUFFIX}
.endif

39
do-build:
sunpoet's avatar
sunpoet committed
40
41
	@${PYTHON_CMD} -m compileall ${WRKSRC}/${PORTNAME}.py
	@${PYTHON_CMD} -O -m compileall ${WRKSRC}/${PORTNAME}.py
42
43

do-install:
sunpoet's avatar
sunpoet committed
44
	${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/ ${STAGEDIR}${PYTHON_SITELIBDIR}/${PYCACHE_DIR}
sunpoet's avatar
sunpoet committed
45
	${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
sunpoet's avatar
sunpoet committed
46
47
	${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.py ${STAGEDIR}${PYTHON_SITELIBDIR}/
	${INSTALL_DATA} ${WRKSRC}/${PYCACHE_DIR}${PYCACHE_FILE}.pyc ${STAGEDIR}${PYTHON_SITELIBDIR}/${PYCACHE_DIR}
sunpoet's avatar
sunpoet committed
48
	${INSTALL_DATA} ${WRKSRC}/${PYCACHE_DIR}${PYCACHE_FILE}.${PYTHON_PYOEXTENSION} ${STAGEDIR}${PYTHON_SITELIBDIR}/${PYCACHE_DIR}
sunpoet's avatar
sunpoet committed
49
50
51
52
	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}.1 ${STAGEDIR}${MANPREFIX}/man/man1/${PORTNAME}.1
	${INSTALL_MAN} ${WRKSRC}/${PORTNAME}rc.5 ${STAGEDIR}${MANPREFIX}/man/man5/${PORTNAME}rc.5
	${MKDIR} ${STAGEDIR}${DATADIR}/
	cd ${WRKSRC}/ && ${INSTALL_DATA} ${PORTDATA} ${STAGEDIR}${DATADIR}/
53
54
55
56
57
58
	@${ECHO_MSG} ""
	@${ECHO_MSG} "Please add the following to your .weatherrc in order to use installed data files:"
	@${ECHO_MSG} ""
	@${ECHO_MSG} "[default]"
	@${ECHO_MSG} "setpath = ${DATADIR}"
	@${ECHO_MSG} ""
59

sunpoet's avatar
sunpoet committed
60
.include <bsd.port.post.mk>