head 1.23; access; symbols pkgsrc-2023Q4:1.23.0.18 pkgsrc-2023Q4-base:1.23 pkgsrc-2023Q3:1.23.0.16 pkgsrc-2023Q3-base:1.23 pkgsrc-2023Q2:1.23.0.14 pkgsrc-2023Q2-base:1.23 pkgsrc-2023Q1:1.23.0.12 pkgsrc-2023Q1-base:1.23 pkgsrc-2022Q4:1.23.0.10 pkgsrc-2022Q4-base:1.23 pkgsrc-2022Q3:1.23.0.8 pkgsrc-2022Q3-base:1.23 pkgsrc-2022Q2:1.23.0.6 pkgsrc-2022Q2-base:1.23 pkgsrc-2022Q1:1.23.0.4 pkgsrc-2022Q1-base:1.23 pkgsrc-2021Q4:1.23.0.2 pkgsrc-2021Q4-base:1.23 pkgsrc-2021Q3:1.22.0.2 pkgsrc-2021Q3-base:1.22 pkgsrc-2021Q2:1.21.0.10 pkgsrc-2021Q2-base:1.21 pkgsrc-2021Q1:1.21.0.8 pkgsrc-2021Q1-base:1.21 pkgsrc-2020Q4:1.21.0.6 pkgsrc-2020Q4-base:1.21 pkgsrc-2020Q3:1.21.0.4 pkgsrc-2020Q3-base:1.21 pkgsrc-2020Q2:1.21.0.2 pkgsrc-2020Q2-base:1.21 pkgsrc-2020Q1:1.19.0.2 pkgsrc-2020Q1-base:1.19 pkgsrc-2019Q4:1.17.0.10 pkgsrc-2019Q4-base:1.17 pkgsrc-2019Q3:1.17.0.6 pkgsrc-2019Q3-base:1.17 pkgsrc-2019Q2:1.17.0.4 pkgsrc-2019Q2-base:1.17 pkgsrc-2019Q1:1.17.0.2 pkgsrc-2019Q1-base:1.17 pkgsrc-2018Q4:1.16.0.6 pkgsrc-2018Q4-base:1.16 pkgsrc-2018Q3:1.16.0.4 pkgsrc-2018Q3-base:1.16 pkgsrc-2018Q2:1.16.0.2 pkgsrc-2018Q2-base:1.16 pkgsrc-2018Q1:1.15.0.2 pkgsrc-2018Q1-base:1.15 pkgsrc-2017Q4:1.13.0.40 pkgsrc-2017Q4-base:1.13 pkgsrc-2017Q3:1.13.0.38 pkgsrc-2017Q3-base:1.13 pkgsrc-2017Q2:1.13.0.34 pkgsrc-2017Q2-base:1.13 pkgsrc-2017Q1:1.13.0.32 pkgsrc-2017Q1-base:1.13 pkgsrc-2016Q4:1.13.0.30 pkgsrc-2016Q4-base:1.13 pkgsrc-2016Q3:1.13.0.28 pkgsrc-2016Q3-base:1.13 pkgsrc-2016Q2:1.13.0.26 pkgsrc-2016Q2-base:1.13 pkgsrc-2016Q1:1.13.0.24 pkgsrc-2016Q1-base:1.13 pkgsrc-2015Q4:1.13.0.22 pkgsrc-2015Q4-base:1.13 pkgsrc-2015Q3:1.13.0.20 pkgsrc-2015Q3-base:1.13 pkgsrc-2015Q2:1.13.0.18 pkgsrc-2015Q2-base:1.13 pkgsrc-2015Q1:1.13.0.16 pkgsrc-2015Q1-base:1.13 pkgsrc-2014Q4:1.13.0.14 pkgsrc-2014Q4-base:1.13 pkgsrc-2014Q3:1.13.0.12 pkgsrc-2014Q3-base:1.13 pkgsrc-2014Q2:1.13.0.10 pkgsrc-2014Q2-base:1.13 pkgsrc-2014Q1:1.13.0.8 pkgsrc-2014Q1-base:1.13 pkgsrc-2013Q4:1.13.0.6 pkgsrc-2013Q4-base:1.13 pkgsrc-2013Q3:1.13.0.4 pkgsrc-2013Q3-base:1.13 pkgsrc-2013Q2:1.13.0.2 pkgsrc-2013Q2-base:1.13 pkgsrc-2013Q1:1.11.0.10 pkgsrc-2013Q1-base:1.11 pkgsrc-2012Q4:1.11.0.8 pkgsrc-2012Q4-base:1.11 pkgsrc-2012Q3:1.11.0.6 pkgsrc-2012Q3-base:1.11 pkgsrc-2012Q2:1.11.0.4 pkgsrc-2012Q2-base:1.11 pkgsrc-2012Q1:1.11.0.2 pkgsrc-2012Q1-base:1.11 pkgsrc-2011Q4:1.10.0.6 pkgsrc-2011Q4-base:1.10 pkgsrc-2011Q3:1.10.0.4 pkgsrc-2011Q3-base:1.10 pkgsrc-2011Q2:1.10.0.2 pkgsrc-2011Q2-base:1.10 pkgsrc-2011Q1:1.9.0.30 pkgsrc-2011Q1-base:1.9 pkgsrc-2010Q4:1.9.0.28 pkgsrc-2010Q4-base:1.9 pkgsrc-2010Q3:1.9.0.26 pkgsrc-2010Q3-base:1.9 pkgsrc-2010Q2:1.9.0.24 pkgsrc-2010Q2-base:1.9 pkgsrc-2010Q1:1.9.0.22 pkgsrc-2010Q1-base:1.9 pkgsrc-2009Q4:1.9.0.20 pkgsrc-2009Q4-base:1.9 pkgsrc-2009Q3:1.9.0.18 pkgsrc-2009Q3-base:1.9 pkgsrc-2009Q2:1.9.0.16 pkgsrc-2009Q2-base:1.9 pkgsrc-2009Q1:1.9.0.14 pkgsrc-2009Q1-base:1.9 pkgsrc-2008Q4:1.9.0.12 pkgsrc-2008Q4-base:1.9 pkgsrc-2008Q3:1.9.0.10 pkgsrc-2008Q3-base:1.9 cube-native-xorg:1.9.0.8 cube-native-xorg-base:1.9 pkgsrc-2008Q2:1.9.0.6 pkgsrc-2008Q2-base:1.9 cwrapper:1.9.0.4 pkgsrc-2008Q1:1.9.0.2 pkgsrc-2008Q1-base:1.9 pkgsrc-2007Q4:1.8.0.2 pkgsrc-2007Q4-base:1.8 pkgsrc-2007Q3:1.7.0.2 pkgsrc-2007Q3-base:1.7 pkgsrc-2007Q2:1.6.0.6 pkgsrc-2007Q2-base:1.6 pkgsrc-2007Q1:1.6.0.4 pkgsrc-2007Q1-base:1.6 jlam-pkgviews:1.6.0.2 jlam-pkgviews-base:1.6 pkgsrc-2006Q4:1.5.0.4 pkgsrc-2006Q4-base:1.5 pkgsrc-2006Q3:1.5.0.2 pkgsrc-2006Q3-base:1.5; locks; strict; comment @# @; 1.23 date 2021.11.09.17.39.42; author gutteridge; state Exp; branches; next 1.22; commitid tvx5Sucwa2dX39gD; 1.22 date 2021.09.09.21.59.36; author mef; state Exp; branches; next 1.21; commitid jVpBQwW6sgmKsk8D; 1.21 date 2020.06.07.06.10.36; author rillig; state Exp; branches; next 1.20; commitid DopNpVLRbnLOXfbC; 1.20 date 2020.05.18.06.06.34; author rillig; state Exp; branches; next 1.19; commitid iS2v4ySB6mr4AG8C; 1.19 date 2020.03.24.04.40.34; author rillig; state Exp; branches; next 1.18; commitid a1cJRZDh5xM3SB1C; 1.18 date 2020.03.22.21.31.21; author rillig; state Exp; branches; next 1.17; commitid mO9Vnfp6Hjt1xr1C; 1.17 date 2019.02.18.14.10.37; author bsiegert; state Exp; branches; next 1.16; commitid bkxhWmi8rRZXSfcB; 1.16 date 2018.04.17.09.31.41; author adam; state Exp; branches; next 1.15; commitid VKWyqaLewGSldMyA; 1.15 date 2018.03.11.15.07.45; author rillig; state Exp; branches; next 1.14; commitid oWRHkIDBSt4jg3uA; 1.14 date 2018.03.11.14.59.14; author rillig; state Exp; branches; next 1.13; commitid RCrB4jgX6wCnd3uA; 1.13 date 2013.04.18.00.24.48; author mspo; state Exp; branches; next 1.12; 1.12 date 2013.04.02.00.28.57; author mspo; state Exp; branches; next 1.11; 1.11 date 2012.02.06.06.18.36; author sbd; state Exp; branches; next 1.10; 1.10 date 2011.05.20.15.02.27; author wiz; state Exp; branches; next 1.9; 1.9 date 2008.02.07.21.36.13; author rillig; state Exp; branches; next 1.8; 1.8 date 2007.11.28.08.48.11; author rillig; state Exp; branches; next 1.7; 1.7 date 2007.07.28.00.42.33; author joerg; state Exp; branches; next 1.6; 1.6 date 2007.03.08.23.58.20; author rillig; state Exp; branches; next 1.5; 1.5 date 2006.09.19.20.51.34; author rillig; state Exp; branches; next 1.4; 1.4 date 2006.07.27.14.51.54; author rillig; state Exp; branches; next 1.3; 1.3 date 2006.07.20.13.54.44; author jlam; state Exp; branches; next 1.2; 1.2 date 2006.07.15.09.52.00; author rillig; state Exp; branches; next 1.1; 1.1 date 2006.07.05.06.09.15; author jlam; state Exp; branches; next ; desc @@ 1.23 log @replace-interpreter.mk: update a comment @ text @# $NetBSD: replace-interpreter.mk,v 1.22 2021/09/09 21:59:36 mef Exp $ # This file provides common templates for replacing #! interpreters # in script files. # # The following variables may be set by a package: # # REPLACE_AWK # REPLACE_BASH # REPLACE_CSH # REPLACE_KSH # REPLACE_PERL # REPLACE_PERL6 # REPLACE_R # REPLACE_SH # Lists of filename patterns relative to WRKSRC in which the #! # interpreter should be replaced by the pkgsrc one. Any directories # that appear in the lists are silenty skipped, assuming that # they result from shell globbing expressions. # # Use REPLACE_SH for shell programs that don't need any # special features from bash, and REPLACE_BASH for the # others. # # Note that in all the above cases, you have to add the needed # tools manually to USE_TOOLS, since there is no way to detect # automatically whether a tool should be a build-time or a # run-time dependency. # # Packages may also add their own interpreter replacements, which should # just look like the examples below. For the REPLACE_INTERPRETER # variable, all identifiers starting with "sys-" are reserved for the # pkgsrc infrastructure. All others may be used freely. # # Keywords: replace_interpreter interpreter interp hashbang #! shebang # Keywords: awk bash csh ksh perl R sh ###################################################################### ### replace-interpreter (PRIVATE) ###################################################################### ### replace-interpreter replaces paths to interpreters in scripts with ### the paths to the pkgsrc-managed interpreters. ### do-configure-pre-hook: replace-interpreter REPLACE_INTERPRETER?= # none REPLACE_AWK?= # none REPLACE_BASH?= # none REPLACE_CSH?= # none REPLACE_KSH?= # none REPLACE_PERL?= # none REPLACE_R?= # none REPLACE_SH?= # none .if !empty(REPLACE_AWK:M*) REPLACE_INTERPRETER+= sys-AWK REPLACE.sys-AWK.old= .*awk REPLACE.sys-AWK.new= ${AWK} REPLACE_FILES.sys-AWK= ${REPLACE_AWK} .endif .if !empty(REPLACE_BASH:M*) REPLACE_INTERPRETER+= sys-bash REPLACE.sys-bash.old= .*sh REPLACE.sys-bash.new= ${BASH} REPLACE_FILES.sys-bash= ${REPLACE_BASH} .endif .if !empty(REPLACE_CSH:M*) REPLACE_INTERPRETER+= sys-csh REPLACE.sys-csh.old= .*csh REPLACE.sys-csh.new= ${CSH} REPLACE_FILES.sys-csh= ${REPLACE_CSH} .endif .if !empty(REPLACE_KSH:M*) REPLACE_INTERPRETER+= sys-ksh REPLACE.sys-ksh.old= [^[:space:]]*sh REPLACE.sys-ksh.new= ${TOOLS_PATH.ksh} REPLACE_FILES.sys-ksh= ${REPLACE_KSH} .endif .if !empty(REPLACE_PERL:M*) REPLACE_INTERPRETER+= sys-Perl REPLACE.sys-Perl.old= .*perl[^[:space:]]* REPLACE.sys-Perl.new= ${PERL5} REPLACE_FILES.sys-Perl= ${REPLACE_PERL} .endif .if !empty(REPLACE_PERL6:M*) PERL6?= ${PREFIX}/bin/perl6 REPLACE_INTERPRETER+= sys-Perl6 REPLACE.sys-Perl6.old= .*perl6[^[:space:]]* REPLACE.sys-Perl6.new= ${PERL6} REPLACE_FILES.sys-Perl6=${REPLACE_PERL6} .endif .if !empty(REPLACE_R:M*) REPLACE_INTERPRETER+= sys-R REPLACE.sys-R.old= [^[:space:]]*R REPLACE.sys-R.new= ${PREFIX}/bin/R REPLACE_FILES.sys-R= ${REPLACE_R} .endif .if !empty(REPLACE_SH:M*) REPLACE_INTERPRETER+= sys-sh REPLACE.sys-sh.old= [^[:space:]]*sh REPLACE.sys-sh.new= ${SH} REPLACE_FILES.sys-sh= ${REPLACE_SH} .endif # sed regexp to match optional "/usr/bin/env" followed by one or more spaces REPLACE.optional-env-space= \(/usr/bin/env[[:space:]][[:space:]]*\)\{0,1\} .PHONY: replace-interpreter replace-interpreter: .for _lang_ in ${REPLACE_INTERPRETER} . if defined(REPLACE_FILES.${_lang_}) && !empty(REPLACE_FILES.${_lang_}:M*) @@${STEP_MSG} "Replacing ${_lang_:S/^sys-//} interpreter in "${REPLACE_FILES.${_lang_}:M*:Q}"." ${RUN} set -u; \ cd ${WRKSRC}; \ for f in ${REPLACE_FILES.${_lang_}}; do \ if [ -f "$$f" ]; then \ ${SED} -e '1s|^#![[:space:]]*${REPLACE.optional-env-space}${REPLACE.${_lang_}.old}|#!${REPLACE.${_lang_}.new}|' \ < "$${f}" > "$${f}.new"; \ if [ -x "$${f}" ]; then \ ${CHMOD} a+x "$${f}.new"; \ fi; \ if ${CMP} -s "$${f}.new" "$${f}"; then \ ${INFO_MSG} "[replace-interpreter] Nothing changed in $${f}."; \ ${RM} -f "$${f}.new"; \ else \ ${MV} -f "$${f}.new" "$${f}"; \ fi; \ elif [ -d "$$f" ] || [ -h "$$f" ]; then \ : 'Ignore it, most probably comes from shell globs'; \ else \ ${WARNING_MSG} "[replace-interpreter] Skipping non-existent file \"$$f\"."; \ fi; \ done . else @@${WARNING_MSG} "[replace-interpreter] Empty list of files for ${_lang_}." . endif .endfor _VARGROUPS+= interp _PKG_VARS.interp= REPLACE_AWK REPLACE_BASH REPLACE_CSH REPLACE_KSH _PKG_VARS.interp+= REPLACE_PERL REPLACE_PERL6 REPLACE_R REPLACE_SH _PKG_VARS.interp+= REPLACE_INTERPRETER .for interp in ${REPLACE_INTERPRETER} _DEF_VARS.interp+= REPLACE.${interp}.old REPLACE.${interp}.new REPLACE_FILES.${interp} .endfor @ 1.22 log @(replace-interpreter.mk) Add REPLACE_R, tks rillig@@ and greg@@ @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.21 2020/06/07 06:10:36 rillig Exp $ d36 1 a36 1 # Keywords: awk bash csh ksh perl sh @ 1.21 log @mk/configure/replace-interpreter.mk: clean up show-all-interp variables @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.20 2020/05/18 06:06:34 rillig Exp $ d14 1 d52 1 d98 7 d148 1 a148 1 _PKG_VARS.interp+= REPLACE_PERL REPLACE_PERL6 REPLACE_SH @ 1.20 log @mk/configure/replace-interpreter.mk: silently skip broken symlinks Like directories, they probably come from shell globs. Seen in misc/byobu. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.19 2020/03/24 04:40:34 rillig Exp $ d138 2 a139 3 .for varname in REPLACE_AWK REPLACE_BASH REPLACE_CSH REPLACE_KSH REPLACE_PERL REPLACE_PERL6 REPLACE_SH _PKG_VARS.interp+= ${varname} .endfor @ 1.19 log @replace-interpreter: make documentation more precise There are several places in pkgsrc where the files to be patched are listed individually instead of just saying util/*/*.sh. This is unnecessarily detailed. Encourage package authors to use filename patterns more often. An example is REPLACE_PYTHON in lang/clang, which currently fails because some of the listed files don't exist anymore. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.18 2020/03/22 21:31:21 rillig Exp $ d34 1 a34 1 # Keywords: replace_interpreter interpreter interp hashbang #! d114 1 a114 1 if [ -f "$${f}" ]; then \ d126 2 a127 2 elif [ -d "$$f" ]; then \ ${SHCOMMENT} "Ignore it, most probably comes from shell globs"; \ @ 1.18 log @mk/configure/replace-interpreter.mk: add missing empty line The optional /usr/bin/env is independent from sh. It applies to all languages. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.17 2019/02/18 14:10:37 bsiegert Exp $ d15 3 a17 3 # Lists of files relative to WRKSRC in which the #! interpreter # should be replaced by the pkgsrc one. If any directories # appear in the lists, they are silenty skipped, assuming that @ 1.17 log @replace-interpreter.mk: support REPLACE_PERL6. This is basically the same as REPLACE_PERL, except that there is a default for ${PERL6} inline if it is not otherwise defined. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.16 2018/04/17 09:31:41 adam Exp $ d102 1 @ 1.16 log @Print a message if REPLACE_INTERPRETER does not change anything (similar to SUBST_) @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.15 2018/03/11 15:07:45 rillig Exp $ d13 1 d88 8 d137 1 a137 1 .for varname in REPLACE_AWK REPLACE_BASH REPLACE_CSH REPLACE_KSH REPLACE_PERL REPLACE_SH @ 1.15 log @mk/configure/replace-interpreter.mk: document variables for show-all @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.14 2018/03/11 14:59:14 rillig Exp $ d110 6 a115 1 ${MV} -f "$${f}.new" "$${f}"; \ @ 1.14 log @mk/configure/replace-interpreter: add "make help" keywords @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.13 2013/04/18 00:24:48 mspo Exp $ d121 9 @ 1.13 log @use improved version from apb, works with parallel/paexec @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.12 2013/04/02 00:28:57 mspo Exp $ d33 2 a34 1 # Keywords: replace_interpreter interpreter interp @ 1.12 log @add some tricks to handle #!/usr/bin/env, do please improve @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.11 2012/02/06 06:18:36 sbd Exp $ d92 2 d104 1 a104 2 ${SED} -e '1{ /env -i/!s|^#![[:space:]]*/usr/bin/env|#!|;}' \ -e '1s|^#![[:space:]]*${REPLACE.${_lang_}.old}|#!${REPLACE.${_lang_}.new}|' \ @ 1.11 log @Add REPLACE_CSH as a replace interpreter template. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.10 2011/05/20 15:02:27 wiz Exp $ d102 2 a103 1 ${SED} -e '1s|^#![[:space:]]*${REPLACE.${_lang_}.old}|#!${REPLACE.${_lang_}.new}|' \ @ 1.10 log @Remove reference to REPLACE_PYTHON -- this file doesn't support it (look in lang/python/application.mk). Noticed by Rhialto in PR 44868. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.9 2008/02/07 21:36:13 rillig Exp $ d10 1 d46 1 d65 7 @ 1.9 log @Replaced _PKG_SILENT and _PKG_DEBUG with RUN. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.8 2007/11/28 08:48:11 rillig Exp $ a11 1 # REPLACE_PYTHON @ 1.8 log @Added keywords for "bmake help". @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.7 2007/07/28 00:42:33 joerg Exp $ d90 1 a90 1 ${_PKG_SILENT}${_PKG_DEBUG} set -eu; \ @ 1.7 log @Add REPLACE_KSH similiar to REPLACE_BASH and REPLACE_SH as the CHECK_INTERPRETER bulk build has shown a surprising number of packages using it. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.6 2007/03/08 23:58:20 rillig Exp $ d33 1 @ 1.6 log @Better documentation. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.5 2006/09/19 20:51:34 rillig Exp $ d10 1 d45 1 d63 7 @ 1.5 log @Bugfix: In the #! interpreter lines, allow white-space behind the #!. This fixes the build for audio/madman. Before, only some of the interpreters had been replaced. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.4 2006/07/27 14:51:54 rillig Exp $ d8 7 a14 6 # REPLACE_AWK : List of Pathmask (default: none) # REPLACE_BASH : List of Pathmask (default: none) # REPLACE_PERL : List of Pathmask (default: none) # REPLACE_SH : List of Pathmask (default: none) # In these files the interpreter in the first line is replaced # with the one that is available in pkgsrc. If any directory names @ 1.4 log @The intention behind REPLACE_BASH was to make replacing /bin/sh with ${BASH} easy, so the pattern that is replaced is now .*sh instead .*bash. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.3 2006/07/20 13:54:44 jlam Exp $ d83 1 a83 1 ${SED} -e '1s|^#!${REPLACE.${_lang_}.old}|#!${REPLACE.${_lang_}.new}|' \ @ 1.3 log @Change last instance of _REPLACE.* to REPLACE.*. Remove special _REPLACE.* handling from replace-interpreter.mk. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.2 2006/07/15 09:52:00 rillig Exp $ d55 1 a55 1 REPLACE.sys-bash.old= .*bash @ 1.2 log @Added some common script interpreters (awk, bash, sh) that can be replaced automatically by defining REPLACE_AWK, REPLACE_BASH or REPLACE_SH and an appropriate addition to USE_TOOLS. The replace-interpreter.mk file is included unconditionally because the number of variables that would trigger the inclusion of this file is quite large. @ text @d1 1 a1 1 # $NetBSD: replace-interpreter.mk,v 1.1 2006/07/05 06:09:15 jlam Exp $ a73 10 # XXX After 2006Q2, all instances of _REPLACE.* and _REPLACE_FILES.* should # XXX have been replaced with REPLACE.* and REPLACE_FILES.*. This code is # XXX then no longer needed. # XXX .for _lang_ in ${REPLACE_INTERPRETER} REPLACE.${_lang_}.old?= ${_REPLACE.${_lang_}.old} REPLACE.${_lang_}.new?= ${_REPLACE.${_lang_}.new} REPLACE_FILES.${_lang_}?= ${_REPLACE_FILES.${_lang_}} .endfor @ 1.1 log @Refactor configure, build, test and wrapper phases out of bsd.pkg.mk and into their own directories. Also do some cleanups with build/_build and pkginstall -- we get rid of _build and simply run pkginstall as part of the "build" target. Introduce a new mechanism to handle varying directory depths under ${WRKSRC} in which we find files to override, e.g. configure, config.*, libtool, etc. OVERRIDE_DIRDEPTH is a package-settable variable that specifies how far under ${WRKSRC} the various targets should look, and it defaults to "2". We preserve the meaning of the various *_OVERRIDE variables, so if they are defined, then their values supersede the OVERRIDE_DIRDEPTH mechanism. devel/tla will need to specially set OVERRIDE_DIRDEPTH to 3 (see log for revision 1.1857 for bsd.pkg.mk -- to be done in a separate commit. @ text @d1 30 a30 1 # $NetBSD$ d40 32 a71 5 .if defined(REPLACE_PERL) REPLACE_INTERPRETER+= perl REPLACE.perl.old= .*/bin/perl REPLACE.perl.new= ${PERL5} REPLACE_FILES.perl= ${REPLACE_PERL} d87 3 a89 3 @@${STEP_MSG} "Replacing interpreter paths in scripts" . for _pattern_ in ${REPLACE_FILES.${_lang_}} ${_PKG_SILENT}${_PKG_DEBUG} \ d91 12 a102 9 for file in ${_pattern_}; do \ if ${TEST} ! -f "$$file"; then \ ${WARNING_MSG} "[replace-interpreter.mk] Skipping non-existent file \"$$file\"."; \ continue; \ fi; \ ${SED} -e '1s|^#!${REPLACE.${_lang_}.old}|#!${REPLACE.${_lang_}.new}|' \ $$file > $$file.new; \ if ${TEST} -x $$file; then \ ${CHMOD} a+x $$file.new; \ a103 1 ${MV} -f $$file.new $$file; \ d105 3 a107 1 . endfor @