cvsdist 2872495
# configure options
cvsdist 2872495
%define 	with_snmp	0
cvsdist 2872495
%define		with_vtysh	1
cvsdist 2872495
%define		with_ospf_te	1
cvsdist 2872495
%define		with_nssa	1
cvsdist 2872495
%define		with_opaque_lsa 1
cvsdist 2872495
%define		with_tcp_zebra	0
cvsdist 2872495
%define		with_vtysh	1
cvsdist 2872495
%define		with_pam	1
cvsdist 2872495
%define		with_ipv6	1
cvsdist 2872495
%define		with_ospfclient 1
cvsdist 2872495
%define		with_ospfapi	1
cvsdist 51567ae
%define         with_rtadv      1
cvsdist 2872495
%define		with_multipath	64
cvsdist 2872495
%define		quagga_uid      92
cvsdist 2872495
%define		quagga_gid      92
cvsdist 2872495
%define		quagga_user	quagga
cvsdist d3aa9a9
%define		vty_group	quaggavt
cvsdist 2872495
cvsdist 2872495
# path defines
cvsdist 2872495
%define		_sysconfdir	/etc/quagga
cvsdist 2872495
%define		zeb_src		%{_builddir}/%{name}-%{version}
cvsdist 2872495
%define		zeb_rh_src	%{zeb_src}/redhat
cvsdist 2872495
%define		zeb_docs	%{zeb_src}/doc
cvsdist 2872495
cvsdist 2872495
# defines for configure
cvsdist 2872495
%define		_libexecdir	%{_exec_prefix}/libexec/quagga
cvsdist 51567ae
%define		_includedir	%{_prefix}/include
cvsdist 2872495
%define		_libdir		%{_exec_prefix}/%{_lib}/quagga
cvsdist 2872495
%define		_localstatedir	/var/run/quagga
cvsdist 2872495
cvsdist 2872495
Summary: Routing daemon
cvsdist 2872495
Name:		quagga
cvsdist 51567ae
Version:	0.96.5
cvsdist 51567ae
Release:	0
cvsdist 51567ae
Epoch: 0
cvsdist 2872495
License:	GPL
cvsdist 2872495
Group: System Environment/Daemons
cvsdist 2872495
Source0:	http://www.quagga.net/download/%{name}-%{version}.tar.gz
cvsdist 2872495
Source1:        quagga-filter-perl-requires.sh
cvsdist 51567ae
Patch0:         quagga-0.96.2-lib64.patch
cvsdist 51567ae
Patch1:         quagga-0.96.3-netlink.patch
cvsdist 2872495
URL:		http://www.quagga.net
cvsdist 2872495
%if %with_snmp
cvsdist 2872495
BuildRequires:	ucd-snmp-devel
cvsdist 2872495
Prereq:		ucd-snmp
cvsdist 2872495
%endif
cvsdist 2872495
%if %with_vtysh
cvsdist 2872495
BuildRequires:	readline readline-devel ncurses ncurses-devel
cvsdist 2872495
Prereq:		readline ncurses
cvsdist 2872495
%endif
cvsdist 2872495
BuildRequires:	texinfo tetex autoconf pam-devel patch libcap-devel
cvsdist 2872495
%define __perl_requires %{SOURCE1}
cvsdist 2872495
cvsdist 2872495
# Initscripts > 5.60 is required for IPv6 support
cvsdist 2872495
Prereq:		initscripts >= 5.60
cvsdist 2872495
Prereq:		ncurses readline pam
cvsdist 2872495
Prereq:		/sbin/install-info
cvsdist 2872495
Provides:	routingdaemon
cvsdist 2872495
BuildRoot:	%{_tmppath}/%{name}-%{version}-root
cvsdist 2872495
Obsoletes:	bird gated mrt zebra
cvsdist 2872495
cvsdist 2872495
%description
cvsdist 2872495
Quagga is a free software that manages TCP/IP based routing
cvsdist 2872495
protocol. It takes multi-server and multi-thread approach to resolve
cvsdist 2872495
the current complexity of the Internet.
cvsdist 2872495
cvsdist 2872495
Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
cvsdist 2872495
cvsdist 2872495
Quagga is intended to be used as a Route Server and a Route Reflector. It is
cvsdist 2872495
not a toolkit, it provides full routing power under a new architecture.
cvsdist 2872495
Quagga by design has a process for each protocol.
cvsdist 2872495
cvsdist 2872495
Quagga is a fork of GNU Zebra.
cvsdist 2872495
cvsdist 2872495
%package contrib
cvsdist 2872495
Summary: contrib tools for quagga
cvsdist 2872495
Group: System Environment/Daemons
cvsdist 2872495
cvsdist 2872495
%description contrib
cvsdist 2872495
Contributed/3rd party tools which may be of use with quagga.
cvsdist 2872495
cvsdist 2872495
%package devel
cvsdist 2872495
Summary: Header and object files for quagga development
cvsdist 2872495
Group: System Environment/Daemons
cvsdist 2872495
cvsdist 2872495
%description devel
cvsdist 2872495
The quagga-devel package contains the header and object files neccessary for
cvsdist 2872495
developing OSPF-API and quagga applications.
cvsdist 2872495
cvsdist 2872495
%prep
cvsdist 2872495
%setup  -q
cvsdist 51567ae
%patch0 -p1 -b .lib64
cvsdist 51567ae
%patch1 -p1 -b .netlink
cvsdist 2872495
cvsdist 2872495
%build
cvsdist 2872495
CFLAGS=-fPIE ; LDFLAGS=-pie ; %configure \
cvsdist 2872495
%if %with_ipv6
cvsdist 2872495
	--enable-ipv6 \
