Add shorewall (#1588)
authorFlorian Fainelli <florian@openwrt.org>
Mon, 14 May 2007 21:27:03 +0000 (21:27 +0000)
committerFlorian Fainelli <florian@openwrt.org>
Mon, 14 May 2007 21:27:03 +0000 (21:27 +0000)
SVN-Revision: 7238

net/shorewall/Makefile [new file with mode: 0644]
net/shorewall/files/shorewall.init [new file with mode: 0644]

diff --git a/net/shorewall/Makefile b/net/shorewall/Makefile
new file mode 100644 (file)
index 0000000..b0b7f6f
--- /dev/null
@@ -0,0 +1,51 @@
+# 
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# $Id: $
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=shorewall
+PKG_VERSION:=3.4.2
+PKG_RELEASE:=1
+PKG_MD5SUM:=ca04cb57d2ff3995975e83155dd9944f
+
+PKG_SOURCE_URL:=http://www1.shorewall.net/pub/shorewall/3.4/shorewall-3.4.2/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tgz
+PKG_CAT:=zcat
+
+PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
+PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/shorewall
+  SECTION:=net
+  CATEGORY:=Network
+  TITLE:=Shorewall firewall
+  DESCRIPTION:=\
+       Shorewall Firewall is an iptables-based firewall for Linux.
+  URL:=http://www.shorewall.net/
+endef
+
+
+define Build/Compile
+       rm -rf $(PKG_INSTALL_DIR)
+       mkdir -p $(PKG_INSTALL_DIR)
+       PREFIX=$(PKG_INSTALL_DIR) $(PKG_BUILD_DIR)/install.sh
+endef
+
+define Package/shorewall/install
+       $(INSTALL_DIR) $(1)/sbin
+       $(INSTALL_DIR) $(1)/etc/init.d
+       $(INSTALL_DIR) $(1)/usr/share
+       $(INSTALL_BIN) ./files/shorewall.init $(1)/etc/init.d/shorewall
+       $(CP) $(PKG_INSTALL_DIR)/sbin/shorewall $(1)/sbin
+       $(CP) $(PKG_INSTALL_DIR)/usr/share/shorewall $(1)/usr/share
+       $(CP) $(PKG_INSTALL_DIR)/etc/shorewall $(1)/etc
+endef
+
+$(eval $(call BuildPackage,shorewall))
diff --git a/net/shorewall/files/shorewall.init b/net/shorewall/files/shorewall.init
new file mode 100644 (file)
index 0000000..f2ec40c
--- /dev/null
@@ -0,0 +1,24 @@
+#!/bin/sh /etc/rc.common
+
+START=46
+start() {
+        touch /var/log/messages
+        mkdir -p /var/lock/subsys
+        /sbin/shorewall -f start 1>/dev/null &
+}
+
+stop() {
+        /sbin/shorewall stop 1>/dev/null
+}
+
+restart() {
+        if [ -f /var/lib/shorewall/restore ] ; then
+        /sbin/shorewall restore
+        else
+        /sbin/shorewall restart 1>/dev/null
+        fi
+}
+clear() {
+        /sbin/shorewall clear
+}
+