]> git.proxmox.com Git - mirror_zfs.git/blobdiff - cmd/dbufstat/Makefile.am
pyzfs: python3 support (build system)
[mirror_zfs.git] / cmd / dbufstat / Makefile.am
index 19bffb0200c40e5767191c0b52f712e31e74b2fe..968a7607797fd41c94a832baca110d886656481d 100644 (file)
@@ -1 +1,13 @@
-dist_bin_SCRIPTS = dbufstat.py
+dist_bin_SCRIPTS = dbufstat
+
+#
+# The dbufstat script is compatibile 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/python3|#!/usr/bin/python2|' \
+           $(DESTDIR)$(bindir)/dbufstat
+endif