summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authoragc <agc@pkgsrc.org>2003-07-09 16:07:29 +0000
committeragc <agc@pkgsrc.org>2003-07-09 16:07:29 +0000
commit8338c82ca30dfda3adce83de7b740bf803f11dab (patch)
tree24572087b3d07ed3ce38bd8437b821772c95b24d /mk
parentd750aba60714e0d9cea99f9db0eedba304b13c15 (diff)
downloadpkgsrc-8338c82ca30dfda3adce83de7b740bf803f11dab.tar.gz
Make REPLACE_PERL more general, so that it will work with any interpreter,
and also with multiple interpreters. Keep REPLACE_PERL for backwards compatibility.
Diffstat (limited to 'mk')
-rw-r--r--mk/bsd.pkg.mk19
1 files changed, 14 insertions, 5 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk
index 27343774750..6e5ea25a174 100644
--- a/mk/bsd.pkg.mk
+++ b/mk/bsd.pkg.mk
@@ -1,4 +1,4 @@
-# $NetBSD: bsd.pkg.mk,v 1.1206 2003/07/09 14:23:56 agc Exp $
+# $NetBSD: bsd.pkg.mk,v 1.1207 2003/07/09 16:07:29 agc Exp $
#
# This file is in the public domain.
#
@@ -1982,14 +1982,22 @@ do-patch: uptodate-digest
# post-configure. These targets typically edit the files generated by
# the do-configure target that are used during the build phase.
-_CONFIGURE_PREREQ+= replace-perl
-replace-perl:
.if defined(REPLACE_PERL)
+REPLACE_INTERPRETER= perl
+_REPLACE.perl.old= .*/bin/perl
+_REPLACE.perl.new= ${PERL5}
+_REPLACE_FILES.perl= ${REPLACE_PERL}
+.endif
+
+_CONFIGURE_PREREQ+= replace-interpreter
+replace-interpreter:
+.if defined(REPLACE_INTERPRETER)
+. for lang in ${REPLACE_INTERPRETER}
${_PKG_SILENT}${_PKG_DEBUG} \
cd ${WRKSRC}; \
- for f in ${REPLACE_PERL}; do \
+ for f in ${_REPLACE_FILES.${lang}}; do \
if [ -f $${f} ]; then \
- ${SED} "s,#!.*/bin/perl,#!${PERL5}," \
+ ${SED} -e 's|#!${_REPLACE.${lang}.old}|#!${_REPLACE.${lang}.new}|' \
$${f} > $${f}.new; \
if [ -x $${f} ]; then \
${CHMOD} a+x $${f}.new; \
@@ -1997,6 +2005,7 @@ replace-perl:
${MV} -f $${f}.new $${f}; \
fi; \
done
+. endfor
.else
${_PKG_SILENT}${_PKG_DEBUG}${TRUE}
.endif