blob: ce3a6fb43ad30b40f99e6cc9d622c41e133735c1 [file] [log] [blame]
paul8f754982003-01-20 04:55:51 +00001# conditionals
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
paul30b9d892003-01-18 22:57:15 +000014
15# path defines
paul788cdc62003-01-18 00:22:08 +000016%define _sysconfdir /etc/zebra
paul8f754982003-01-20 04:55:51 +000017%define zeb_src %{_builddir}/%{name}-%{version}
18%define zeb_rh_src %{zeb_src}/redhat
19%define zeb_docs %{zeb_src}/doc
paul788cdc62003-01-18 00:22:08 +000020
paule0626852003-03-18 14:11:36 +000021# defines for configure
22%define _libexecdir %{_exec_prefix}/libexec/zebra
23%define _includedir %{_prefix}/include/zebra
24%define _libdir %{_exec_prefix}/%{_lib}/zebra
paul55ea3812003-04-07 08:14:11 +000025%define _localstatedir %{_prefix}/var/run
paule0626852003-03-18 14:11:36 +000026
paul788cdc62003-01-18 00:22:08 +000027Summary: Routing daemon
28Name: zebra
paul6382b6f2003-05-20 00:17:45 +000029Version: @VERSION@
30Release: @CONFDATE@
paul788cdc62003-01-18 00:22:08 +000031License: GPL
32Group: System Environment/Daemons
33Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
paul788cdc62003-01-18 00:22:08 +000034URL: http://www.zebra.org/
35%if %with_snmp
paule0626852003-03-18 14:11:36 +000036#BuildRequires: ucd-snmp-devel
paul788cdc62003-01-18 00:22:08 +000037Prereq: ucd-snmp
38%endif
pauld7ccae22003-01-18 00:24:00 +000039%if %with_vtysh
paul30b9d892003-01-18 22:57:15 +000040BuildRequires: readline readline-devel ncurses ncurses-devel
pauld7ccae22003-01-18 00:24:00 +000041Prereq: readline ncurses
42%endif
43BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch
paul788cdc62003-01-18 00:22:08 +000044# Initscripts > 5.60 is required for IPv6 support
paul30b9d892003-01-18 22:57:15 +000045Prereq: initscripts >= 5.60
46Prereq: openssl ncurses readline pam
paul788cdc62003-01-18 00:22:08 +000047Prereq: /sbin/install-info
48Provides: routingdaemon
49BuildRoot: %{_tmppath}/%{name}-%{version}-root
50Obsoletes: bird gated mrt
51
52%description
53GNU Zebra is a free software that manages TCP/IP based routing
54protocol. It takes multi-server and multi-thread approach to resolve
55the current complexity of the Internet.
56
57GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
58
59GNU Zebra is intended to be used as a Route Server and a Route
60Reflector. It is not a toolkit, it provides full routing power under
61a new architecture. GNU Zebra is unique in design in that it has a
62process for each protocol.
63
paul448ed4a2003-03-01 15:43:28 +000064%package contrib
65Summary: contrib tools for zebra
66Group: System Environment/Daemons
67
68%description contrib
69Contributed/3rd party tools which may be of use with zebra.
70
paule0626852003-03-18 14:11:36 +000071%package devel
72Summary: Header and object files for zebra development
73Group: System Environment/Daemons
74
75%description devel
76The zebra-devel package contains the header and object files neccessary for
77developing OSPF-API and zebra applications.
78
paul788cdc62003-01-18 00:22:08 +000079%prep
80%setup -q
paul788cdc62003-01-18 00:22:08 +000081
82%build
paule0626852003-03-18 14:11:36 +000083./update-autotools
paul788cdc62003-01-18 00:22:08 +000084%configure \
85 --with-cflags="-O2" \
86 --enable-netlink \
87%if %with_ipv6
88 --enable-ipv6 \
89%endif
90%if %with_snmp
91 --enable-snmp \
92%endif
93%if %with_multipath
94 --enable-multipath=%with_multipath \
95%endif
96%if %with_tcp_zebra
97 --enable-tcp-zebra \
98%endif
99%if %with_nssa
100 --enable-nssa \
101%endif
102%if %with_opaque_lsa
103 --enable-opaque-lsa \
104%endif
105%if %with_ospf_te
106 --enable-ospf-te \
107%endif
108%if %with_vtysh
109 --enable-vtysh \
110%endif
paul68980082003-03-25 05:07:42 +0000111%if %with_ospfclient
112 --enable-ospfclient=yes \
113%else
114 --enable-ospfclient=no\
115%endif
116%if %with_ospfapi
117 --enable-ospfapi=yes \
118%else
119 --enable-ospfapi=no \
120%endif
paul788cdc62003-01-18 00:22:08 +0000121%if %with_pam
122 --with-libpam
123%endif
124
125pushd vtysh
126make %{?_smp_mflags} rebuild
127popd
128
129make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
130
131pushd doc
132texi2html zebra.texi
133popd
134
135%install
136rm -rf $RPM_BUILD_ROOT
137
138install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
139 $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
140
141make install \
142 DESTDIR=$RPM_BUILD_ROOT
143
paul8f754982003-01-20 04:55:51 +0000144install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
145install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
pauld7ccae22003-01-18 00:24:00 +0000146%if %with_ipv6
paul8f754982003-01-20 04:55:51 +0000147install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
148install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
pauld7ccae22003-01-18 00:24:00 +0000149%endif
paul8f754982003-01-20 04:55:51 +0000150install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
151install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
152install -m644 %{zeb_rh_src}/zebra.pam $RPM_BUILD_ROOT/etc/pam.d/zebra
153install -m644 %{zeb_rh_src}/zebra.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/zebra
paul788cdc62003-01-18 00:22:08 +0000154
paul788cdc62003-01-18 00:22:08 +0000155%post
paul30b9d892003-01-18 22:57:15 +0000156# zebra_spec_add_service <service name> <port/proto> <comment>
paul788cdc62003-01-18 00:22:08 +0000157# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
158
159zebra_spec_add_service ()
160{
161 # Add port /etc/services entry if it isn't already there
162 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
163 echo "$1 $2 # $3" >> /etc/services
164 fi
165}
166
167zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
168zebra_spec_add_service zebra 2601/tcp "zebra vty"
169zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000170%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000171zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000172%endif
paul788cdc62003-01-18 00:22:08 +0000173zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
174zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000175%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000176zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000177%endif
paul788cdc62003-01-18 00:22:08 +0000178
179/sbin/chkconfig --add zebra
180/sbin/chkconfig --add ripd
pauld7ccae22003-01-18 00:24:00 +0000181%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000182/sbin/chkconfig --add ripngd
paul788cdc62003-01-18 00:22:08 +0000183/sbin/chkconfig --add ospf6d
pauld7ccae22003-01-18 00:24:00 +0000184%endif
paul30b9d892003-01-18 22:57:15 +0000185/sbin/chkconfig --add ospfd
paul788cdc62003-01-18 00:22:08 +0000186/sbin/chkconfig --add bgpd
187
188/sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
189
190# Create dummy files if they don't exist so basic functions can be used.
191if [ ! -e %{_sysconfdir}/zebra.conf ]; then
192 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
193 chmod 640 %{_sysconfdir}/zebra.conf
194fi
195if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
196 touch %{_sysconfdir}/vtysh.conf
197 chmod 640 %{_sysconfdir}/vtysh.conf
198fi
199
200%postun
201if [ "$1" -ge "1" ]; then
202 /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
203 /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000204%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000205 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000206%endif
paul788cdc62003-01-18 00:22:08 +0000207 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000208%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000209 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000210%endif
paul788cdc62003-01-18 00:22:08 +0000211 /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
212fi
213/sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
214
215%preun
216if [ "$1" = "0" ]; then
217 /sbin/chkconfig --del zebra
218 /sbin/chkconfig --del ripd
pauld7ccae22003-01-18 00:24:00 +0000219%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000220 /sbin/chkconfig --del ripngd
pauld7ccae22003-01-18 00:24:00 +0000221%endif
paul788cdc62003-01-18 00:22:08 +0000222 /sbin/chkconfig --del ospfd
pauld7ccae22003-01-18 00:24:00 +0000223%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000224 /sbin/chkconfig --del ospf6d
pauld7ccae22003-01-18 00:24:00 +0000225%endif
paul788cdc62003-01-18 00:22:08 +0000226 /sbin/chkconfig --del bgpd
227fi
228
229%clean
230#rm -rf $RPM_BUILD_ROOT
231
232%files
233%defattr(-,root,root)
paul448ed4a2003-03-01 15:43:28 +0000234%doc */*.sample* AUTHORS COPYING
paul8f754982003-01-20 04:55:51 +0000235%doc doc/zebra.html
paul30b9d892003-01-18 22:57:15 +0000236%doc doc/mpls
paul8f754982003-01-20 04:55:51 +0000237%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
paul788cdc62003-01-18 00:22:08 +0000238%dir %attr(750,root,root) %{_sysconfdir}
239%dir %attr(750,root,root) /var/log/zebra
240%dir %attr(755,root,root) /usr/share/info
241%{_infodir}/*info*
242%{_mandir}/man*/*
243%{_sbindir}/*
pauld7ccae22003-01-18 00:24:00 +0000244%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000245%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000246%endif
paul788cdc62003-01-18 00:22:08 +0000247%config /etc/zebra/*
248%config /etc/rc.d/init.d/*
249%config(noreplace) /etc/pam.d/zebra
250%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
251
paul448ed4a2003-03-01 15:43:28 +0000252%files contrib
253%defattr(-,root,root)
254%doc tools
255
paule0626852003-03-18 14:11:36 +0000256%files devel
257%defattr(-,root,root)
258%dir %{_libdir}/*
paul68980082003-03-25 05:07:42 +0000259%dir %{_includedir}/ospfd/*
260%if %with_ospfapi
paule0626852003-03-18 14:11:36 +0000261%dir %{_includedir}/ospfapi/*
paul68980082003-03-25 05:07:42 +0000262%endif
paule0626852003-03-18 14:11:36 +0000263
paul788cdc62003-01-18 00:22:08 +0000264%changelog
paule0626852003-03-18 14:11:36 +0000265* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
266- Fix mem leak in 'show thread cpu'
267- Ralph Keller's OSPF-API
268- Amir: Fix configure.ac for net-snmp
269
paul448ed4a2003-03-01 15:43:28 +0000270* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
271- ospfd IOS prefix to interface matching for 'network' statement
272- temporary fix for PtP and IPv6
273- sync to zebra.org CVS
274
paul8f754982003-01-20 04:55:51 +0000275* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
276- update to latest cvs
277- Yon's "show thread cpu" patch - 17217
278- walk up tree - 17218
279- ospfd NSSA fixes - 16681
280- ospfd nsm fixes - 16824
281- ospfd OLSA fixes and new feature - 16823
282- KAME and ifindex fixes - 16525
283- spec file changes to allow redhat files to be in tree
284
pauld7ccae22003-01-18 00:24:00 +0000285* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
286- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
287- Fixed up some build requirements (patch)
288- Added conditional build requirements for vtysh / snmp
289- Added conditional to %files for %_bindir depending on vtysh
290
paul788cdc62003-01-18 00:22:08 +0000291* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
292- update to latest CVS
293- add Greg Troxel's md5 buffer copy/dup fix
294- add RIPv1 fix
295- add Frank's multicast flag fix
296
297* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
298- update to latest CVS
299- timestamped crypt_seqnum patch
300- oi->on_write_q fix
301
302* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
303- update to latest CVS
304- add vtysh 'write-config (integrated|daemon)' patch
305- always 'make rebuild' in vtysh/ to catch new commands
306
307* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
308- update to 0.93b
309
310* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
311- update to latest CVS
312- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
313
314* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
315- update to current CVS
316- add OSPF point to multipoint patch
317- add OSPF bugfixes
318- add BGP hash optimisation patch
319
320* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
321- update to 0.93-pre1 / CVS
322- add link state detection support
323- add generic PtP and RFC3021 support
324- various bug fixes
325
326* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
327- Fix bug #51336
328
329* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
330- Use generic initscript strings instead of initscript specific
331 ( "Starting foo: " -> "Starting $prog:" )
332
333* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
334- Bump the release when rebuilding into the dist.
335
336* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
337- built for Powertools
338
339* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
340- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
341- Update to 0.91a
342- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
343- Should be quite Red Hat'isque now.