cvsdist 2872495
%endif
cvsdist 2872495
%if %with_snmp
cvsdist 2872495
	--enable-snmp \
cvsdist 2872495
%endif
cvsdist 2872495
%if %with_multipath
cvsdist 2872495
	--enable-multipath=%with_multipath \
cvsdist 2872495
%endif
cvsdist 2872495
%if %with_tcp_zebra
cvsdist 2872495
	--enable-tcp-zebra \
cvsdist 2872495
%endif
cvsdist 2872495
%if %with_nssa
cvsdist 2872495
	--enable-nssa \
cvsdist 2872495
%endif
cvsdist 2872495
%if %with_opaque_lsa
cvsdist 2872495
	--enable-opaque-lsa \
cvsdist 2872495
%endif
cvsdist 2872495
%if %with_ospf_te
cvsdist 2872495
	--enable-ospf-te \
cvsdist 2872495
%endif
cvsdist 2872495
%if %with_vtysh
cvsdist 2872495
	--enable-vtysh \
cvsdist 2872495
%endif
cvsdist 2872495
%if %with_ospfclient 
cvsdist 2872495
	--enable-ospfclient=yes \
cvsdist 2872495
%else
cvsdist 2872495
	--enable-ospfclient=no\
cvsdist 2872495
%endif
cvsdist 2872495
%if %with_ospfapi
cvsdist 2872495
	--enable-ospfapi=yes \
cvsdist 2872495
%else
cvsdist 2872495
	--enable-ospfapi=no \
cvsdist 2872495
%endif
cvsdist 2872495
%if %with_pam
cvsdist 2872495
	--with-libpam \
cvsdist 2872495
%endif
cvsdist 2872495
%if %quagga_user
cvsdist 2872495
	--enable-user=%quagga_user \
cvsdist 2872495
	--enable-group=%quagga_user \
cvsdist 2872495
%endif
cvsdist 2872495
%if %vty_group
cvsdist 2872495
	--enable-vty-group=%vty_group \
cvsdist 2872495
%endif
cvsdist 51567ae
%if %with_rtadv
cvsdist 51567ae
	--with-rtadv \
