Added RedHat related files, (init, logrotate, pam, rpm spec)
diff --git a/ports/redhat/bgpd.init b/ports/redhat/bgpd.init
new file mode 100644
index 0000000..d7c2e3f
--- /dev/null
+++ b/ports/redhat/bgpd.init
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: A BGPv4, BGPv4+, BGPv4- routing engine for use with Zebra
+#
+# processname: bgpd
+# config: /etc/zebra/bgpd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/bgpd.conf ] || exit 0
+
+RETVAL=0
+prog="bgpd"
+
+case "$1" in
+  start)
+	echo -n $"Starting $prog: "
+        daemon /usr/sbin/bgpd -d
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/bgpd
+	echo
+	;;
+  stop)
+	echo -n $"Shutting down $prog: "
+	killproc bgpd
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bgpd
+	echo
+	;;
+  restart|reload)
+        $0 stop
+        $0 start
+	RETVAL=$?
+        ;;
+  condrestart)
+        if [ -f /var/lock/subsys/bgpd ]; then
+                $0 stop
+		$0 start
+        fi
+	RETVAL=$?
+        ;;
+  status)
+        status bgpd
+	RETVAL=$?
+        ;;
+  *)
+	echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+	exit 1
+esac
+
+exit $RETVAL
diff --git a/ports/redhat/ospf6d.init b/ports/redhat/ospf6d.init
new file mode 100644
index 0000000..9a6e8c5
--- /dev/null
+++ b/ports/redhat/ospf6d.init
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: An OSPF routing engine for use with Zebra and IPv6
+#
+# processname: ospf6d
+# config: /etc/zebra/ospf6d.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING_IPV6}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/ospf6d.conf ] || exit 0
+
+RETVAL=0
+prog="ospf6d"
+
+case "$1" in
+  start)
+	echo -n $"Starting $prog: "
+        daemon /usr/sbin/ospf6d -d
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospf6d
+	echo
+	;;
+  stop)
+	echo -n $"Shutting down $prog: "
+	killproc ospf6d
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ospf6d
+	echo
+	;;
+  restart|reload)
+        $0 stop
+        $0 start
+	RETVAL=$?
+        ;;
+  condrestart)
+        if [ -f /var/lock/subsys/ospf6d ]; then
+                $0 stop
+		$0 start
+        fi
+	RETVAL=$?
+        ;;
+  status)
+        status ospf6d
+	RETVAL=$?
+        ;;
+  *)
+	echo $"Usage: $prog {start|stop|restart|reload|condrestart|status}"
+	exit 1
+esac
+
+exit $RETVAL
diff --git a/ports/redhat/ospfd.init b/ports/redhat/ospfd.init
new file mode 100644
index 0000000..4aab138
--- /dev/null
+++ b/ports/redhat/ospfd.init
@@ -0,0 +1,61 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: An OSPF v2 routing engine for use with Zebra
+#
+# processname: ospfd
+# config: /etc/zebra/ospfd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/ospfd.conf ] || exit 0
+
+RETVAL=0
+
+prog="ospfd"
+
+case "$1" in
+  start)
+	echo -n $"Starting $prog: "
+        daemon /usr/sbin/ospfd -d
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospfd
+	echo
+	;;
+  stop)
+	echo -n $"Shutting down $prog: "
+	killproc ospfd
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ospfd
+	echo
+	;;
+  restart|reload)
+        $0 stop
+        $0 start
+	RETVAL=$?
+        ;;
+  condrestart)
+        if [ -f /var/lock/subsys/ospfd ]; then
+                $0 stop
+		$0 start
+        fi
+	RETVAL=$?
+        ;;
+  status)
+        status ospfd
+	RETVAL=$?
+        ;;
+  *)
+	echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+	exit 1
+esac
+
+exit $RETVAL
diff --git a/ports/redhat/ripd.init b/ports/redhat/ripd.init
new file mode 100644
index 0000000..2ac6733
--- /dev/null
+++ b/ports/redhat/ripd.init
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: A RIP routing engine for use with Zebra
+#
+# processname: ripd
+# config: /etc/zebra/ripd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/ripd.conf ] || exit 0
+
+RETVAL=0
+prog="ripd"
+
+case "$1" in
+  start)
+	echo -n $"Starting $prog: "
+        daemon /usr/sbin/ripd -d
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripd
+	echo
+	;;
+  stop)
+	echo -n $"Shutting down $prog: "
+	killproc ripd
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripd
+	echo
+	;;
+  restart|reload)
+        $0 stop
+        $0 start
+	RETVAL=$?
+        ;;
+  condrestart)
+        if [ -f /var/lock/subsys/ripd ]; then
+                $0 stop
+		$0 start
+        fi
+	RETVAL=$?
+        ;;
+  status)
+        status ripd
+	RETVAL=$?
+        ;;
+  *)
+	echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+	exit 1
+esac
+
+exit $RETVAL
diff --git a/ports/redhat/ripngd.init b/ports/redhat/ripngd.init
new file mode 100644
index 0000000..be54a01
--- /dev/null
+++ b/ports/redhat/ripngd.init
@@ -0,0 +1,60 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: A RIP routing engine for use with Zebra and IPv6
+#
+# processname: ripngd
+# config: /etc/zebra/ripngd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+[ "${NETWORKING_IPV6}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/ripngd.conf ] || exit 0
+
+RETVAL=0
+prog="ripngd"
+
+case "$1" in
+  start)
+	echo -n $"Starting $prog: "
+        daemon /usr/sbin/ripngd -d
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripngd
+	echo
+	;;
+  stop)
+	echo -n $"Shutting down $prog: "
+	killproc ripngd
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripngd
+	echo
+	;;
+  restart|reload)
+        $0 stop
+        $0 start
+	RETVAL=$?
+        ;;
+  condrestart)
+        if [ -f /var/lock/subsys/ripngd ]; then
+                $0 stop
+		$0 start
+        fi
+	RETVAL=$?
+        ;;
+  status)
+        status ripngd
+	RETVAL=$?
+        ;;
+  *)
+	echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+	exit 1
+esac
+
+exit $RETVAL
diff --git a/ports/redhat/zebra.init b/ports/redhat/zebra.init
new file mode 100644
index 0000000..5a450e2
--- /dev/null
+++ b/ports/redhat/zebra.init
@@ -0,0 +1,61 @@
+#!/bin/bash
+#
+# chkconfig: - 15 85
+# description: GNU Zebra routing manager
+#
+# processname: zebra
+# config: /etc/zebra/zebra.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+# Check that networking is up.
+[ "${NETWORKING}" = "no" ] && exit 0
+
+# The process must be configured first.
+[ -f /etc/zebra/zebra.conf ] || exit 0
+
+RETVAL=0
+
+prog="zebra"
+
+case "$1" in
+  start)
+	echo -n $"Starting $prog: "
+
+	/sbin/ip route flush proto zebra
+			
+        daemon /usr/sbin/zebra -d
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/zebra
+	echo
+	;;
+  stop)
+	echo -n $"Shutting down $prog: "
+	killproc zebra
+	RETVAL=$?
+	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zebra
+	echo
+	;;
+  restart|reload)
+        $0 stop
+        $0 start
+	RETVAL=$?
+        ;;
+  condrestart)
+        if [ -f /var/lock/subsys/zebra ]; then
+                $0 stop
+		$0 start
+        fi
+	RETVAL=$?
+        ;;
+  status)
+        status zebra
+	RETVAL=$?
+        ;;
+  *)
+	echo $"Usage: $0 {start|stop|restart|reload|condrestart|status}"
+	exit 1
+esac
+
+exit $RETVAL
diff --git a/ports/redhat/zebra.logrotate b/ports/redhat/zebra.logrotate
new file mode 100644
index 0000000..2e352ff
--- /dev/null
+++ b/ports/redhat/zebra.logrotate
@@ -0,0 +1,59 @@
+/var/log/zebra/zebra.log {
+    notifempty
+    missingok
+    nocompress
+    weekly
+    postrotate
+	/usr/sbin/killall -USR1 zebra
+    endscript
+}
+
+/var/log/zebra/bgpd.log {
+    notifempty
+    missingok
+    nocompress
+    weekly
+    postrotate
+	/usr/sbin/killall -USR1 bgpd
+    endscript
+}
+
+/var/log/zebra/ospfd.log {
+    notifempty
+    missingok
+    nocompress
+    weekly
+    postrotate
+	/usr/sbin/killall -USR1 ospfd
+    endscript
+}
+
+/var/log/zebra/ospf6d.log {
+    notifempty
+    missingok
+    nocompress
+    weekly
+    postrotate
+	/usr/sbin/killall -USR1 ospf6d
+    endscript
+}
+
+/var/log/zebra/ripd.log {
+    notifempty
+    missingok
+    nocompress
+    weekly
+    postrotate
+	/usr/sbin/killall -USR1 ripd
+    endscript
+}
+
+/var/log/zebra/ripngd.log {
+    notifempty
+    missingok
+    nocompress
+    weekly
+    postrotate
+	/usr/sbin/killall -USR1 ripngd
+    endscript
+}
diff --git a/ports/redhat/zebra.pam b/ports/redhat/zebra.pam
new file mode 100644
index 0000000..fb17f59
--- /dev/null
+++ b/ports/redhat/zebra.pam
@@ -0,0 +1,10 @@
+#%PAM-1.0
+#
+# Only allow root (and possibly wheel) to use this because enable access
+# is unrestricted.
+
+auth       sufficient   /lib/security/pam_rootok.so
+# Uncomment the following line to implicitly trust users in the "wheel" group.
+#auth       sufficient   /lib/security/pam_wheel.so trust use_uid
+# Uncomment the following line to require a user to be in the "wheel" group.
+#auth       required     /lib/security/pam_wheel.so use_uid
diff --git a/ports/redhat/zebra.spec b/ports/redhat/zebra.spec
new file mode 100644
index 0000000..68bf765
--- /dev/null
+++ b/ports/redhat/zebra.spec
@@ -0,0 +1,275 @@
+%define 	with_snmp	0
+%define		with_vtysh	1
+%define		with_ospf_te	1
+%define		with_nssa	1
+%define		with_opaque_lsa 1
+%define		with_tcp_zebra	0
+%define		with_vtysh	1
+%define		with_pam	1
+%define		with_ipv6	1
+%define		with_multipath	32
+%define		_sysconfdir	/etc/zebra
+
+Summary: Routing daemon
+Name:		zebra
+Version:	0.93b
+Release:	2002111101
+License:	GPL
+Group: System Environment/Daemons
+Source0:	ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
+Source1:        zebra.init
+Source2:        bgpd.init
+Source3:        ospf6d.init
+Source4:        ospfd.init
+Source5:        ripd.init
+Source6:        ripngd.init
+Source8:	zebra.pam
+Source9:	zebra.logrotate
+Source10:	zebra.mpls-docs.tar.gz
+Patch0:		zebra-bgpd-hash.patch
+Patch1:		zebra-ptp.patch
+Patch2:		zebra-linkstate.patch
+Patch3:		zebra-ospfd-ptmp.patch
+Patch4:		zebra-ospfd-misc.patch
+Patch5:		zebra-ospfd-olsa.patch
+Patch7:		zebra-vtysh-write-config.patch
+Patch8:		zebra-ospfd-md5auth-seqnum.patch
+Patch9:		zebra-ospfd-oi_write_q.patch
+Patch10:	zebra-ripv1-netmask.patch
+Patch11:	zebra-ospfd-md5-buffer-fix.patch
+Patch12:	zebra-multi.patch
+URL:		http://www.zebra.org/
+%if %with_snmp
+BuildRequires:	ucd-snmp-devel
+Prereq:		ucd-snmp
+%endif
+BuildRequires:	texinfo tetex autoconf readline-devel ncurses-devel openssl-devel pam-devel
+# Initscripts > 5.60 is required for IPv6 support
+Prereq:		openssl ncurses readline initscripts pam
+Prereq:		/sbin/install-info
+Provides:	routingdaemon
+BuildRoot:	%{_tmppath}/%{name}-%{version}-root
+Obsoletes:	bird gated mrt
+
+%description
+GNU Zebra is a free software that manages TCP/IP based routing
+protocol. It takes multi-server and multi-thread approach to resolve
+the current complexity of the Internet.
+
+GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
+
+GNU Zebra is intended to be used as a Route Server and a Route
+Reflector. It is not a toolkit, it provides full routing power under
+a new architecture. GNU Zebra is unique in design in that it has a
+process for each protocol.
+
+%prep
+%setup  -q
+%patch0 -p1 -b .bgphash
+%patch1 -p0 -b .ptp
+%patch2 -p1 -b .linkstate
+%patch3 -p1 -b .ospf-ptmp
+%patch4 -p1 -b .ospf-misc
+%patch5 -p1 -b .ospf-olsa
+%patch7 -p1 -b .vtysh-write
+%patch8 -p2 -b .ospf-md5auth-seqnum
+%patch9 -p0 -b .ospfd-oi_write_q
+%patch10 -p0 -b .ripd-netmask
+%patch11 -p0 -b .ospfd-md5-buffer
+%patch12 -p0 -b .zebra-multi
+%{__tar} -zxf %{SOURCE10}
+
+%build
+%configure \
+	--with-cflags="-O2" \
+	--enable-netlink \
+%if %with_ipv6
+	--enable-ipv6 \
+%endif
+%if %with_snmp
+	--enable-snmp \
+%endif
+%if %with_multipath
+	--enable-multipath=%with_multipath \
+%endif
+%if %with_tcp_zebra
+	--enable-tcp-zebra \
+%endif
+%if %with_nssa
+	--enable-nssa \
+%endif
+%if %with_opaque_lsa
+	--enable-opaque-lsa \
+%endif
+%if %with_ospf_te
+	--enable-ospf-te \
+%endif
+%if %with_vtysh
+	--enable-vtysh \
+%endif
+%if %with_pam
+	--with-libpam
+%endif
+
+pushd vtysh
+make %{?_smp_mflags} rebuild
+popd
+
+make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
+
+pushd doc
+texi2html zebra.texi
+popd
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
+	$RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
+
+make install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
+install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
+install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
+install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
+install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
+install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
+install -m644 %{SOURCE8} $RPM_BUILD_ROOT/etc/pam.d/zebra
+install -m644 %{SOURCE9} $RPM_BUILD_ROOT/etc/logrotate.d/zebra
+
+
+%post
+# zebra_spec_add_service <sercice name> <port/proto> <comment>
+# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
+
+zebra_spec_add_service ()
+{
+  # Add port /etc/services entry if it isn't already there 
+  if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
+    echo "$1		$2			# $3"  >> /etc/services
+  fi
+}
+
+zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
+zebra_spec_add_service zebra    2601/tcp "zebra vty"
+zebra_spec_add_service ripd     2602/tcp "RIPd vty"
+zebra_spec_add_service ripngd   2603/tcp "RIPngd vty"
+zebra_spec_add_service ospfd    2604/tcp "OSPFd vty"
+zebra_spec_add_service bgpd     2605/tcp "BGPd vty"
+zebra_spec_add_service ospf6d   2606/tcp "OSPF6d vty"
+
+/sbin/chkconfig --add zebra 
+/sbin/chkconfig --add ripd
+/sbin/chkconfig --add ripngd
+/sbin/chkconfig --add ospfd
+/sbin/chkconfig --add ospf6d
+/sbin/chkconfig --add bgpd
+
+/sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
+
+# Create dummy files if they don't exist so basic functions can be used.
+if [ ! -e %{_sysconfdir}/zebra.conf ]; then
+	echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
+	chmod 640 %{_sysconfdir}/zebra.conf
+fi
+if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
+	touch %{_sysconfdir}/vtysh.conf
+	chmod 640 %{_sysconfdir}/vtysh.conf
+fi
+
+%postun
+if [ "$1" -ge  "1" ]; then
+	/etc/rc.d/init.d/zebra  condrestart >/dev/null 2>&1
+	/etc/rc.d/init.d/ripd   condrestart >/dev/null 2>&1
+	/etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
+	/etc/rc.d/init.d/ospfd  condrestart >/dev/null 2>&1
+	/etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
+	/etc/rc.d/init.d/bgpd   condrestart >/dev/null 2>&1
+fi
+/sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
+
+%preun
+if [ "$1" = "0" ]; then
+        /sbin/chkconfig --del zebra
+	/sbin/chkconfig --del ripd
+	/sbin/chkconfig --del ripngd
+	/sbin/chkconfig --del ospfd
+	/sbin/chkconfig --del ospf6d
+	/sbin/chkconfig --del bgpd
+fi
+
+%clean
+#rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%doc */*.sample* doc/zebra.html tools AUTHORS COPYING
+%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
+%dir %attr(750,root,root) %{_sysconfdir}
+%dir %attr(750,root,root) /var/log/zebra
+%dir %attr(755,root,root) /usr/share/info
+%{_infodir}/*info*
+%{_mandir}/man*/*
+%{_sbindir}/*
+%{_bindir}/*
+%config /etc/zebra/*
+%config /etc/rc.d/init.d/*
+%config(noreplace) /etc/pam.d/zebra
+%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
+
+%changelog
+* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
+- update to latest CVS
+- add Greg Troxel's md5 buffer copy/dup fix
+- add RIPv1 fix
+- add Frank's multicast flag fix
+
+* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
+- update to latest CVS
+- timestamped crypt_seqnum patch
+- oi->on_write_q fix
+
+* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
+- update to latest CVS
+- add vtysh 'write-config (integrated|daemon)' patch
+- always 'make rebuild' in vtysh/ to catch new commands
+
+* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
+- update to 0.93b
+
+* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
+- update to latest CVS
+- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
+
+* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
+- update to current CVS
+- add OSPF point to multipoint patch
+- add OSPF bugfixes
+- add BGP hash optimisation patch
+
+* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
+- update to 0.93-pre1 / CVS
+- add link state detection support
+- add generic PtP and RFC3021 support
+- various bug fixes
+
+* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
+- Fix bug #51336
+
+* Wed Aug  1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
+- Use generic initscript strings instead of initscript specific
+  ( "Starting foo: " -> "Starting $prog:" )
+
+* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
+- Bump the release when rebuilding into the dist.
+
+* Tue Feb  6 2001 Tim Powers <timp@redhat.com>
+- built for Powertools
+
+* Sun Feb  4 2001 Pekka Savola <pekkas@netcore.fi> 
+- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
+- Update to 0.91a
+- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
+- Should be quite Red Hat'isque now.