Initial revision
diff --git a/init/redhat/bgpd.init b/init/redhat/bgpd.init
new file mode 100644
index 0000000..91d2aeb
--- /dev/null
+++ b/init/redhat/bgpd.init
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: A BGPv4, BGPv4+, BGPv4- routing engine for use with Zebra
+#
+# processname: bgpd
+# config: /etc/bgpd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+
+[ -f /etc/bgpd.conf ] || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting bgpd: "
+ daemon /usr/sbin/bgpd -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/bgpd
+ echo
+ ;;
+ stop)
+ echo -n "Shutting down bgpd: "
+ killproc bgpd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bgpd
+ echo
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ status)
+ status bgpd
+ RETVAL=$?
+ ;;
+ *)
+ echo "Usage: bgpd {start|stop|restart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/init/redhat/ospf6d.init b/init/redhat/ospf6d.init
new file mode 100644
index 0000000..4d89f8a
--- /dev/null
+++ b/init/redhat/ospf6d.init
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: An OSPF routing engine for use with Zebra and IPv6
+#
+# processname: ospf6d
+# config: /etc/ospf6d.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+
+[ -f /etc/ospf6d.conf ] || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting ospf6d: "
+ daemon /usr/sbin/ospf6d -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospf6d
+ echo
+ ;;
+ stop)
+ echo -n "Shutting down ospf6d: "
+ killproc ospf6d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ospf6d
+ echo
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ status)
+ status ospf6d
+ RETVAL=$?
+ ;;
+ *)
+ echo "Usage: ospf6d {start|stop|restart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/init/redhat/ospfd.init b/init/redhat/ospfd.init
new file mode 100644
index 0000000..d7453b6
--- /dev/null
+++ b/init/redhat/ospfd.init
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: An OSPF v2 routing engine for use with Zebra
+#
+# processname: ospfd
+# config: /etc/ospfd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+
+[ -f /etc/ospfd.conf ] || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting ospfd: "
+ daemon /usr/sbin/ospfd -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ospfd
+ echo
+ ;;
+ stop)
+ echo -n "Shutting down ospfd: "
+ killproc ospfd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ospfd
+ echo
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ status)
+ status ospfd
+ RETVAL=$?
+ ;;
+ *)
+ echo "Usage: ospfd {start|stop|restart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/init/redhat/ripd.init b/init/redhat/ripd.init
new file mode 100644
index 0000000..d87f498
--- /dev/null
+++ b/init/redhat/ripd.init
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: A RIP routing engine for use with Zebra
+#
+# processname: ripd
+# config: /etc/ripd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+
+[ -f /etc/ripd.conf ] || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting ripd: "
+ daemon /usr/sbin/ripd -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripd
+ echo
+ ;;
+ stop)
+ echo -n "Shutting down ripd: "
+ killproc ripd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripd
+ echo
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ status)
+ status ripd
+ RETVAL=$?
+ ;;
+ *)
+ echo "Usage: ripd {start|stop|restart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/init/redhat/ripngd.init b/init/redhat/ripngd.init
new file mode 100644
index 0000000..26c153b
--- /dev/null
+++ b/init/redhat/ripngd.init
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# chkconfig: - 16 84
+# description: A RIP routing engine for use with Zebra and IPv6
+#
+# processname: ripngd
+# config: /etc/ripngd.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+
+[ -f /etc/ripngd.conf ] || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting ripngd: "
+ daemon /usr/sbin/ripngd -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ripngd
+ echo
+ ;;
+ stop)
+ echo -n "Shutting down ripngd: "
+ killproc ripngd
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ripngd
+ echo
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ status)
+ status ripngd
+ RETVAL=$?
+ ;;
+ *)
+ echo "Usage: ripngd {start|stop|restart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/init/redhat/zebra.init b/init/redhat/zebra.init
new file mode 100644
index 0000000..b09918a
--- /dev/null
+++ b/init/redhat/zebra.init
@@ -0,0 +1,45 @@
+#!/bin/bash
+#
+# chkconfig: - 15 85
+# description: GNU Zebra routing manager
+#
+# processname: zebra
+# config: /etc/zebra.conf
+
+# source function library
+. /etc/rc.d/init.d/functions
+
+RETVAL=0
+
+[ -f /etc/zebra.conf ] || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting zebra: "
+ daemon /usr/sbin/zebra -d
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && touch /var/lock/subsys/zebra
+ echo
+ ;;
+ stop)
+ echo -n "Shutting down zebra: "
+ killproc zebra
+ RETVAL=$?
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/zebra
+ echo
+ ;;
+ restart)
+ $0 stop
+ $0 start
+ RETVAL=$?
+ ;;
+ status)
+ status zebra
+ RETVAL=$?
+ ;;
+ *)
+ echo "Usage: zebra {start|stop|restart|status}"
+ exit 1
+esac
+
+exit $RETVAL
diff --git a/init/redhat/zebra.logrotate b/init/redhat/zebra.logrotate
new file mode 100644
index 0000000..0d13baf
--- /dev/null
+++ b/init/redhat/zebra.logrotate
@@ -0,0 +1,47 @@
+/var/log/zebra/zebra.log {
+ notifempty
+ missingok
+ postrotate
+ /usr/bin/killall -USR1 zebra
+ endscript
+}
+
+/var/log/zebra/bgpd.log {
+ notifempty
+ missingok
+ postrotate
+ /usr/bin/killall -USR1 bgpd
+ endscript
+}
+
+/var/log/zebra/ospf.log {
+ notifempty
+ missingok
+ postrotate
+ /usr/bin/killall -USR1 ospfd
+ endscript
+}
+
+/var/log/zebra/ospf6.log {
+ notifempty
+ missingok
+ postrotate
+ /usr/bin/killall -USR1 ospf6d
+ endscript
+}
+
+/var/log/zebra/rip.log {
+ notifempty
+ missingok
+ postrotate
+ /usr/bin/killall -USR1 ripd
+ endscript
+}
+
+/var/log/zebra/ripng.log {
+ notifempty
+ missingok
+ postrotate
+ /usr/bin/killall -USR1 ripng
+ endscript
+}
diff --git a/init/redhat/zebra.spec.in b/init/redhat/zebra.spec.in
new file mode 100644
index 0000000..e517a46
--- /dev/null
+++ b/init/redhat/zebra.spec.in
@@ -0,0 +1,128 @@
+%define version @VERSION@
+
+Summary: Zebra routing engine
+Name: zebra
+Version: %{version}
+Release: 1
+Source: zebra-%{version}.tar.gz
+URL: http://www.zebra.org
+Copyright: GPL
+Group: System Environment/Daemons
+BuildRoot: /tmp/zebra-%{version}-root
+
+%description
+GNU Zebra is free software (distributed under GNU Generic Public License)
+that manages TCP/IP based routing protocols. It supports BGP-4 protocol as
+described in RFC1771 (A Border Gateway Protocol 4) as well as RIPv1, RIPv2
+and OSPFv2. Unlike traditional, Gated based, monolithic architectures and
+even the so-called "new modular architectures" that remove the burden of
+processing routing functions from the cpu and utilize special ASIC chips
+instead, Zebra software offers true modularity.
+
+%prep
+%setup
+
+%build
+#./configure --enable-snmp --prefix=/usr --sysconfdir=/etc
+./configure --prefix=/usr --sysconfdir=/etc
+make
+
+%install
+rm -rf $RPM_BUILD_ROOT
+make DESTDIR=$RPM_BUILD_ROOT install
+rm -f $RPM_BUILD_ROOT/usr/info/dir
+rm -f $RPM_BUILD_ROOT/usr/man/man8/ospf6*
+rm -f $RPM_BUILD_ROOT/usr/man/man8/ripng*
+rm -f $RPM_BUILD_ROOT/usr/sbin/ospf6d
+rm -f $RPM_BUILD_ROOT/usr/sbin/ripngd
+strip $RPM_BUILD_ROOT/usr/sbin/*
+
+mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d
+install -m755 init/redhat/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
+#install -m755 init/redhat/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
+install -m755 init/redhat/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
+install -m755 init/redhat/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
+#install -m755 init/redhat/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
+install -m755 init/redhat/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
+
+mkdir -p $RPM_BUILD_ROOT/etc/logrotate.d
+install -m644 init/redhat/zebra.logrotate $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"
+
+#Install info
+/sbin/install-info /usr/info/zebra.info /usr/info/dir
+
+if [ -x /sbin/chkconfig ]; then
+ chkconfig --add bgpd
+# chkconfig --add ospf6d
+ chkconfig --add ospfd
+ chkconfig --add ripd
+# chkconfig --add ripngd
+ chkconfig --add zebra
+fi
+
+
+%preun
+if [ "$1" = 0 ] ; then
+ /sbin/install-info --delete /usr/info/zebra.info /usr/info/dir
+
+ if [ -x /sbin/chkconfig ]; then
+ chkconfig --del bgpd
+# chkconfig --del ospf6d
+ chkconfig --del ospfd
+ chkconfig --del ripd
+# chkconfig --del ripngd
+ chkconfig --del zebra
+ fi
+fi
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_DIR/%{name}-%{version}
+
+%files
+%attr(-,root,root) %doc AUTHORS COPYING ChangeLog INSTALL NEWS README SERVICES TODO bgpd/bgpd.conf.sample ospfd/ospfd.conf.sample ripd/ripd.conf.sample zebra/zebra.conf.sample
+%attr(-,root,root) %config /etc/rc.d/init.d/*
+%attr(-,root,root) %config /etc/logrotate.d/*
+%attr(-,root,root) /usr/info/*
+#%attr(-,root,root) /usr/man/* # Not man1 to exclude vtysh man page as
+ # it is not build by default (for now)
+%attr(-,root,root) /usr/man/man8/*
+%attr(-,root,root) /usr/sbin/*
+
+%changelog
+* Mon Nov 6 2000 Lennert Buytenhek <buytenh@gnu.org>
+- Don't include ospf6d and ripngd in package.
+- Fix logrotate file (add ospf.log).
+* Mon Oct 2 2000 Horms <horms@valinux.com>
+- Install and uninstall info in %post and %preun respectively
+- Moved chkconfig --del operations from %postun to %preun, as
+ chkconfig needs to run while the init files are still present on
+ the system.
+- Don't install vtysh man page as vtysh is not build by default
+- Added logrotate script so logs won't grow without bound
+* Wed Sep 27 2000 Horms <horms@vergenet.net>
+- Add ports to /etc/services if they aren't there
+- forcibly remove $RPM_BUILD_ROOT/usr/info/dir and friends so
+ there is no error if it does not exist when rm is run.
+- Clean up the zebra build dir