Index: en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml =================================================================== --- en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml +++ en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml @@ -1144,7 +1144,15 @@ 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 + scripts listed in SHEBANG_FILES. It is run + from ${WRKSRC}, so it can contain paths that + are relative to it, but it can contain absolute path if files + outside of WRKSRC need patching. For example: + + USES= shebangfix +SHEBANG_FILES= scripts/foobar.pl scripts/*.sh + + Currently Bash, Java, Ksh, Lua, @@ -1154,16 +1162,17 @@ 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 + As + interp_OLD_CMD + will 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: @@ -1171,6 +1180,24 @@ SHEBANG_LANG= ksh ksh_OLD_CMD= "/usr/bin/env ksh" /bin/ksh /usr/bin/ksh ksh_CMD= ${LOCALBASE}/bin/ksh + + If some software has a strange location for an interpreter, + for example, its Python is located in + /opt/bin/python2.7, add to the port + Makefile: + + python_OLD_CMD= /opt/bin/python2.7 + + + The fixing of shebangs is done during the + patch phase. If some scripts are + generated during the build phase, + and their resulting shebangs are wrong, the build process + should be patched to generate the right shebangs. All the + correct paths for supported interpreters + are available in + interp_CMD. +