cvsdist 51567ae
%endif
cvsdist 2872495
--with-cflags="-O2" \
cvsdist 2872495
--enable-netlink
cvsdist 2872495
cvsdist 2872495
CFLAGS=-fPIE ; LDFLAGS=-pie ; make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
cvsdist 2872495
cvsdist 2872495
pushd doc
cvsdist 2872495
texi2html quagga.texi
cvsdist 2872495
popd
cvsdist 2872495
cvsdist 2872495
%install
cvsdist 2872495
rm -rf $RPM_BUILD_ROOT
cvsdist 2872495
cvsdist 2872495
install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
cvsdist 2872495
	$RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
cvsdist 2872495
cvsdist 2872495
make install \
cvsdist 2872495
	DESTDIR=$RPM_BUILD_ROOT
cvsdist 2872495
cvsdist 2872495
# Remove this file, as it is uninstalled and causes errors when building on RH9
cvsdist 2872495
rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
cvsdist 2872495
cvsdist 2872495
install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
cvsdist 2872495
install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
cvsdist 2872495
%if %with_ipv6
cvsdist 2872495
install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
cvsdist 2872495
install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
cvsdist 2872495
%endif
cvsdist 2872495
install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
cvsdist 2872495
install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
cvsdist 2872495
install -m644 %{zeb_rh_src}/quagga.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/quagga
cvsdist 2872495
install -m644 %{zeb_rh_src}/quagga.pam $RPM_BUILD_ROOT/etc/pam.d/quagga
cvsdist 2872495
install -m644 %{zeb_rh_src}/quagga.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/quagga
cvsdist 2872495
install -d -m750  $RPM_BUILD_ROOT/var/run/quagga
cvsdist 2872495
cvsdist 2872495
%pre
cvsdist 2872495
# add vty_group
cvsdist 2872495
%if %vty_group
cvsdist 2872495
groupadd -r %vty_group 2> /dev/null || :
cvsdist 2872495
%endif
cvsdist 2872495
# add quagga user and group
cvsdist 2872495
%if %quagga_user
cvsdist 2872495
# Ensure that quagga_gid gets correctly allocated
cvsdist 51567ae
if getent group %quagga_user >/dev/null 2>&1 ; then : ; else \
cvsdist 51567ae
 /usr/sbin/groupadd -g %quagga_gid %quagga_user > /dev/null 2>&1 || exit 1 ; fi
cvsdist 51567ae
if getent passwd %quagga_user >/dev/null 2>&1 ; then : ; else \
cvsdist 51567ae
 /usr/sbin/useradd -u %quagga_uid -g %quagga_gid -M -r -s /sbin/nologin \
cvsdist 51567ae
 -c "Quagga routing suite" -d %_localstatedir %quagga_user 2> /dev/null \
cvsdist 51567ae
 || exit 1 ; fi
