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