summaryrefslogtreecommitdiff
path: root/lang/python/application.mk
blob: 9c044d83eff447f47f1516b424988a8a5382d5e8 (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
# $NetBSD: application.mk,v 1.3 2002/10/18 16:34:54 jlam Exp $

.include "../../lang/python/pyversion.mk"

# replace shell magic by python version specific path
# PYTHON_PATCH_SCRIPTS is a list of Python scripts to be installed,
#  relative to ${WRKSRC}

_PYTHON_PATCH_SCRIPT_SED=	-e "1s;^\#!.*python;\#!${PYTHONBIN};"
_PYTHON_PATCH_SCRIPT_SED+=	${PYTHON_PATCH_SCRIPT_SED}

.if defined(PYTHON_PATCH_SCRIPTS)
python-patch-scripts:
.for FILE in ${PYTHON_PATCH_SCRIPTS}
	cd ${WRKSRC}; for file in ${FILE}; do				\
		${SED} ${_PYTHON_PATCH_SCRIPT_SED}			\
			$${file} > $${file}.fixed;			\
		if [ -x $${file} ]; then				\
			${CHMOD} +x $${file}.fixed;			\
		fi;							\
		${MV} -f $${file}.fixed $${file};			\
	done
.endfor

post-patch: python-patch-scripts
.endif