blob: 3d5f79ed8a98045696debbc643539e68e1321d70 (
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
|
# Created by: Sunpoet Po-Chuan Hsieh <sunpoet@sunpoet.net>
# $FreeBSD$
PORTNAME= weather
PORTVERSION= 2.0
PORTREVISION= 1
CATEGORIES= astro python
MASTER_SITES= http://fungi.yuggoth.org/weather/src/ \
LOCAL/sunpoet
MAINTAINER= sunpoet@FreeBSD.org
COMMENT= Utility to provide current weather conditions and forecasts
LICENSE= ISCL
LICENSE_FILE= ${WRKSRC}/LICENSE
USES= python shebangfix tar:xz
PLIST_FILES= bin/${PORTNAME} \
%%PYTHON_SITELIBDIR%%/${PORTNAME}.py \
%%PYTHON_SITELIBDIR%%/${PYCACHE_DIR}${PYCACHE_FILE}.pyc \
%%PYTHON_SITELIBDIR%%/${PYCACHE_DIR}${PYCACHE_FILE}.${PYOEXTENSION} \
man/man1/${PORTNAME}.1.gz \
man/man5/${PORTNAME}rc.5.gz
PORTDATA= airports places stations zctas zones
SHEBANG_FILES= ${PORTNAME}
.include <bsd.port.pre.mk>
.if ${PYTHON_REL} < 3200
PYCACHE_DIR= # empty
PYCACHE_FILE= ${PORTNAME}
.else
PYCACHE_DIR= __pycache__/
PYCACHE_FILE= ${PORTNAME}.cpython-${PYTHON_SUFFIX}
.endif
.if ${PYTHON_REL} < 3500
PYOEXTENSION= pyo
.else
PYOEXTENSION= opt-1.pyc
.endif
do-build:
@${PYTHON_CMD} -m compileall ${WRKSRC}/${PORTNAME}.py
@${PYTHON_CMD} -O -m compileall ${WRKSRC}/${PORTNAME}.py
do-install:
${MKDIR} ${STAGEDIR}${PYTHON_SITELIBDIR}/ ${STAGEDIR}${PYTHON_SITELIBDIR}/${PYCACHE_DIR}
${INSTALL_SCRIPT} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/${PORTNAME}
${INSTALL_DATA} ${WRKSRC}/${PORTNAME}.py ${STAGEDIR}${PYTHON_SITELIBDIR}/
${INSTALL_DATA} ${WRKSRC}/${PYCACHE_DIR}${PYCACHE_FILE}.pyc ${STAGEDIR}${PYTHON_SITELIBDIR}/${PYCACHE_DIR}
${INSTALL_DATA} ${WRKSRC}/${PYCACHE_DIR}${PYCACHE_FILE}.${PYOEXTENSION} ${STAGEDIR}${PYTHON_SITELIBDIR}/${PYCACHE_DIR}
${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}/
@${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} ""
.include <bsd.port.post.mk>
|