From e1e053d8e7b667026790e1a5872be1b4c8bcd6c7 Mon Sep 17 00:00:00 2001 From: teastep Date: Mon, 5 Jun 2006 17:13:48 +0000 Subject: [PATCH] Add Makefile so that -f will work under Shorewall Lite git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@3988 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-lite/Makefile | 17 +++++++++++++++++ Shorewall-lite/install.sh | 6 ++++++ Shorewall-lite/shorewall-lite.spec | 1 + 3 files changed, 24 insertions(+) create mode 100644 Shorewall-lite/Makefile diff --git a/Shorewall-lite/Makefile b/Shorewall-lite/Makefile new file mode 100644 index 000000000..3b5d055ba --- /dev/null +++ b/Shorewall-lite/Makefile @@ -0,0 +1,17 @@ +# Shorewall Makefile to restart if config-files are newer than last restart +VARDIR=/var/lib/shorewall +SHAREDIR=/usr/share/shorewall +RESTOREFILE?=.restore +all: $(VARDIR)/${RESTOREFILE} + +$(VARDIR)/${RESTOREFILE}: $(SHAREDIR)/firewall + @/sbin/shorewall -q save >/dev/null; \ + if \ + /sbin/shorewall -q restart >/dev/null 2>&1; \ + then \ + /sbin/shorewall -q save >/dev/null; \ + else \ + /sbin/shorewall -q restart 2>&1 | tail >&2; \ + fi + +# EOF diff --git a/Shorewall-lite/install.sh b/Shorewall-lite/install.sh index 9b5a6d53c..024e6ff3e 100755 --- a/Shorewall-lite/install.sh +++ b/Shorewall-lite/install.sh @@ -266,6 +266,12 @@ if [ -n "$ARCHLINUX" ] ; then sed -e 's!LOGFILE=/var/log/messages!LOGFILE=/var/log/messages.log!' -i ${PREFIX}/etc/shorewall/shorewall.conf fi +# +# Install the Makefile +# +run_install $OWNERSHIP -m 0600 Makefile ${PREFIX}/etc/shorewall/Makefile +echo "Makefile installed as ${PREFIX}/etc/shorewall/Makefile" + # # Install the default config path file # diff --git a/Shorewall-lite/shorewall-lite.spec b/Shorewall-lite/shorewall-lite.spec index dac87fbf0..9f7069931 100644 --- a/Shorewall-lite/shorewall-lite.spec +++ b/Shorewall-lite/shorewall-lite.spec @@ -63,6 +63,7 @@ fi %defattr(0644,root,root,0755) %attr(0755,root,root) %dir /etc/shorewall %attr(0644,root,root) %config(noreplace) /etc/shorewall/shorewall.conf +%attr(0644,root,root) /etc/shorewall/Makefile %attr(0544,root,root) /etc/init.d/shorewall %attr(0755,root,root) %dir /usr/share/shorewall %attr(0700,root,root) %dir /var/lib/shorewall