summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Ahlberg <aliz@gentoo.org>2003-07-25 13:33:37 +0000
committerDaniel Ahlberg <aliz@gentoo.org>2003-07-25 13:33:37 +0000
commitc3abb948edf0dcfea9dd4e3fb86d9a7834ba90b2 (patch)
tree55ea5e1cd0497c7fe574cc554f4b66c9382eec8c /net-firewall
parentinitial import (diff)
downloadgentoo-2-c3abb948edf0dcfea9dd4e3fb86d9a7834ba90b2.tar.gz
gentoo-2-c3abb948edf0dcfea9dd4e3fb86d9a7834ba90b2.tar.bz2
gentoo-2-c3abb948edf0dcfea9dd4e3fb86d9a7834ba90b2.zip
initial import
Diffstat (limited to 'net-firewall')
-rw-r--r--net-firewall/giptables/ChangeLog8
-rw-r--r--net-firewall/giptables/Manifest3
-rw-r--r--net-firewall/giptables/files/digest-giptables-1.11
-rw-r--r--net-firewall/giptables/files/giptables.init88
-rw-r--r--net-firewall/giptables/files/replace.sed3
-rw-r--r--net-firewall/giptables/giptables-1.1.ebuild72
6 files changed, 174 insertions, 1 deletions
diff --git a/net-firewall/giptables/ChangeLog b/net-firewall/giptables/ChangeLog
new file mode 100644
index 000000000000..c5ec0717dbdb
--- /dev/null
+++ b/net-firewall/giptables/ChangeLog
@@ -0,0 +1,8 @@
+# ChangeLog for net-firewall/giptables
+# Copyright 2000-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/giptables/ChangeLog,v 1.1 2003/07/25 13:33:13 aliz Exp $
+
+*giptables-1.1 (25 Jul 2003)
+
+ 25 Jul 2003; Daniel Ahlberg <aliz@gentoo.org> :
+ Initial import. Ebuild contributed by Meder Bakirov <bakirov@transfer.kg> in #21408.
diff --git a/net-firewall/giptables/Manifest b/net-firewall/giptables/Manifest
index 742bb65c0dfc..60400c8e4984 100644
--- a/net-firewall/giptables/Manifest
+++ b/net-firewall/giptables/Manifest
@@ -1,4 +1,5 @@
-MD5 dd00d47ff5abc99eb82fafcfd5d3b7d3 giptables-1.1.ebuild 2153
+MD5 d058f3e77ad5372c8c77d08883026dcc giptables-1.1.ebuild 2257
+MD5 3a872ea1ca0327e9f130db613af700fe ChangeLog 391
MD5 4efafed5ad73abd96ff8d280621ee253 files/giptables.init 2008
MD5 419996627a148ab4daeecaa8beea5404 files/replace.sed 123
MD5 4f4bc7762e6f3adc7df3e21dfc9e6837 files/digest-giptables-1.1 65
diff --git a/net-firewall/giptables/files/digest-giptables-1.1 b/net-firewall/giptables/files/digest-giptables-1.1
new file mode 100644
index 000000000000..6c21c4e60d51
--- /dev/null
+++ b/net-firewall/giptables/files/digest-giptables-1.1
@@ -0,0 +1 @@
+MD5 be71da722789ca3e1f3b7adcdab4f16d giptables-1.1.tar.gz 105560
diff --git a/net-firewall/giptables/files/giptables.init b/net-firewall/giptables/files/giptables.init
new file mode 100644
index 000000000000..8da08038f425
--- /dev/null
+++ b/net-firewall/giptables/files/giptables.init
@@ -0,0 +1,88 @@
+#!/sbin/runscript
+
+opts="start stop restart panic"
+
+GIPTABLES_HOME_DIR="/lib/giptables"
+GIPTABLES_CONF_FILE="/etc/giptables.conf"
+GIPTABLES_BLOCKED_FILE="/etc/conf.d/giptables.blocked"
+GIPTABLES_CUSTOM_FILE="/etc/conf.d/giptables.custom"
+GIPTABLES_LIB_FILE="$GIPTABLES_HOME_DIR/giptables-main"
+
+ROOT_UID=0 # Root has $UID 0
+
+EX_ERROR=1
+
+depend() {
+ before net
+ use logger
+ provide firewall
+}
+
+checkconfig() {
+ # Check to see if we are root
+ if [ "$UID" -ne "$ROOT_UID" ]; then
+ eerror "`basename $0`: You need to be root in order to start or stop the firewall"
+ exit $EX_ERROR
+ fi
+
+ # Check the availability of the iptables package
+ if [ ! -x /sbin/iptables ]; then
+ eerror "`basename $0`: iptables package not available"
+ exit $EX_ERROR
+ fi
+
+ # Check the kernel version
+ KERNEL_MAJ=`uname -r | sed -e 's,\..*,,'`
+ KERNEL_MIN=`uname -r | sed -e 's,[^\.]*\.,,' -e 's,\..*,,'`
+ if [ "$KERNEL_MAJ" -lt 2 ] || [ "$KERNEL_MAJ" -eq 2 -a "$KERNEL_MIN" -lt 4 ]; then
+ eerror "`basename $0`: Wrong kernel version"
+ exit $EX_ERROR
+ fi
+
+ # Ipchains module should not be loaded
+ [ -x /sbin/lsmod ] && \
+ if /sbin/lsmod 2>/dev/null | grep -q ipchains; then
+ eerror "`basename $0`: ipchains module should not be loaded"
+ exit $EX_ERROR
+ fi
+
+ # Loading main configuration file
+ if [ ! -f "$GIPTABLES_CONF_FILE" ]; then
+ eerror "`basename $0`: Main configuration file ($GIPTABLES_CONF_FILE) not found"
+ exit $EX_ERROR
+ fi
+
+ # Loading main library file
+ if [ ! -f "$GIPTABLES_LIB_FILE" ]; then
+ eerror "`basename $0`: Main library file ($GIPTABLES_LIB_FILE) not found"
+ exit $EX_ERROR
+ fi
+}
+
+source $GIPTABLES_CONF_FILE
+source $GIPTABLES_LIB_FILE
+
+start() {
+ ebegin "Starting up GIPTables Firewall"
+ checkconfig || return $EX_ERROR
+ start_giptables_firewall
+ eend $?
+}
+
+stop() {
+ ebegin "Shutting down GIPTables Firewall"
+ stop_giptables_firewall
+ eend $?
+}
+
+restart() {
+ svc_stop
+ svc_start
+}
+
+panic() {
+ ewarn "Panic GIPTables Firewall, DROP everything"
+ panic_giptables_firewall
+ eend $?
+}
+
diff --git a/net-firewall/giptables/files/replace.sed b/net-firewall/giptables/files/replace.sed
new file mode 100644
index 000000000000..63217a44ad91
--- /dev/null
+++ b/net-firewall/giptables/files/replace.sed
@@ -0,0 +1,3 @@
+s/rc\.d\/rc\.giptables\.custom/conf\.d\/giptables\.custom/g
+s/rc\.d\/rc\.giptables\.blocked/conf\.d\/giptables\.blocked/g
+
diff --git a/net-firewall/giptables/giptables-1.1.ebuild b/net-firewall/giptables/giptables-1.1.ebuild
new file mode 100644
index 000000000000..6d482010e3a5
--- /dev/null
+++ b/net-firewall/giptables/giptables-1.1.ebuild
@@ -0,0 +1,72 @@
+# Copyright 1999-2003 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-firewall/giptables/giptables-1.1.ebuild,v 1.1 2003/07/25 13:33:13 aliz Exp $
+
+DESCRIPTION="GIPTables Firewall is a free set of shell scripts that helps you generate iptables rules for Linux 2.4.x and newer kernels."
+HOMEPAGE="http://www.giptables.org/"
+SRC_URI="http://www.giptables.org/downloads/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="x86"
+
+IUSE=""
+
+DEPEND=""
+RDEPEND="net-firewall/iptables"
+
+S=${WORKDIR}/${P}
+
+src_install() {
+ dodir /etc/{conf.d,init.d}
+
+ # Creating GIPTables home, modules and conf directories
+ dodir /lib/giptables /lib/giptables/modules /lib/giptables/conf
+ chmod -R 700 ${D}/lib/giptables
+
+ # Copying GIPTables main library file /lib/giptables/giptables-main
+ cp -f ${S}/giptables-main ${D}/lib/giptables
+
+ # Copying GIPTables module files /lib/giptables/modules/*
+ cp -f ${S}/modules/* ${D}/lib/giptables/modules
+ chmod 600 ${D}/lib/giptables/modules/*
+
+ # Copying GIPTables example configuration files /lib/giptables/conf/*
+ cp -f ${S}/conf/* ${D}/lib/giptables/conf
+ chmod 600 ${D}/lib/giptables/conf/*
+
+ # Copying other GIPTables files
+ cp ${S}/if_ipaddr ${D}/lib/giptables
+ chmod 700 ${D}/lib/giptables/if_ipaddr
+
+ cp ${S}/rc.giptables.blocked ${D}/etc/conf.d/giptables.blocked
+ cp ${S}/rc.giptables.custom ${D}/etc/conf.d/giptables.custom
+ chmod 600 ${D}/etc/conf.d/giptables.blocked ${D}/etc/conf.d/giptables.custom
+
+ # Creating docs
+ dodoc AUTHORS COPYING ChangeLog* INSTALL README TODO
+ dodir /usr/share/doc/${PF}/html
+ mv ${S}/documentation/* ${D}/usr/share/doc/${PF}/html
+
+ # Creating init script
+ exeinto /etc/init.d
+ newexe ${FILESDIR}/giptables.init giptables
+}
+
+pkg_preinst() {
+ for conf_file in ${D}/lib/giptables/conf/*
+ do
+ sed -f ${FILESDIR}/replace.sed $conf_file > ${D}/lib/giptables/conf/sed.tmp
+ mv ${D}/lib/giptables/conf/sed.tmp $conf_file
+ done
+}
+
+pkg_postinst() {
+ einfo
+ einfo "Before running /etc/init.d/giptables or adding it to a runlevel with"
+ einfo "rc-update, be sure to create a config file /etc/giptables.conf"
+ einfo
+ einfo "For sample config files, please, look at /lib/giptables/conf"
+ einfo
+}
+