mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
088f97b921
/usr/bin/env python3 is the suggested[1] shebang for Python in general (likewise for python2) and is conventional across platforms. This eases development on systems where python is not installed in /usr/bin (FreeBSD for example) and makes it possible to develop in virtual environments (venv) for isolating dependencies. Many packaging guidelines discourage the use of /usr/bin/env, but since this is the canonical way of writing shebangs in the Python community, many packaging scripts are already equipped to handle substituting the appropriate absolute path to python automatically. Some RPM package builders lacking brp-mangle-shebangs need a small fallback mechanism in the package spec to stamp the appropriate shebang on installed Python scripts. [1]: https://docs.python.org/3/using/unix.html?#miscellaneous Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Melikov <mail@gmelikov.ru> Signed-off-by: Ryan Moeller <ryan@ixsystems.com> Closes #9314
14 lines
407 B
Makefile
14 lines
407 B
Makefile
dist_bin_SCRIPTS = dbufstat
|
|
|
|
#
|
|
# The dbufstat script is compatible with both Python 2.6 and 3.4.
|
|
# As such the python 3 shebang can be replaced at install time when
|
|
# targeting a python 2 system. This allows us to maintain a single
|
|
# version of the source.
|
|
#
|
|
if USING_PYTHON_2
|
|
install-exec-hook:
|
|
sed --in-place 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \
|
|
$(DESTDIR)$(bindir)/dbufstat
|
|
endif
|