blob: 4e697893100f1479afbba6a3984f5cc831d1dd9d [file] [log] [blame]
pauledd7c242003-06-04 13:59:38 +00001# configure options
paul68980082003-03-25 05:07:42 +00002%define with_snmp 0
paul788cdc62003-01-18 00:22:08 +00003%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
paul55ea3812003-04-07 08:14:11 +000011%define with_ospfclient 1
12%define with_ospfapi 1
paul8f754982003-01-20 04:55:51 +000013%define with_multipath 64
pauledd7c242003-06-04 13:59:38 +000014%define zebra_user zebra
15%define vty_group zebravty
paul30b9d892003-01-18 22:57:15 +000016
17# path defines
paul788cdc62003-01-18 00:22:08 +000018%define _sysconfdir /etc/zebra
paul8f754982003-01-20 04:55:51 +000019%define zeb_src %{_builddir}/%{name}-%{version}
20%define zeb_rh_src %{zeb_src}/redhat
21%define zeb_docs %{zeb_src}/doc
paul788cdc62003-01-18 00:22:08 +000022
paule0626852003-03-18 14:11:36 +000023# defines for configure
24%define _libexecdir %{_exec_prefix}/libexec/zebra
25%define _includedir %{_prefix}/include/zebra
26%define _libdir %{_exec_prefix}/%{_lib}/zebra
pauledd7c242003-06-04 13:59:38 +000027%define _localstatedir /var/run/zebra
paule0626852003-03-18 14:11:36 +000028
paul788cdc62003-01-18 00:22:08 +000029Summary: Routing daemon
30Name: zebra
paul6382b6f2003-05-20 00:17:45 +000031Version: @VERSION@
pauledd7c242003-06-04 13:59:38 +000032Release: @CONFDATE@01
paul788cdc62003-01-18 00:22:08 +000033License: GPL
34Group: System Environment/Daemons
35Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
paul788cdc62003-01-18 00:22:08 +000036URL: http://www.zebra.org/
37%if %with_snmp
paule0626852003-03-18 14:11:36 +000038#BuildRequires: ucd-snmp-devel
paul788cdc62003-01-18 00:22:08 +000039Prereq: ucd-snmp
40%endif
pauld7ccae22003-01-18 00:24:00 +000041%if %with_vtysh
paul30b9d892003-01-18 22:57:15 +000042BuildRequires: readline readline-devel ncurses ncurses-devel
pauld7ccae22003-01-18 00:24:00 +000043Prereq: readline ncurses
44%endif
45BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch
paul788cdc62003-01-18 00:22:08 +000046# Initscripts > 5.60 is required for IPv6 support
paul30b9d892003-01-18 22:57:15 +000047Prereq: initscripts >= 5.60
48Prereq: openssl ncurses readline pam
paul788cdc62003-01-18 00:22:08 +000049Prereq: /sbin/install-info
50Provides: routingdaemon
51BuildRoot: %{_tmppath}/%{name}-%{version}-root
52Obsoletes: bird gated mrt
53
54%description
55GNU Zebra is a free software that manages TCP/IP based routing
56protocol. It takes multi-server and multi-thread approach to resolve
57the current complexity of the Internet.
58
59GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
60
61GNU Zebra is intended to be used as a Route Server and a Route
62Reflector. It is not a toolkit, it provides full routing power under
63a new architecture. GNU Zebra is unique in design in that it has a
64process for each protocol.
65
paul448ed4a2003-03-01 15:43:28 +000066%package contrib
67Summary: contrib tools for zebra
68Group: System Environment/Daemons
69
70%description contrib
71Contributed/3rd party tools which may be of use with zebra.
72
paule0626852003-03-18 14:11:36 +000073%package devel
74Summary: Header and object files for zebra development
75Group: System Environment/Daemons
76
77%description devel
78The zebra-devel package contains the header and object files neccessary for
79developing OSPF-API and zebra applications.
80
paul788cdc62003-01-18 00:22:08 +000081%prep
82%setup -q
paul788cdc62003-01-18 00:22:08 +000083
84%build
85%configure \
paul788cdc62003-01-18 00:22:08 +000086%if %with_ipv6
87 --enable-ipv6 \
88%endif
89%if %with_snmp
90 --enable-snmp \
91%endif
92%if %with_multipath
93 --enable-multipath=%with_multipath \
94%endif
95%if %with_tcp_zebra
96 --enable-tcp-zebra \
97%endif
98%if %with_nssa
99 --enable-nssa \
100%endif
101%if %with_opaque_lsa
102 --enable-opaque-lsa \
103%endif
104%if %with_ospf_te
105 --enable-ospf-te \
106%endif
107%if %with_vtysh
108 --enable-vtysh \
109%endif
paul68980082003-03-25 05:07:42 +0000110%if %with_ospfclient
111 --enable-ospfclient=yes \
112%else
113 --enable-ospfclient=no\
114%endif
115%if %with_ospfapi
116 --enable-ospfapi=yes \
117%else
118 --enable-ospfapi=no \
119%endif
paul788cdc62003-01-18 00:22:08 +0000120%if %with_pam
pauledd7c242003-06-04 13:59:38 +0000121 --with-libpam \
paul788cdc62003-01-18 00:22:08 +0000122%endif
pauledd7c242003-06-04 13:59:38 +0000123%if %zebra_user
124 --enable-user=%zebra_user \
125 --enable-group=%zebra_user \
126%endif
127%if %vty_group
128 --enable-vty-group=%vty_group \
129%endif
130--with-cflags="-O2" \
131--enable-netlink
paul788cdc62003-01-18 00:22:08 +0000132
133make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
134
135pushd doc
136texi2html zebra.texi
137popd
138
139%install
140rm -rf $RPM_BUILD_ROOT
141
142install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
143 $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
144
145make install \
146 DESTDIR=$RPM_BUILD_ROOT
147
paul8f754982003-01-20 04:55:51 +0000148install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
149install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
pauld7ccae22003-01-18 00:24:00 +0000150%if %with_ipv6
paul8f754982003-01-20 04:55:51 +0000151install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
152install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
pauld7ccae22003-01-18 00:24:00 +0000153%endif
paul8f754982003-01-20 04:55:51 +0000154install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
155install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
156install -m644 %{zeb_rh_src}/zebra.pam $RPM_BUILD_ROOT/etc/pam.d/zebra
157install -m644 %{zeb_rh_src}/zebra.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/zebra
pauledd7c242003-06-04 13:59:38 +0000158install -d -m750 $RPM_BUILD_ROOT/var/run/zebra
159
160%pre
161# add vty_group
162%if %vty_group
163groupadd -r %vty_group 2> /dev/null || :
164%endif
165# add zebra user and group
166%if %zebra_user
167/usr/sbin/useradd -M -r -s /bin/false -c "Zebra routing suite" \
168 -d %_localstatedir %zebra_user 2> /dev/null || :
169%endif
paul788cdc62003-01-18 00:22:08 +0000170
paul788cdc62003-01-18 00:22:08 +0000171%post
paul30b9d892003-01-18 22:57:15 +0000172# zebra_spec_add_service <service name> <port/proto> <comment>
paul788cdc62003-01-18 00:22:08 +0000173# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
174
175zebra_spec_add_service ()
176{
177 # Add port /etc/services entry if it isn't already there
178 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
179 echo "$1 $2 # $3" >> /etc/services
180 fi
181}
182
183zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
184zebra_spec_add_service zebra 2601/tcp "zebra vty"
185zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000186%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000187zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000188%endif
paul788cdc62003-01-18 00:22:08 +0000189zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
190zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000191%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000192zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000193%endif
paul7021c422003-07-15 12:52:22 +0000194%if %with_ospfapi
195zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
196%endif
paul788cdc62003-01-18 00:22:08 +0000197
198/sbin/chkconfig --add zebra
199/sbin/chkconfig --add ripd
pauld7ccae22003-01-18 00:24:00 +0000200%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000201/sbin/chkconfig --add ripngd
paul788cdc62003-01-18 00:22:08 +0000202/sbin/chkconfig --add ospf6d
pauld7ccae22003-01-18 00:24:00 +0000203%endif
paul30b9d892003-01-18 22:57:15 +0000204/sbin/chkconfig --add ospfd
paul788cdc62003-01-18 00:22:08 +0000205/sbin/chkconfig --add bgpd
206
207/sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
208
209# Create dummy files if they don't exist so basic functions can be used.
210if [ ! -e %{_sysconfdir}/zebra.conf ]; then
211 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
212 chmod 640 %{_sysconfdir}/zebra.conf
213fi
214if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
215 touch %{_sysconfdir}/vtysh.conf
216 chmod 640 %{_sysconfdir}/vtysh.conf
217fi
218
219%postun
220if [ "$1" -ge "1" ]; then
221 /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
222 /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000223%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000224 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000225%endif
paul788cdc62003-01-18 00:22:08 +0000226 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000227%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000228 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000229%endif
paul788cdc62003-01-18 00:22:08 +0000230 /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
231fi
232/sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
233
234%preun
235if [ "$1" = "0" ]; then
236 /sbin/chkconfig --del zebra
237 /sbin/chkconfig --del ripd
pauld7ccae22003-01-18 00:24:00 +0000238%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000239 /sbin/chkconfig --del ripngd
pauld7ccae22003-01-18 00:24:00 +0000240%endif
paul788cdc62003-01-18 00:22:08 +0000241 /sbin/chkconfig --del ospfd
pauld7ccae22003-01-18 00:24:00 +0000242%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000243 /sbin/chkconfig --del ospf6d
pauld7ccae22003-01-18 00:24:00 +0000244%endif
paul788cdc62003-01-18 00:22:08 +0000245 /sbin/chkconfig --del bgpd
246fi
247
248%clean
249#rm -rf $RPM_BUILD_ROOT
250
251%files
252%defattr(-,root,root)
paul448ed4a2003-03-01 15:43:28 +0000253%doc */*.sample* AUTHORS COPYING
paul8f754982003-01-20 04:55:51 +0000254%doc doc/zebra.html
paul30b9d892003-01-18 22:57:15 +0000255%doc doc/mpls
paul8f754982003-01-20 04:55:51 +0000256%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
pauledd7c242003-06-04 13:59:38 +0000257%if %zebra_user
258%dir %attr(751,%zebra_user,%zebra_user) %{_sysconfdir}
259%dir %attr(750,%zebra_user,%zebra_user) /var/log/zebra
260%dir %attr(751,%zebra_user,%zebra_user) /var/run/zebra
261%else
paul788cdc62003-01-18 00:22:08 +0000262%dir %attr(750,root,root) %{_sysconfdir}
263%dir %attr(750,root,root) /var/log/zebra
264%dir %attr(755,root,root) /usr/share/info
pauledd7c242003-06-04 13:59:38 +0000265%dir %attr(750,root,root) /var/run/zebra
266%endif
267%if %vty_group
268%attr(750,%zebra_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
269%endif
paul788cdc62003-01-18 00:22:08 +0000270%{_infodir}/*info*
271%{_mandir}/man*/*
272%{_sbindir}/*
pauld7ccae22003-01-18 00:24:00 +0000273%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000274%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000275%endif
paul788cdc62003-01-18 00:22:08 +0000276%config /etc/zebra/*
277%config /etc/rc.d/init.d/*
278%config(noreplace) /etc/pam.d/zebra
279%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
280
paul448ed4a2003-03-01 15:43:28 +0000281%files contrib
282%defattr(-,root,root)
283%doc tools
284
paule0626852003-03-18 14:11:36 +0000285%files devel
286%defattr(-,root,root)
287%dir %{_libdir}/*
paul68980082003-03-25 05:07:42 +0000288%dir %{_includedir}/ospfd/*
289%if %with_ospfapi
paule0626852003-03-18 14:11:36 +0000290%dir %{_includedir}/ospfapi/*
paul68980082003-03-25 05:07:42 +0000291%endif
paule0626852003-03-18 14:11:36 +0000292
paul788cdc62003-01-18 00:22:08 +0000293%changelog
pauledd7c242003-06-04 13:59:38 +0000294* Tue Mar 20 2003 Paul Jakma <paul@dishone.st>
295- zebra privileges support
296
paule0626852003-03-18 14:11:36 +0000297* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
298- Fix mem leak in 'show thread cpu'
299- Ralph Keller's OSPF-API
300- Amir: Fix configure.ac for net-snmp
301
paul448ed4a2003-03-01 15:43:28 +0000302* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
303- ospfd IOS prefix to interface matching for 'network' statement
304- temporary fix for PtP and IPv6
305- sync to zebra.org CVS
306
paul8f754982003-01-20 04:55:51 +0000307* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
308- update to latest cvs
309- Yon's "show thread cpu" patch - 17217
310- walk up tree - 17218
311- ospfd NSSA fixes - 16681
312- ospfd nsm fixes - 16824
313- ospfd OLSA fixes and new feature - 16823
314- KAME and ifindex fixes - 16525
315- spec file changes to allow redhat files to be in tree
316
pauld7ccae22003-01-18 00:24:00 +0000317* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
318- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
319- Fixed up some build requirements (patch)
320- Added conditional build requirements for vtysh / snmp
321- Added conditional to %files for %_bindir depending on vtysh
322
paul788cdc62003-01-18 00:22:08 +0000323* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
324- update to latest CVS
325- add Greg Troxel's md5 buffer copy/dup fix
326- add RIPv1 fix
327- add Frank's multicast flag fix
328
329* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
330- update to latest CVS
331- timestamped crypt_seqnum patch
332- oi->on_write_q fix
333
334* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
335- update to latest CVS
336- add vtysh 'write-config (integrated|daemon)' patch
337- always 'make rebuild' in vtysh/ to catch new commands
338
339* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
340- update to 0.93b
341
342* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
343- update to latest CVS
344- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
345
346* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
347- update to current CVS
348- add OSPF point to multipoint patch
349- add OSPF bugfixes
350- add BGP hash optimisation patch
351
352* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
353- update to 0.93-pre1 / CVS
354- add link state detection support
355- add generic PtP and RFC3021 support
356- various bug fixes
357
358* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
359- Fix bug #51336
360
361* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
362- Use generic initscript strings instead of initscript specific
363 ( "Starting foo: " -> "Starting $prog:" )
364
365* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
366- Bump the release when rebuilding into the dist.
367
368* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
369- built for Powertools
370
371* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
372- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
373- Update to 0.91a
374- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
375- Should be quite Red Hat'isque now.