summaryrefslogtreecommitdiff
path: root/lang/python/application.mk
blob: 323c31e7d7ee30de414899cd59f357a293e6e402 (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.4 2004/01/14 02:10:47 xtraeme 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