paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 1 | %define with_snmp 0 |
| 2 | %define with_vtysh 1 |
| 3 | %define with_ospf_te 1 |
| 4 | %define with_nssa 1 |
| 5 | %define with_opaque_lsa 1 |
| 6 | %define with_tcp_zebra 0 |
| 7 | %define with_vtysh 1 |
| 8 | %define with_pam 1 |
| 9 | %define with_ipv6 1 |
| 10 | %define with_multipath 32 |
| 11 | %define _sysconfdir /etc/zebra |
| 12 | |
| 13 | Summary: Routing daemon |
| 14 | Name: zebra |
| 15 | Version: 0.93b |
| 16 | Release: 2002111101 |
| 17 | License: GPL |
| 18 | Group: System Environment/Daemons |
| 19 | Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz |
| 20 | Source1: zebra.init |
| 21 | Source2: bgpd.init |
| 22 | Source3: ospf6d.init |
| 23 | Source4: ospfd.init |
| 24 | Source5: ripd.init |
| 25 | Source6: ripngd.init |
| 26 | Source8: zebra.pam |
| 27 | Source9: zebra.logrotate |
| 28 | Source10: zebra.mpls-docs.tar.gz |
| 29 | Patch0: zebra-bgpd-hash.patch |
| 30 | Patch1: zebra-ptp.patch |
| 31 | Patch2: zebra-linkstate.patch |
| 32 | Patch3: zebra-ospfd-ptmp.patch |
| 33 | Patch4: zebra-ospfd-misc.patch |
| 34 | Patch5: zebra-ospfd-olsa.patch |
| 35 | Patch7: zebra-vtysh-write-config.patch |
| 36 | Patch8: zebra-ospfd-md5auth-seqnum.patch |
| 37 | Patch9: zebra-ospfd-oi_write_q.patch |
| 38 | Patch10: zebra-ripv1-netmask.patch |
| 39 | Patch11: zebra-ospfd-md5-buffer-fix.patch |
| 40 | Patch12: zebra-multi.patch |
| 41 | URL: http://www.zebra.org/ |
| 42 | %if %with_snmp |
| 43 | BuildRequires: ucd-snmp-devel |
| 44 | Prereq: ucd-snmp |
| 45 | %endif |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 46 | %if %with_vtysh |
| 47 | BuildRequires: readline readline-devel ncurses ncuses-devel |
| 48 | Prereq: readline ncurses |
| 49 | %endif |
| 50 | BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 51 | # Initscripts > 5.60 is required for IPv6 support |
| 52 | Prereq: openssl ncurses readline initscripts pam |
| 53 | Prereq: /sbin/install-info |
| 54 | Provides: routingdaemon |
| 55 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
| 56 | Obsoletes: bird gated mrt |
| 57 | |
| 58 | %description |
| 59 | GNU Zebra is a free software that manages TCP/IP based routing |
| 60 | protocol. It takes multi-server and multi-thread approach to resolve |
| 61 | the current complexity of the Internet. |
| 62 | |
| 63 | GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng. |
| 64 | |
| 65 | GNU Zebra is intended to be used as a Route Server and a Route |
| 66 | Reflector. It is not a toolkit, it provides full routing power under |
| 67 | a new architecture. GNU Zebra is unique in design in that it has a |
| 68 | process for each protocol. |
| 69 | |
| 70 | %prep |
| 71 | %setup -q |
| 72 | %patch0 -p1 -b .bgphash |
| 73 | %patch1 -p0 -b .ptp |
| 74 | %patch2 -p1 -b .linkstate |
| 75 | %patch3 -p1 -b .ospf-ptmp |
| 76 | %patch4 -p1 -b .ospf-misc |
| 77 | %patch5 -p1 -b .ospf-olsa |
| 78 | %patch7 -p1 -b .vtysh-write |
| 79 | %patch8 -p2 -b .ospf-md5auth-seqnum |
| 80 | %patch9 -p0 -b .ospfd-oi_write_q |
| 81 | %patch10 -p0 -b .ripd-netmask |
| 82 | %patch11 -p0 -b .ospfd-md5-buffer |
| 83 | %patch12 -p0 -b .zebra-multi |
| 84 | %{__tar} -zxf %{SOURCE10} |
| 85 | |
| 86 | %build |
| 87 | %configure \ |
| 88 | --with-cflags="-O2" \ |
| 89 | --enable-netlink \ |
| 90 | %if %with_ipv6 |
| 91 | --enable-ipv6 \ |
| 92 | %endif |
| 93 | %if %with_snmp |
| 94 | --enable-snmp \ |
| 95 | %endif |
| 96 | %if %with_multipath |
| 97 | --enable-multipath=%with_multipath \ |
| 98 | %endif |
| 99 | %if %with_tcp_zebra |
| 100 | --enable-tcp-zebra \ |
| 101 | %endif |
| 102 | %if %with_nssa |
| 103 | --enable-nssa \ |
| 104 | %endif |
| 105 | %if %with_opaque_lsa |
| 106 | --enable-opaque-lsa \ |
| 107 | %endif |
| 108 | %if %with_ospf_te |
| 109 | --enable-ospf-te \ |
| 110 | %endif |
| 111 | %if %with_vtysh |
| 112 | --enable-vtysh \ |
| 113 | %endif |
| 114 | %if %with_pam |
| 115 | --with-libpam |
| 116 | %endif |
| 117 | |
| 118 | pushd vtysh |
| 119 | make %{?_smp_mflags} rebuild |
| 120 | popd |
| 121 | |
| 122 | make %{?_smp_mflags} MAKEINFO="makeinfo --no-split" |
| 123 | |
| 124 | pushd doc |
| 125 | texi2html zebra.texi |
| 126 | popd |
| 127 | |
| 128 | %install |
| 129 | rm -rf $RPM_BUILD_ROOT |
| 130 | |
| 131 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \ |
| 132 | $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir} |
| 133 | |
| 134 | make install \ |
| 135 | DESTDIR=$RPM_BUILD_ROOT |
| 136 | |
| 137 | install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra |
| 138 | install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 139 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 140 | install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 141 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 142 | install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd |
| 143 | install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 144 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 145 | install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 146 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 147 | install -m644 %{SOURCE8} $RPM_BUILD_ROOT/etc/pam.d/zebra |
| 148 | install -m644 %{SOURCE9} $RPM_BUILD_ROOT/etc/logrotate.d/zebra |
| 149 | |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 150 | %post |
| 151 | # zebra_spec_add_service <sercice name> <port/proto> <comment> |
| 152 | # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service" |
| 153 | |
| 154 | zebra_spec_add_service () |
| 155 | { |
| 156 | # Add port /etc/services entry if it isn't already there |
| 157 | if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then |
| 158 | echo "$1 $2 # $3" >> /etc/services |
| 159 | fi |
| 160 | } |
| 161 | |
| 162 | zebra_spec_add_service zebrasrv 2600/tcp "zebra service" |
| 163 | zebra_spec_add_service zebra 2601/tcp "zebra vty" |
| 164 | zebra_spec_add_service ripd 2602/tcp "RIPd vty" |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 165 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 166 | zebra_spec_add_service ripngd 2603/tcp "RIPngd vty" |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 167 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 168 | zebra_spec_add_service ospfd 2604/tcp "OSPFd vty" |
| 169 | zebra_spec_add_service bgpd 2605/tcp "BGPd vty" |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 170 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 171 | zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty" |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 172 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 173 | |
| 174 | /sbin/chkconfig --add zebra |
| 175 | /sbin/chkconfig --add ripd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 176 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 177 | /sbin/chkconfig --add ripngd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 178 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 179 | /sbin/chkconfig --add ospfd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 180 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 181 | /sbin/chkconfig --add ospf6d |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 182 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 183 | /sbin/chkconfig --add bgpd |
| 184 | |
| 185 | /sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir |
| 186 | |
| 187 | # Create dummy files if they don't exist so basic functions can be used. |
| 188 | if [ ! -e %{_sysconfdir}/zebra.conf ]; then |
| 189 | echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf |
| 190 | chmod 640 %{_sysconfdir}/zebra.conf |
| 191 | fi |
| 192 | if [ ! -e %{_sysconfdir}/vtysh.conf ]; then |
| 193 | touch %{_sysconfdir}/vtysh.conf |
| 194 | chmod 640 %{_sysconfdir}/vtysh.conf |
| 195 | fi |
| 196 | |
| 197 | %postun |
| 198 | if [ "$1" -ge "1" ]; then |
| 199 | /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1 |
| 200 | /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1 |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 201 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 202 | /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1 |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 203 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 204 | /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1 |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 205 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 206 | /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1 |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 207 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 208 | /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1 |
| 209 | fi |
| 210 | /sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir |
| 211 | |
| 212 | %preun |
| 213 | if [ "$1" = "0" ]; then |
| 214 | /sbin/chkconfig --del zebra |
| 215 | /sbin/chkconfig --del ripd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 216 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 217 | /sbin/chkconfig --del ripngd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 218 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 219 | /sbin/chkconfig --del ospfd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 220 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 221 | /sbin/chkconfig --del ospf6d |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 222 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 223 | /sbin/chkconfig --del bgpd |
| 224 | fi |
| 225 | |
| 226 | %clean |
| 227 | #rm -rf $RPM_BUILD_ROOT |
| 228 | |
| 229 | %files |
| 230 | %defattr(-,root,root) |
| 231 | %doc */*.sample* doc/zebra.html tools AUTHORS COPYING |
| 232 | %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO |
| 233 | %dir %attr(750,root,root) %{_sysconfdir} |
| 234 | %dir %attr(750,root,root) /var/log/zebra |
| 235 | %dir %attr(755,root,root) /usr/share/info |
| 236 | %{_infodir}/*info* |
| 237 | %{_mandir}/man*/* |
| 238 | %{_sbindir}/* |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 239 | %if %with_vtysh |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 240 | %{_bindir}/* |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 241 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 242 | %config /etc/zebra/* |
| 243 | %config /etc/rc.d/init.d/* |
| 244 | %config(noreplace) /etc/pam.d/zebra |
| 245 | %config(noreplace) %attr(640,root,root) /etc/logrotate.d/* |
| 246 | |
| 247 | %changelog |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 248 | * Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com> |
| 249 | - Added conditionals for building with(out) IPv6, vtysh, RIP, BGP |
| 250 | - Fixed up some build requirements (patch) |
| 251 | - Added conditional build requirements for vtysh / snmp |
| 252 | - Added conditional to %files for %_bindir depending on vtysh |
| 253 | |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 254 | * Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie> |
| 255 | - update to latest CVS |
| 256 | - add Greg Troxel's md5 buffer copy/dup fix |
| 257 | - add RIPv1 fix |
| 258 | - add Frank's multicast flag fix |
| 259 | |
| 260 | * Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie> |
| 261 | - update to latest CVS |
| 262 | - timestamped crypt_seqnum patch |
| 263 | - oi->on_write_q fix |
| 264 | |
| 265 | * Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie> |
| 266 | - update to latest CVS |
| 267 | - add vtysh 'write-config (integrated|daemon)' patch |
| 268 | - always 'make rebuild' in vtysh/ to catch new commands |
| 269 | |
| 270 | * Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie> |
| 271 | - update to 0.93b |
| 272 | |
| 273 | * Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie> |
| 274 | - update to latest CVS |
| 275 | - add "/sbin/ip route flush proto zebra" to zebra RH init on startup |
| 276 | |
| 277 | * Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie> |
| 278 | - update to current CVS |
| 279 | - add OSPF point to multipoint patch |
| 280 | - add OSPF bugfixes |
| 281 | - add BGP hash optimisation patch |
| 282 | |
| 283 | * Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie> |
| 284 | - update to 0.93-pre1 / CVS |
| 285 | - add link state detection support |
| 286 | - add generic PtP and RFC3021 support |
| 287 | - various bug fixes |
| 288 | |
| 289 | * Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6 |
| 290 | - Fix bug #51336 |
| 291 | |
| 292 | * Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5 |
| 293 | - Use generic initscript strings instead of initscript specific |
| 294 | ( "Starting foo: " -> "Starting $prog:" ) |
| 295 | |
| 296 | * Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4 |
| 297 | - Bump the release when rebuilding into the dist. |
| 298 | |
| 299 | * Tue Feb 6 2001 Tim Powers <timp@redhat.com> |
| 300 | - built for Powertools |
| 301 | |
| 302 | * Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi> |
| 303 | - Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org. |
| 304 | - Update to 0.91a |
| 305 | - Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc. |
| 306 | - Should be quite Red Hat'isque now. |