netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arturo Borrero Gonzalez <arturo.borrero.glez@gmail.com>
To: netfilter-devel@vger.kernel.org
Cc: pablo@netfilter.org
Subject: [nft PATCH] files: replace interpreter during installation
Date: Tue, 24 Dec 2013 02:21:09 +0100	[thread overview]
Message-ID: <20131224012109.21061.76735.stgit@nfdev.cica.es> (raw)

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>
---
 Makefile.defs.in  |    1 +
 configure.ac      |    1 +
 files/Makefile.in |    1 +
 3 files changed, 3 insertions(+)

diff --git a/Makefile.defs.in b/Makefile.defs.in
index 502f374..3fee9c2 100644
--- a/Makefile.defs.in
+++ b/Makefile.defs.in
@@ -5,6 +5,7 @@ LEX		= @LEX@
 YACC		= @YACC@
 MKDIR_P		= @MKDIR_P@
 INSTALL		= @INSTALL@
+SED		= @SED@
 
 PACKAGE_TARNAME	= @PACKAGE_TARNAME@
 
diff --git a/configure.ac b/configure.ac
index 811d7e2..ca14d83 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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"
diff --git a/files/Makefile.in b/files/Makefile.in
index cd67c37..563383b 100644
--- a/files/Makefile.in
+++ b/files/Makefile.in
@@ -2,3 +2,4 @@ install:
 	@echo -e "  INSTALL\tfiles"
 	$(MKDIR_P) $(DESTDIR)/$(confdir)
 	$(INSTALL) -m 755 -o root -g root $(SUBDIR)nftables/* $(DESTDIR)/$(confdir)/
+	$(SED) -i "s~#\! nft~#\!@sbindir@/nft~" $(DESTDIR)/$(confdir)/*


             reply	other threads:[~2013-12-24  1:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-24  1:21 Arturo Borrero Gonzalez [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-01-13  9:16 [nft PATCH] files: replace interpreter during installation Arturo Borrero Gonzalez
2014-01-13  9:39 ` Patrick McHardy
2014-01-13  9:49   ` Arturo Borrero Gonzalez
2014-01-13  9:52     ` Patrick McHardy
2014-01-13 16:30       ` Alex Elsayed
2014-01-14 12:48       ` Arturo Borrero Gonzalez
2014-01-14 13:11         ` Patrick McHardy
2014-01-14 15:00 ` Sam Liddicott
2014-01-14 15:16   ` Patrick McHardy
2014-01-22 16:45     ` Arturo Borrero Gonzalez
2014-01-22 16:51       ` Patrick McHardy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131224012109.21061.76735.stgit@nfdev.cica.es \
    --to=arturo.borrero.glez@gmail.com \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=pablo@netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).