cvsdist 2872495
%endif
cvsdist 2872495
cvsdist 2872495
%post
cvsdist 2872495
# /etc/services is already populated, so skip this
cvsdist 2872495
cvsdist 2872495
# zebra_spec_add_service <service name> <port/proto> <comment>
cvsdist 2872495
# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
cvsdist 2872495
#
cvsdist 2872495
#zebra_spec_add_service ()
cvsdist 2872495
#{
cvsdist 2872495
#  # Add port /etc/services entry if it isn't already there 
cvsdist 2872495
#  if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
cvsdist 2872495
#    echo "$1		$2			# $3"  >> /etc/services
cvsdist 2872495
#  fi
cvsdist 2872495
#}
cvsdist 2872495
#
cvsdist 2872495
#zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
cvsdist 2872495
#zebra_spec_add_service zebra    2601/tcp "zebra vty"
cvsdist 2872495
#zebra_spec_add_service ripd     2602/tcp "RIPd vty"
cvsdist 2872495
#%if %with_ipv6
cvsdist 2872495
#zebra_spec_add_service ripngd   2603/tcp "RIPngd vty"
cvsdist 2872495
#%endif
cvsdist 2872495
#zebra_spec_add_service ospfd    2604/tcp "OSPFd vty"
cvsdist 2872495
#zebra_spec_add_service bgpd     2605/tcp "BGPd vty"
cvsdist 2872495
#%if %with_ipv6
cvsdist 2872495
#zebra_spec_add_service ospf6d   2606/tcp "OSPF6d vty"
cvsdist 2872495
#%endif
cvsdist 2872495
#%if %with_ospfapi
cvsdist 2872495
#zebra_spec_add_service ospfapi  2607/tcp "OSPF-API"
cvsdist 2872495
#%endif
cvsdist 2872495
cvsdist 2872495
/sbin/chkconfig --add zebra 
cvsdist 2872495
/sbin/chkconfig --add ripd
cvsdist 2872495
%if %with_ipv6
cvsdist 2872495
/sbin/chkconfig --add ripngd
cvsdist 2872495
/sbin/chkconfig --add ospf6d
cvsdist 2872495
%endif
cvsdist 2872495
/sbin/chkconfig --add ospfd
cvsdist 2872495
/sbin/chkconfig --add bgpd
cvsdist 2872495
cvsdist 2872495
/sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
cvsdist 2872495
cvsdist 2872495
# Create dummy files if they don't exist so basic functions can be used.
cvsdist 2872495
if [ ! -e %{_sysconfdir}/zebra.conf ]; then
cvsdist 2872495
	echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
cvsdist d3aa9a9
%if %quagga_user
cvsdist d3aa9a9
	chown %quagga_user:%quagga_user %{_sysconfdir}/zebra.conf
cvsdist d3aa9a9
%endif
cvsdist 2872495
	chmod 640 %{_sysconfdir}/zebra.conf
cvsdist 2872495
fi
cvsdist 2872495
if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
cvsdist 2872495
	touch %{_sysconfdir}/vtysh.conf
cvsdist 2872495
	chmod 640 %{_sysconfdir}/vtysh.conf
cvsdist 2872495
fi
cvsdist 2872495
cvsdist 2872495
%postun
cvsdist 2872495
if [ "$1" -ge  "1" ]; then
cvsdist 2872495
	/etc/rc.d/init.d/zebra  condrestart >/dev/null 2>&1
cvsdist 2872495
	/etc/rc.d/init.d/ripd   condrestart >/dev/null 2>&1
cvsdist 2872495
%if %with_ipv6
cvsdist 2872495
	/etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
cvsdist 2872495
%endif
cvsdist 2872495
	/etc/rc.d/init.d/ospfd  condrestart >/dev/null 2>&1
cvsdist 2872495
%if %with_ipv6
cvsdist 2872495
	/etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
cvsdist 2872495
%endif
cvsdist 2872495
	/etc/rc.d/init.d/bgpd   condrestart >/dev/null 2>&1
cvsdist 2872495
fi
cvsdist d3aa9a9
/sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
cvsdist 2872495
cvsdist 2872495
%preun
cvsdist 2872495
if [ "$1" = "0" ]; then
cvsdist 2872495
        /sbin/chkconfig --del zebra
cvsdist 2872495
	/sbin/chkconfig --del ripd
cvsdist 2872495
%if %with_ipv6
cvsdist 2872495
	/sbin/chkconfig --del ripngd
cvsdist 2872495
%endif
cvsdist 2872495
	/sbin/chkconfig --del ospfd
cvsdist 2872495
%if %with_ipv6
cvsdist 2872495
	/sbin/chkconfig --del ospf6d
cvsdist 2872495
%endif
cvsdist 2872495
	/sbin/chkconfig --del bgpd
