]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
files: replace interpreter during installation
authorArturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Mon, 13 Jan 2014 09:37:45 +0000 (09:37 +0000)
committerPatrick McHardy <kaber@trash.net>
Mon, 13 Jan 2014 09:37:45 +0000 (09:37 +0000)
Many systems (for example Debian) don't recognice `#!nft -f' as a
valid interpreter.

A short way to handle this is to provide the full path to the interpreter
in the shebang.
That is what this patch does: update the shebang's path during installation.

For example, if you are installing under /usr/local, the shebang becomes:
 #!/usr/local/sbin/nft -f

If using --prefix=/, then:
 #!/sbin/nft -f

NOTE: If the shebang in source files are changed in a future, this sed script
should be updated as well.

Signed-off-by: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
Signed-off-by: Patrick McHardy <kaber@trash.net>
Makefile.defs.in
configure.ac
files/Makefile.in

index 502f3748dbee3edc81e2db1b69d592c93449694f..3fee9c22335745c176d1d609c287e62f6c1c6486 100644 (file)
@@ -5,6 +5,7 @@ LEX             = @LEX@
 YACC           = @YACC@
 MKDIR_P                = @MKDIR_P@
 INSTALL                = @INSTALL@
+SED            = @SED@
 
 PACKAGE_TARNAME        = @PACKAGE_TARNAME@
 
index 811d7e22721e671eb7bd460bbea0abb8122742d8..ca14d835e4c3e71fc6f11f64bfd360ee7f761d8f 100644 (file)
@@ -23,6 +23,7 @@ AC_SUBST([CONFIG_DEBUG])
 AC_PROG_CC
 AC_PROG_MKDIR_P
 AC_PROG_INSTALL
+AC_PROG_SED
 
 AC_CHECK_PROG(CONFIG_MAN, docbook2x-man, y, n)
 if test "$CONFIG_MAN" != "y"
index c3643df2a0b91c7d788e11c2a5ba30c31f158a45..dc237e23f4c5adde71e4aab661acd5291fae3e7c 100644 (file)
@@ -2,3 +2,4 @@ install:
        @echo -e "  INSTALL\tfiles"
        $(MKDIR_P) $(DESTDIR)/$(confdir)
        $(INSTALL) -m 755 -p $(SUBDIR)nftables/* $(DESTDIR)/$(confdir)/
+       $(SED) -i "s~#\! nft~#\!@sbindir@/nft~" $(DESTDIR)/$(confdir)/*