# configure options %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_ospfclient 1 %define with_ospfapi 1 %define with_multipath 64 %define quagga_uid 92 %define quagga_gid 92 %define quagga_user quagga %define vty_group quaggavt # path defines %define _sysconfdir /etc/quagga %define zeb_src %{_builddir}/%{name}-%{version} %define zeb_rh_src %{zeb_src}/redhat %define zeb_docs %{zeb_src}/doc # defines for configure %define _libexecdir %{_exec_prefix}/libexec/quagga %define _includedir %{_prefix}/include/quagga %define _libdir %{_exec_prefix}/%{_lib}/quagga %define _localstatedir /var/run/quagga Summary: Routing daemon Name: quagga Version: 0.96.4 Release: 0 License: GPL Group: System Environment/Daemons Source0: http://www.quagga.net/download/%{name}-%{version}.tar.gz Source1: quagga-filter-perl-requires.sh #Patch0: quagga-0.96.1-libcap.patch Patch1: quagga-0.96.1-warnings.patch Patch2: quagga-0.96.2-sysconfig.patch Patch3: quagga-0.96.2-lib64.patch #Patch4: quagga-0.96.3-warnings.patch #Patch5: quagga-0.96.3-remote_dos.patch Patch6: quagga-0.96.3-netlink.patch URL: http://www.quagga.net %if %with_snmp BuildRequires: ucd-snmp-devel Prereq: ucd-snmp %endif %if %with_vtysh BuildRequires: readline readline-devel ncurses ncurses-devel Prereq: readline ncurses %endif BuildRequires: texinfo tetex autoconf pam-devel patch libcap-devel %define __perl_requires %{SOURCE1} # Initscripts > 5.60 is required for IPv6 support Prereq: initscripts >= 5.60 Prereq: ncurses readline pam Prereq: /sbin/install-info Provides: routingdaemon BuildRoot: %{_tmppath}/%{name}-%{version}-root Obsoletes: bird gated mrt zebra %description Quagga 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. Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng. Quagga 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. Quagga by design has a process for each protocol. Quagga is a fork of GNU Zebra. %package contrib Summary: contrib tools for quagga Group: System Environment/Daemons %description contrib Contributed/3rd party tools which may be of use with quagga. %package devel Summary: Header and object files for quagga development Group: System Environment/Daemons %description devel The quagga-devel package contains the header and object files neccessary for developing OSPF-API and quagga applications. %prep %setup -q #%patch0 -p1 -b .libcap %patch1 -p1 -b .warnings %patch2 -p1 -b .sysconfig %patch3 -p1 -b .lib64 #%patch4 -p1 -b .warnings4 #%patch5 -p1 -b .remote_dos %patch6 -p1 -b .netlink %build CFLAGS=-fPIE ; LDFLAGS=-pie ; %configure \ %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_ospfclient --enable-ospfclient=yes \ %else --enable-ospfclient=no\ %endif %if %with_ospfapi --enable-ospfapi=yes \ %else --enable-ospfapi=no \ %endif %if %with_pam --with-libpam \ %endif %if %quagga_user --enable-user=%quagga_user \ --enable-group=%quagga_user \ %endif %if %vty_group --enable-vty-group=%vty_group \ %endif --with-cflags="-O2" \ --enable-netlink CFLAGS=-fPIE ; LDFLAGS=-pie ; make %{?_smp_mflags} MAKEINFO="makeinfo --no-split" pushd doc texi2html quagga.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/quagga $RPM_BUILD_ROOT%{_infodir} make install \ DESTDIR=$RPM_BUILD_ROOT # Remove this file, as it is uninstalled and causes errors when building on RH9 rm -rf $RPM_BUILD_ROOT/usr/share/info/dir install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd %if %with_ipv6 install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd %endif install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd install -m644 %{zeb_rh_src}/quagga.sysconfig $RPM_BUILD_ROOT/etc/sysconfig/quagga install -m644 %{zeb_rh_src}/quagga.pam $RPM_BUILD_ROOT/etc/pam.d/quagga install -m644 %{zeb_rh_src}/quagga.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/quagga install -d -m750 $RPM_BUILD_ROOT/var/run/quagga %pre # add vty_group %if %vty_group groupadd -r %vty_group 2> /dev/null || : %endif # add quagga user and group %if %quagga_user # Ensure that quagga_gid gets correctly allocated /usr/sbin/groupadd -g %quagga_gid quagga 2> /dev/null || : /usr/sbin/useradd -u %quagga_uid -g %quagga_gid -M -r -s /sbin/nologin \ -c "Quagga routing suite" -d %_localstatedir %quagga_user 2> /dev/null || : %endif %post # /etc/services is already populated, so skip this # 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" #%if %with_ipv6 #zebra_spec_add_service ripngd 2603/tcp "RIPngd vty" #%endif #zebra_spec_add_service ospfd 2604/tcp "OSPFd vty" #zebra_spec_add_service bgpd 2605/tcp "BGPd vty" #%if %with_ipv6 #zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty" #%endif #%if %with_ospfapi #zebra_spec_add_service ospfapi 2607/tcp "OSPF-API" #%endif /sbin/chkconfig --add zebra /sbin/chkconfig --add ripd %if %with_ipv6 /sbin/chkconfig --add ripngd /sbin/chkconfig --add ospf6d %endif /sbin/chkconfig --add ospfd /sbin/chkconfig --add bgpd /sbin/install-info %{_infodir}/quagga.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 %if %quagga_user chown %quagga_user:%quagga_user %{_sysconfdir}/zebra.conf %endif 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 %if %with_ipv6 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1 %endif /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1 %if %with_ipv6 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1 %endif /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1 fi /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir %preun if [ "$1" = "0" ]; then /sbin/chkconfig --del zebra /sbin/chkconfig --del ripd %if %with_ipv6 /sbin/chkconfig --del ripngd %endif /sbin/chkconfig --del ospfd %if %with_ipv6 /sbin/chkconfig --del ospf6d %endif /sbin/chkconfig --del bgpd fi %clean #rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc */*.sample* AUTHORS COPYING %doc doc/quagga.html %doc doc/mpls %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO %if %quagga_user %dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir} %dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga %dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga %else %dir %attr(750,root,root) %{_sysconfdir} %dir %attr(750,root,root) /var/log/quagga %dir %attr(755,root,root) /usr/share/info %dir %attr(750,root,root) /var/run/quagga %endif %if %vty_group %attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample %endif %{_infodir}/*info* %{_mandir}/man*/* %{_sbindir}/* %if %with_vtysh %{_bindir}/* %endif %config /etc/quagga/[!v]* %config /etc/rc.d/init.d/* %config(noreplace) /etc/pam.d/quagga %config(noreplace) %attr(640,root,root) /etc/logrotate.d/* %config(noreplace) /etc/sysconfig/quagga %files contrib %defattr(-,root,root) %doc tools %files devel %defattr(-,root,root) %dir %{_libdir}/* %dir %{_includedir} %{_includedir}/*.h %dir %{_includedir}/ospfd/* %if %with_ospfapi %dir %{_includedir}/ospfapi/* %endif %changelog * Mon Nov 3 2003 Jay Fenlason 0.96.4-0 - New upstream version - include .h files in the -devel package. * Wed Oct 15 2003 Jay Fenlason 0.96.3-1 - Patch a remote DoS attack (#107140) - New upstream version - Removed the .libcap patch, which was applied upstream - Renamed the vty group from quaggavty to quaggavt because quaggavty is too long for NIS. - Patch the spec file to fix #106857: /etc/quagga/zebra.conf is created with the wrong owner. - Removed the "med" part of the 0.96.1-warnings patch for . . . - Add a new warnings patch with a fix for #106315. This also updates the "med" part of the previous warnings patch. * Mon Sep 22 2003 Jay Fenlason 0.96.2-5 - merge sysconfig patch from 3E branch. This patch is from Kaj J. Niemi (kajtzu@basen.net), and puts Quagga configuration options in /etc/sysconfig/quagga, and defaults Quagga to listening on 127.0.0.1 only. This closes #104376 - Use /sbin/nologin for the shell of the quagga user. This closes #103320 - Update the quagga-0.96.1-warnings.patch patch to kill a couple more warnings. * Mon Sep 22 2003 Nalin Dahyabhai - Remove the directory part of paths for PAM modules in quagga.pam, allowing libpam to search its default directory (needed if a 64-bit libpam needs to look in /lib64/security instead of /lib/security). * Tue Aug 26 2003 Jay Fenlason 0.96.2-1 - New upstream version * Tue Aug 19 2003 Jay Fenlason 0.96.1-3 - Merge from quagga-3E-branch, with a fix for #102673 and a couple more compiler warnings quashed. * Wed Aug 13 2003 Jay Fenlason 0.96-1 - added a patch (libwrap) to allow the generated Makefiles for zebra/ and lib/ to work on AMD64 systems. For some reason make there does not like a dependency on -lcap - added a patch (warnings) to shut up warnings about an undefined structure type in some function prototypes and quiet down all the warnings about assert(ptr) on x86_64. - Modified the upstream quagga-0.96/readhat/quagga.spec to work as an official Red Hat package (remove user and group creation and changes to services) - Trimmed changelog. See the upstream .spec file for previous changelog entries.