From owner-svn-doc-all@freebsd.org Tue Oct 27 09:09:04 2015 Return-Path: Delivered-To: svn-doc-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 160158326; Tue, 27 Oct 2015 09:09:04 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E595C1BC7; Tue, 27 Oct 2015 09:09:03 +0000 (UTC) (envelope-from mat@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9R993Tl025848; Tue, 27 Oct 2015 09:09:03 GMT (envelope-from mat@FreeBSD.org) Received: (from mat@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9R9934L025847; Tue, 27 Oct 2015 09:09:03 GMT (envelope-from mat@FreeBSD.org) Message-Id: <201510270909.t9R9934L025847@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mat set sender to mat@FreeBSD.org using -f From: Mathieu Arnold Date: Tue, 27 Oct 2015 09:09:03 +0000 (UTC) To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r47681 - head/en_US.ISO8859-1/books/porters-handbook/uses X-SVN-Group: doc-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-doc-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire doc trees \(except for " user" , " projects" , and " translations" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Oct 2015 09:09:04 -0000 Author: mat Date: Tue Oct 27 09:09:02 2015 New Revision: 47681 URL: https://svnweb.freebsd.org/changeset/doc/47681 Log: Enhance USES=shebangfix a bit more. Reviewed by: wblock Sponsored by: Absolight Differential Revision: https://reviews.freebsd.org/D3979 Modified: head/en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml Modified: head/en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml ============================================================================== --- head/en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml Tue Oct 27 09:06:56 2015 (r47680) +++ head/en_US.ISO8859-1/books/porters-handbook/uses/chapter.xml Tue Oct 27 09:09:02 2015 (r47681) @@ -1143,8 +1143,19 @@ GSSAPI_NONE_CONFIGURE_ON= --without-gssa 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-gssa 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. +