cvsdist 2872495
fi
cvsdist 2872495
cvsdist 2872495
%clean
cvsdist 2872495
#rm -rf $RPM_BUILD_ROOT
cvsdist 2872495
cvsdist 2872495
%files
cvsdist 2872495
%defattr(-,root,root)
cvsdist 2872495
%doc */*.sample* AUTHORS COPYING
cvsdist 2872495
%doc doc/quagga.html
cvsdist 2872495
%doc doc/mpls
cvsdist 2872495
%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
cvsdist 2872495
%if %quagga_user
cvsdist 2872495
%dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
cvsdist 2872495
%dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga 
cvsdist 2872495
%dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga
cvsdist 2872495
%else
cvsdist 2872495
%dir %attr(750,root,root) %{_sysconfdir}
cvsdist 2872495
%dir %attr(750,root,root) /var/log/quagga
cvsdist 2872495
%dir %attr(755,root,root) /usr/share/info
cvsdist 2872495
%dir %attr(750,root,root) /var/run/quagga
cvsdist 2872495
%endif
cvsdist 2872495
%if %vty_group
cvsdist 2872495
%attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
cvsdist 2872495
%endif
cvsdist 2872495
%{_infodir}/*info*
cvsdist 2872495
%{_mandir}/man*/*
cvsdist 2872495
%{_sbindir}/*
cvsdist 2872495
%if %with_vtysh
cvsdist 2872495
%{_bindir}/*
cvsdist 2872495
%endif
cvsdist 2872495
%config /etc/quagga/[!v]*
cvsdist 2872495
%config /etc/rc.d/init.d/*
cvsdist 2872495
%config(noreplace) /etc/pam.d/quagga
cvsdist 2872495
%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
cvsdist d3aa9a9
%config(noreplace) /etc/sysconfig/quagga                  
cvsdist d3aa9a9
cvsdist 2872495
cvsdist 2872495
%files contrib
cvsdist 2872495
%defattr(-,root,root)
cvsdist 2872495
%doc tools
cvsdist 2872495
cvsdist 2872495
%files devel
cvsdist 2872495
%defattr(-,root,root)
cvsdist 2872495
%dir %{_libdir}/*
cvsdist 51567ae
%dir %{_includedir}/quagga
cvsdist 51567ae
%{_includedir}/quagga/*.h
cvsdist 51567ae
%dir %{_includedir}/quagga/ospfd/*
cvsdist 2872495
%if %with_ospfapi
cvsdist 51567ae
%dir %{_includedir}/quagga/ospfapi/*
cvsdist 2872495
%endif
cvsdist 2872495
cvsdist 2872495
%changelog
cvsdist 51567ae
* Tue May 4 2004 Jay Fenlason <fenlason@redhat.com> 0.96.5-0
cvsdist 51567ae
- New upstream version
cvsdist 51567ae
- Change includedir
cvsdist 51567ae
- Change the pre scriptlet to fail if the useradd command fails.
cvsdist 51567ae
- Remove obsolete patches from this .spec file and renumber the two
cvsdist 51567ae
  remaining ones.
cvsdist 51567ae
cvsdist 0cc33d3
* Tue Mar 02 2004 Elliot Lee <sopwith@redhat.com>
cvsdist 0cc33d3
- rebuilt
cvsdist 0cc33d3
cvsdist 51567ae
* Fri Feb 13 2004 Jay Fenlason <fenlason@redhat.com>
cvsdist 51567ae
- Add --enable-rtadv, to turn ipv6 router advertisement back on.  Closes
cvsdist 51567ae
  bugzilla #114691
cvsdist 51567ae
cvsdist 0cc33d3
* Fri Feb 13 2004 Elliot Lee <sopwith@redhat.com>
cvsdist 0cc33d3
- rebuilt
cvsdist 0cc33d3
cvsdist 749b7ff
* Mon Nov 3 2003 Jay Fenlason <fenlason@redhat.com> 0.96.4-0
cvsdist 749b7ff
- New upstream version
cvsdist 749b7ff
- include .h files in the -devel package.
cvsdist 749b7ff
cvsdist d3aa9a9
* Wed Oct 15 2003 Jay Fenlason <fenlason@redhat.com> 0.96.3-1
cvsdist d3aa9a9
- Patch a remote DoS attack (#107140)
cvsdist d3aa9a9
- New upstream version
cvsdist d3aa9a9
- Removed the .libcap patch, which was applied upstream
cvsdist d3aa9a9
- Renamed the vty group from quaggavty to quaggavt because quaggavty is
cvsdist d3aa9a9
  too long for NIS.
cvsdist d3aa9a9
- Patch the spec file to fix #106857: /etc/quagga/zebra.conf is created with
cvsdist d3aa9a9
  the wrong owner.
cvsdist d3aa9a9
- Removed the "med" part of the 0.96.1-warnings patch for . . .
cvsdist d3aa9a9
- Add a new warnings patch with a fix for #106315.  This also updates
cvsdist d3aa9a9
  the "med" part of the previous warnings patch.
cvsdist d3aa9a9
cvsdist d3aa9a9
* Mon Sep 22 2003 Jay Fenlason <fenlason@redhat.com> 0.96.2-5
cvsdist d3aa9a9
- merge sysconfig patch from 3E branch.  This patch is from Kaj J. Niemi
cvsdist d3aa9a9
  (kajtzu@basen.net), and puts Quagga configuration options in
cvsdist d3aa9a9
  /etc/sysconfig/quagga, and defaults Quagga to listening on 127.0.0.1 only.
cvsdist d3aa9a9
  This closes #104376
cvsdist d3aa9a9
- Use /sbin/nologin for the shell of the quagga user.  This closes #103320
cvsdist d3aa9a9
- Update the quagga-0.96.1-warnings.patch patch to kill a couple more
cvsdist d3aa9a9
  warnings.
cvsdist d3aa9a9
cvsdist d3aa9a9
* Mon Sep 22 2003 Nalin Dahyabhai <nalin@redhat.com>
cvsdist 2872495
- Remove the directory part of paths for PAM modules in quagga.pam, allowing
cvsdist 2872495
  libpam to search its default directory (needed if a 64-bit libpam needs to
cvsdist d3aa9a9
  look in /lib64/security instead of /lib/security).
cvsdist 2872495
cvsdist d3aa9a9
* Tue Aug 26 2003 Jay Fenlason <fenlason@redhat.com> 0.96.2-1
cvsdist d3aa9a9
- New upstream version
cvsdist 2872495
cvsdist d3aa9a9
* Tue Aug 19 2003 Jay Fenlason <fenlason@redhat.com> 0.96.1-3
cvsdist d3aa9a9
- Merge from quagga-3E-branch, with a fix for #102673 and a couple
cvsdist d3aa9a9
  more compiler warnings quashed.
cvsdist 2872495
cvsdist d3aa9a9
* Wed Aug 13 2003 Jay Fenlason <fenlason@redhat.com> 0.96-1
cvsdist 2872495
- added a patch (libwrap) to allow the generated Makefiles for zebra/
cvsdist 2872495
  and lib/ to work on AMD64 systems.  For some reason make there does
cvsdist 2872495
  not like a dependency on -lcap
cvsdist 2872495
- added a patch (warnings) to shut up warnings about an undefined
cvsdist 2872495
  structure type in some function prototypes and quiet down all the
cvsdist 2872495
  warnings about assert(ptr) on x86_64.
cvsdist 2872495
- Modified the upstream quagga-0.96/readhat/quagga.spec to work as an
cvsdist 2872495
  official Red Hat package (remove user and group creation and changes
cvsdist 2872495
  to services)
cvsdist 2872495
- Trimmed changelog.  See the upstream .spec file for previous
cvsdist 2872495
  changelog entries.