paul | 8f75498 | 2003-01-20 04:55:51 +0000 | [diff] [blame] | 1 | # conditionals |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 2 | %define with_snmp 0 |
| 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 |
| 22 | Release: 2003021301 |
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 | |
| 56 | %prep |
| 57 | %setup -q |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 58 | |
| 59 | %build |
| 60 | %configure \ |
| 61 | --with-cflags="-O2" \ |
| 62 | --enable-netlink \ |
| 63 | %if %with_ipv6 |
| 64 | --enable-ipv6 \ |
| 65 | %endif |
| 66 | %if %with_snmp |
| 67 | --enable-snmp \ |
| 68 | %endif |
| 69 | %if %with_multipath |
| 70 | --enable-multipath=%with_multipath \ |
| 71 | %endif |
| 72 | %if %with_tcp_zebra |
| 73 | --enable-tcp-zebra \ |
| 74 | %endif |
| 75 | %if %with_nssa |
| 76 | --enable-nssa \ |
| 77 | %endif |
| 78 | %if %with_opaque_lsa |
| 79 | --enable-opaque-lsa \ |
| 80 | %endif |
| 81 | %if %with_ospf_te |
| 82 | --enable-ospf-te \ |
| 83 | %endif |
| 84 | %if %with_vtysh |
| 85 | --enable-vtysh \ |
| 86 | %endif |
| 87 | %if %with_pam |
| 88 | --with-libpam |
| 89 | %endif |
| 90 | |
| 91 | pushd vtysh |
| 92 | make %{?_smp_mflags} rebuild |
| 93 | popd |
| 94 | |
| 95 | make %{?_smp_mflags} MAKEINFO="makeinfo --no-split" |
| 96 | |
| 97 | pushd doc |
| 98 | texi2html zebra.texi |
| 99 | popd |
| 100 | |
| 101 | %install |
| 102 | rm -rf $RPM_BUILD_ROOT |
| 103 | |
| 104 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \ |
| 105 | $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir} |
| 106 | |
| 107 | make install \ |
| 108 | DESTDIR=$RPM_BUILD_ROOT |
| 109 | |
paul | 8f75498 | 2003-01-20 04:55:51 +0000 | [diff] [blame] | 110 | install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra |
| 111 | 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] | 112 | %if %with_ipv6 |
paul | 8f75498 | 2003-01-20 04:55:51 +0000 | [diff] [blame] | 113 | install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d |
| 114 | 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] | 115 | %endif |
paul | 8f75498 | 2003-01-20 04:55:51 +0000 | [diff] [blame] | 116 | install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd |
| 117 | install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd |
| 118 | install -m644 %{zeb_rh_src}/zebra.pam $RPM_BUILD_ROOT/etc/pam.d/zebra |
| 119 | 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] | 120 | |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 121 | %post |
paul | 30b9d89 | 2003-01-18 22:57:15 +0000 | [diff] [blame] | 122 | # zebra_spec_add_service <service name> <port/proto> <comment> |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 123 | # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service" |
| 124 | |
| 125 | zebra_spec_add_service () |
| 126 | { |
| 127 | # Add port /etc/services entry if it isn't already there |
| 128 | if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then |
| 129 | echo "$1 $2 # $3" >> /etc/services |
| 130 | fi |
| 131 | } |
| 132 | |
| 133 | zebra_spec_add_service zebrasrv 2600/tcp "zebra service" |
| 134 | zebra_spec_add_service zebra 2601/tcp "zebra vty" |
| 135 | zebra_spec_add_service ripd 2602/tcp "RIPd vty" |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 136 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 137 | zebra_spec_add_service ripngd 2603/tcp "RIPngd vty" |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 138 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 139 | zebra_spec_add_service ospfd 2604/tcp "OSPFd vty" |
| 140 | zebra_spec_add_service bgpd 2605/tcp "BGPd vty" |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 141 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 142 | zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty" |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 143 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 144 | |
| 145 | /sbin/chkconfig --add zebra |
| 146 | /sbin/chkconfig --add ripd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 147 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 148 | /sbin/chkconfig --add ripngd |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 149 | /sbin/chkconfig --add ospf6d |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 150 | %endif |
paul | 30b9d89 | 2003-01-18 22:57:15 +0000 | [diff] [blame] | 151 | /sbin/chkconfig --add ospfd |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 152 | /sbin/chkconfig --add bgpd |
| 153 | |
| 154 | /sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir |
| 155 | |
| 156 | # Create dummy files if they don't exist so basic functions can be used. |
| 157 | if [ ! -e %{_sysconfdir}/zebra.conf ]; then |
| 158 | echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf |
| 159 | chmod 640 %{_sysconfdir}/zebra.conf |
| 160 | fi |
| 161 | if [ ! -e %{_sysconfdir}/vtysh.conf ]; then |
| 162 | touch %{_sysconfdir}/vtysh.conf |
| 163 | chmod 640 %{_sysconfdir}/vtysh.conf |
| 164 | fi |
| 165 | |
| 166 | %postun |
| 167 | if [ "$1" -ge "1" ]; then |
| 168 | /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1 |
| 169 | /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1 |
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 | /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1 |
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 | /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1 |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 174 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 175 | /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1 |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 176 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 177 | /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1 |
| 178 | fi |
| 179 | /sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir |
| 180 | |
| 181 | %preun |
| 182 | if [ "$1" = "0" ]; then |
| 183 | /sbin/chkconfig --del zebra |
| 184 | /sbin/chkconfig --del ripd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 185 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 186 | /sbin/chkconfig --del ripngd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 187 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 188 | /sbin/chkconfig --del ospfd |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 189 | %if %with_ipv6 |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 190 | /sbin/chkconfig --del ospf6d |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 191 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 192 | /sbin/chkconfig --del bgpd |
| 193 | fi |
| 194 | |
| 195 | %clean |
| 196 | #rm -rf $RPM_BUILD_ROOT |
| 197 | |
| 198 | %files |
| 199 | %defattr(-,root,root) |
paul | 8f75498 | 2003-01-20 04:55:51 +0000 | [diff] [blame] | 200 | %doc */*.sample* tools AUTHORS COPYING |
| 201 | %doc doc/zebra.html |
paul | 30b9d89 | 2003-01-18 22:57:15 +0000 | [diff] [blame] | 202 | %doc doc/mpls |
paul | 8f75498 | 2003-01-20 04:55:51 +0000 | [diff] [blame] | 203 | %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 204 | %dir %attr(750,root,root) %{_sysconfdir} |
| 205 | %dir %attr(750,root,root) /var/log/zebra |
| 206 | %dir %attr(755,root,root) /usr/share/info |
| 207 | %{_infodir}/*info* |
| 208 | %{_mandir}/man*/* |
| 209 | %{_sbindir}/* |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 210 | %if %with_vtysh |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 211 | %{_bindir}/* |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 212 | %endif |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 213 | %config /etc/zebra/* |
| 214 | %config /etc/rc.d/init.d/* |
| 215 | %config(noreplace) /etc/pam.d/zebra |
| 216 | %config(noreplace) %attr(640,root,root) /etc/logrotate.d/* |
| 217 | |
| 218 | %changelog |
paul | 8f75498 | 2003-01-20 04:55:51 +0000 | [diff] [blame] | 219 | * Mon Jan 20 2003 Paul Jakma <paul@dishone.st> |
| 220 | - update to latest cvs |
| 221 | - Yon's "show thread cpu" patch - 17217 |
| 222 | - walk up tree - 17218 |
| 223 | - ospfd NSSA fixes - 16681 |
| 224 | - ospfd nsm fixes - 16824 |
| 225 | - ospfd OLSA fixes and new feature - 16823 |
| 226 | - KAME and ifindex fixes - 16525 |
| 227 | - spec file changes to allow redhat files to be in tree |
| 228 | |
paul | d7ccae2 | 2003-01-18 00:24:00 +0000 | [diff] [blame] | 229 | * Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com> |
| 230 | - Added conditionals for building with(out) IPv6, vtysh, RIP, BGP |
| 231 | - Fixed up some build requirements (patch) |
| 232 | - Added conditional build requirements for vtysh / snmp |
| 233 | - Added conditional to %files for %_bindir depending on vtysh |
| 234 | |
paul | 788cdc6 | 2003-01-18 00:22:08 +0000 | [diff] [blame] | 235 | * Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie> |
| 236 | - update to latest CVS |
| 237 | - add Greg Troxel's md5 buffer copy/dup fix |
| 238 | - add RIPv1 fix |
| 239 | - add Frank's multicast flag fix |
| 240 | |
| 241 | * Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie> |
| 242 | - update to latest CVS |
| 243 | - timestamped crypt_seqnum patch |
| 244 | - oi->on_write_q fix |
| 245 | |
| 246 | * Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie> |
| 247 | - update to latest CVS |
| 248 | - add vtysh 'write-config (integrated|daemon)' patch |
| 249 | - always 'make rebuild' in vtysh/ to catch new commands |
| 250 | |
| 251 | * Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie> |
| 252 | - update to 0.93b |
| 253 | |
| 254 | * Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie> |
| 255 | - update to latest CVS |
| 256 | - add "/sbin/ip route flush proto zebra" to zebra RH init on startup |
| 257 | |
| 258 | * Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie> |
| 259 | - update to current CVS |
| 260 | - add OSPF point to multipoint patch |
| 261 | - add OSPF bugfixes |
| 262 | - add BGP hash optimisation patch |
| 263 | |
| 264 | * Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie> |
| 265 | - update to 0.93-pre1 / CVS |
| 266 | - add link state detection support |
| 267 | - add generic PtP and RFC3021 support |
| 268 | - various bug fixes |
| 269 | |
| 270 | * Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6 |
| 271 | - Fix bug #51336 |
| 272 | |
| 273 | * Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5 |
| 274 | - Use generic initscript strings instead of initscript specific |
| 275 | ( "Starting foo: " -> "Starting $prog:" ) |
| 276 | |
| 277 | * Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4 |
| 278 | - Bump the release when rebuilding into the dist. |
| 279 | |
| 280 | * Tue Feb 6 2001 Tim Powers <timp@redhat.com> |
| 281 | - built for Powertools |
| 282 | |
| 283 | * Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi> |
| 284 | - Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org. |
| 285 | - Update to 0.91a |
| 286 | - Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc. |
| 287 | - Should be quite Red Hat'isque now. |