%define with_snmp 0 %define _sysconfdir /etc/zebra %define name zebra %define version 0.93 %define version_tag pre1 %define rname %{name}-%{version}-%{version_tag} Summary: Routing daemon Name: %{name} Version: %{version} Release: %{version_tag}_bis_%(date +%%Y%%m%%d) License: GPL Group: System Environment/Daemons Source0: ftp://ftp.zebra.org/pub/zebra/%{rname}.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.sysconfig Source11: ospfd.sysconfig 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 BuildRequires: tetex # 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 -n %{rname} #%patch -p1 %build %configure \ --enable-one-vty \ --enable-ipv6 \ --enable-netlink \ %if %with_snmp --enable-snmp \ %endif --enable-vtysh \ --with-libpam make %{?_smp_mflags} 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 install -m644 %{SOURCE10} $RPM_BUILD_ROOT/etc/sysconfig/zebra install -m644 %{SOURCE11} $RPM_BUILD_ROOT/etc/sysconfig/ospfd %post # zebra_spec_add_service # 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 zebra on /sbin/chkconfig --add ripd /sbin/chkconfig --add ripngd /sbin/chkconfig --add ospfd #/sbin/chkconfig ospfd on /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 %{_infodir}/*info* %{_mandir}/man*/* %{_sbindir}/* %{_bindir}/* %config /etc/rc.d/init.d/* %config(noreplace) /etc/pam.d/zebra %config(noreplace) %attr(640,root,root) /etc/logrotate.d/* %config(noreplace) /etc/sysconfig/ospfd %config(noreplace) /etc/sysconfig/zebra %changelog * Mon May 13 2002 Dale Bewley - Bump to 0.93-pre1 * Fri Feb 08 2002 Dale Bewley - Add sysconfig support to zebra.init and ospfd.init. * Wed Jan 09 2002 Tim Powers - automated rebuild * Thu Jan 03 2002 Elliot Lee 0.92a-1 - Update to 0.92a * Thu Aug 09 2001 Elliot Lee 0.91a-6 - Fix bug #51336 * Wed Aug 1 2001 Trond Eivind Glomsrød 0.91a-5 - Use generic initscript strings instead of initscript specific ( "Starting foo: " -> "Starting $prog:" ) * Fri Jul 27 2001 Elliot Lee 0.91a-4 - Bump the release when rebuilding into the dist. * Tue Feb 6 2001 Tim Powers - built for Powertools * Sun Feb 4 2001 Pekka Savola - 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.