mirror_zfs/tests/test-runner/bin/Makefile.am
Ryan Moeller 4313a5b4c5 Detect if sed supports --in-place
Not all versions of sed have the --in-place flag. Detect support for
the flag during ./configure and provide a fallback mechanism for those
systems where sed's behavior differs. The autoconf variable
${ac_inplace} can be used to choose the correct flags for editing a
file in place with sed.

Replace violating usages in Makefile.am with ${ac_inplace}.

Reviewed-by: Chris Dunlop <chris@onthe.net.au>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Ryan Moeller <ryan@ixsystems.com>
Closes #9463
2019-10-16 19:19:48 -07:00

16 lines
541 B
Makefile

pkgdatadir = $(datadir)/@PACKAGE@/test-runner/bin
dist_pkgdata_SCRIPTS = \
test-runner.py \
zts-report.py
#
# These scripts are 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-data-hook:
sed ${ac_inplace} -e 's|^#!/usr/bin/env python3|#!/usr/bin/env python2|' \
$(DESTDIR)$(pkgdatadir)/test-runner.py \
$(DESTDIR)$(pkgdatadir)/zts-report.py
endif