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