From 0784cbd11e40aa6c04acb89c30b9d5bb45703b33 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Wed, 27 Jun 2018 11:50:40 +0200 Subject: [PATCH] build: use autoconf-style placeholders in sed-ed files Signed-off-by: Florian Westphal Signed-off-by: Phil Sutter --- Makefile | 8 ++++---- ebtables-save.in | 2 +- ebtables.8.in | 6 +++--- ebtables.sysv.in | 38 +++++++++++++++++++------------------- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Makefile b/Makefile index d0a12d6ed7325..7c70db0267983 100644 --- a/Makefile +++ b/Makefile @@ -155,13 +155,13 @@ tmp2:=$(shell printf $(SYSCONFIGDIR) | sed 's/\//\\\//g') tmp3:=$(shell printf $(PIPE) | sed 's/\//\\\//g') .PHONY: scripts scripts: ebtables-save.in ebtables.sysv.in ebtables-config.in - sed -e 's/__EXEC_PATH__/$(tmp1)/g' ebtables-save_ + sed -e 's/[@]sbindir@/$(tmp1)/g' ebtables-save_ mkdir -p $(DESTDIR)$(BINDIR) install -m 0755 ebtables-save_ $(DESTDIR)$(BINDIR)/ebtables-save - sed -e 's/__EXEC_PATH__/$(tmp1)/g' -e 's/__SYSCONFIG__/$(tmp2)/g' ebtables.sysv_ + sed -e 's/[@]sbindir@/$(tmp1)/g' -e 's/[@]sysconfigdir@/$(tmp2)/g' ebtables.sysv_ if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(INITDIR); fi if test -d $(DESTDIR)$(INITDIR); then install -m 0755 ebtables.sysv_ $(DESTDIR)$(INITDIR)/ebtables; fi - sed -e 's/__SYSCONFIG__/$(tmp2)/g' ebtables-config_ + sed -e 's/[@]sysconfigdir@/$(tmp2)/g' ebtables-config_ if [ "$(DESTDIR)" != "" ]; then mkdir -p $(DESTDIR)$(SYSCONFIGDIR); fi if test -d $(DESTDIR)$(SYSCONFIGDIR); then install -m 0600 ebtables-config_ $(DESTDIR)$(SYSCONFIGDIR)/ebtables-config; fi rm -f ebtables-save_ ebtables.sysv_ ebtables-config_ @@ -169,7 +169,7 @@ scripts: ebtables-save.in ebtables.sysv.in ebtables-config.in tmp4:=$(shell printf $(LOCKFILE) | sed 's/\//\\\//g') $(MANDIR)/man8/ebtables.8: ebtables.8.in mkdir -p $(DESTDIR)$(@D) - sed -e 's/$$(VERSION)/$(PROGVERSION)/' -e 's/$$(DATE)/$(PROGDATE)/' -e 's/$$(LOCKFILE)/$(tmp4)/' <$< >ebtables.8_ + sed -e 's/[@]PACKAGE_VERSION@/$(PROGVERSION)/' -e 's/[@]PACKAGE_DATE@/$(PROGDATE)/' -e 's/[@]LOCKFILE@/$(tmp4)/' <$< >ebtables.8_ install -m 0644 ebtables.8_ $(DESTDIR)$@ rm -f ebtables.8_ diff --git a/ebtables-save.in b/ebtables-save.in index 49d733b7adf5e..df141490c20b1 100644 --- a/ebtables-save.in +++ b/ebtables-save.in @@ -8,7 +8,7 @@ use strict; my $table; -my $ebtables = "__EXEC_PATH__/ebtables"; +my $ebtables = "@sbindir@/ebtables"; my $cnt = ""; my $version = "1.0"; my $table_name; diff --git a/ebtables.8.in b/ebtables.8.in index 00c4562d20036..3e97c84da0e86 100644 --- a/ebtables.8.in +++ b/ebtables.8.in @@ -1,4 +1,4 @@ -.TH EBTABLES 8 "December 2011" +.TH EBTABLES 8 "@PACKAGE_DATE@" .\" .\" Man page written by Bart De Schuymer .\" It is based on the iptables man page. @@ -24,7 +24,7 @@ .\" .\" .SH NAME -ebtables (v2.0.10-4) \- Ethernet bridge frame table administration +ebtables (@PACKAGE_VERSION@) \- Ethernet bridge frame table administration .SH SYNOPSIS .BR "ebtables " [ -t " table ] " - [ ACDI "] chain rule specification [match extensions] [watcher extensions] target" .br @@ -1123,7 +1123,7 @@ arp message and the hardware address length in the arp header is 6 bytes. .br .SH FILES .I /etc/ethertypes -.I /var/lib/ebtables/lock +.I @LOCKFILE@ .SH ENVIRONMENT VARIABLES .I EBTABLES_ATOMIC_FILE .SH MAILINGLISTS diff --git a/ebtables.sysv.in b/ebtables.sysv.in index b6848f14257e8..bbf0e7424cb2b 100644 --- a/ebtables.sysv.in +++ b/ebtables.sysv.in @@ -9,8 +9,8 @@ # chkconfig: - 15 85 # description: Ethernet Bridge filtering tables # -# config: __SYSCONFIG__/ebtables (text) -# __SYSCONFIG__/ebtables. (binary) +# config: @sysconfigdir@/ebtables (text) +# @sysconfigdir@/ebtables.
(binary) source /etc/init.d/functions source /etc/sysconfig/network @@ -18,9 +18,9 @@ source /etc/sysconfig/network # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 -[ -x __EXEC_PATH__/ebtables ] || exit 1 -[ -x __EXEC_PATH__/ebtables-save ] || exit 1 -[ -x __EXEC_PATH__/ebtables-restore ] || exit 1 +[ -x @sbindir@/ebtables ] || exit 1 +[ -x @sbindir@/ebtables-save ] || exit 1 +[ -x @sbindir@/ebtables-restore ] || exit 1 RETVAL=0 prog="ebtables" @@ -35,17 +35,17 @@ EBTABLES_SAVE_ON_STOP="no" EBTABLES_SAVE_ON_RESTART="no" EBTABLES_SAVE_COUNTER="no" -config=__SYSCONFIG__/$prog-config +config=@sysconfigdir@/$prog-config [ -f "$config" ] && . "$config" start() { echo -n $"Starting $desc ($prog): " if [ "$EBTABLES_BINARY_FORMAT" = "yes" ]; then - for table in $(ls __SYSCONFIG__/ebtables.* 2>/dev/null | sed -e 's/.*ebtables\.//' -e '/save/d' ); do - __EXEC_PATH__/ebtables -t $table --atomic-file __SYSCONFIG__/ebtables.$table --atomic-commit || RETVAL=1 + for table in $(ls @sysconfigdir@/ebtables.* 2>/dev/null | sed -e 's/.*ebtables\.//' -e '/save/d' ); do + @sbindir@/ebtables -t $table --atomic-file @sysconfigdir@/ebtables.$table --atomic-commit || RETVAL=1 done else - __EXEC_PATH__/ebtables-restore < /etc/sysconfig/ebtables || RETVAL=1 + @sbindir@/ebtables-restore < /etc/sysconfig/ebtables || RETVAL=1 fi if [ $RETVAL -eq 0 ]; then @@ -60,7 +60,7 @@ start() { stop() { echo -n $"Stopping $desc ($prog): " for table in $(grep '^ebtable_' /proc/modules | sed -e 's/ebtable_\([^ ]*\).*/\1/'); do - __EXEC_PATH__/ebtables -t $table --init-table || RETVAL=1 + @sbindir@/ebtables -t $table --init-table || RETVAL=1 done if [ "$EBTABLES_MODULES_UNLOAD" = "yes" ]; then @@ -86,22 +86,22 @@ restart() { save() { echo -n $"Saving $desc ($prog): " if [ "$EBTABLES_TEXT_FORMAT" = "yes" ]; then - if [ -e __SYSCONFIG__/ebtables ]; then - chmod 0600 __SYSCONFIG__/ebtables - mv -f __SYSCONFIG__/ebtables __SYSCONFIG__/ebtables.save + if [ -e @sysconfigdir@/ebtables ]; then + chmod 0600 @sysconfigdir@/ebtables + mv -f @sysconfigdir@/ebtables @sysconfigdir@/ebtables.save fi - __EXEC_PATH__/ebtables-save > __SYSCONFIG__/ebtables || RETVAL=1 + @sbindir@/ebtables-save > @sysconfigdir@/ebtables || RETVAL=1 fi if [ "$EBTABLES_BINARY_FORMAT" = "yes" ]; then - rm -f __SYSCONFIG__/ebtables.*.save - for oldtable in $(ls __SYSCONFIG__/ebtables.* 2>/dev/null | grep -vF 'ebtables.save'); do + rm -f @sysconfigdir@/ebtables.*.save + for oldtable in $(ls @sysconfigdir@/ebtables.* 2>/dev/null | grep -vF 'ebtables.save'); do chmod 0600 $oldtable mv -f $oldtable $oldtable.save done for table in $(grep '^ebtable_' /proc/modules | sed -e 's/ebtable_\([^ ]*\).*/\1/'); do - __EXEC_PATH__/ebtables -t $table --atomic-file __SYSCONFIG__/ebtables.$table --atomic-save || RETVAL=1 + @sbindir@/ebtables -t $table --atomic-file @sysconfigdir@/ebtables.$table --atomic-save || RETVAL=1 if [ "$EBTABLES_SAVE_COUNTER" = "no" ]; then - __EXEC_PATH__/ebtables -t $table --atomic-file __SYSCONFIG__/ebtables.$table -Z || RETVAL=1 + @sbindir@/ebtables -t $table --atomic-file @sysconfigdir@/ebtables.$table -Z || RETVAL=1 fi done fi @@ -134,7 +134,7 @@ case "$1" in save ;; status) - __EXEC_PATH__/ebtables-save + @sbindir@/ebtables-save RETVAL=$? ;; *) -- 2.21.0