diff --git a/en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml b/en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml index f938b8d93b..617b08c7a9 100644 --- a/en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml +++ b/en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml @@ -1143,8 +1143,19 @@ GSSAPI_NONE_CONFIGURE_ON= --without-gssapi A lot of software uses incorrect locations for script interpreters, most notably /usr/bin/perl - and /bin/bash. This fixes shebang lines in - scripts listed in SHEBANG_FILES. Currently + and /bin/bash. The shebagngfix macro fixes + shebang lines in scripts listed in + SHEBANG_FILES. The shebangfix macro is run + from ${WRKSRC}, so it can contain paths that + are relative to ${WRKSRC}. It can also deal + with absolute paths if files outside of + ${WRKSRC} require patching. For + example: + + USES= shebangfix +SHEBANG_FILES= scripts/foobar.pl scripts/*.sh + + Currently Bash, Java, Ksh, Lua, @@ -1154,23 +1165,43 @@ GSSAPI_NONE_CONFIGURE_ON= --without-gssapi and Tk are supported by default. To support another interpreter, set SHEBANG_LANG, - foo_OLD_CMD and - foo_CMD. For + interp_OLD_CMD and + interp_CMD. For example: SHEBANG_LANG= lua lua_OLD_CMD= /usr/bin/lua lua_CMD= ${LOCALBASE}/bin/lua - As foo_OLD_CMD - can contain multiple values, if an entry contains a space, it - needs to be quoted. For example, if it was not already defined, - the Ksh entry could be defined - as: + interp_OLD_CMD + will contain multiple values. Any entry with spaces must be + quoted. For example, if it was not already defined, the + Ksh entry could be defined as: SHEBANG_LANG= ksh ksh_OLD_CMD= "/usr/bin/env ksh" /bin/ksh /usr/bin/ksh ksh_CMD= ${LOCALBASE}/bin/ksh + + Some software uses strange locations for an interpreter. + For example, an application might expect + Python to be located in + /opt/bin/python2.7. The strange path to be + replaced can be declared in the port + Makefile: + + python_OLD_CMD= /opt/bin/python2.7 + + + The fixing of shebangs is done during the + patch phase. If scripts are + created with incorrect shebangs during the + build phase, the build process (for + examples, the configure script, or the + Makefiles) must be patched to generate + the right shebangs. Correct paths for supported interpreters + are available in + interp_CMD. +