blob: db42c682f92827e20634d45b29a47c265a828de4 [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
paul68980082003-03-25 05:07:42 +000011%define with_ospfclient 0
12%define with_ospfapi 0
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
25
paul788cdc62003-01-18 00:22:08 +000026Summary: Routing daemon
27Name: zebra
paul78edbf82003-02-13 20:18:50 +000028Version: 0.94
paul68980082003-03-25 05:07:42 +000029Release: 2003032501
paul788cdc62003-01-18 00:22:08 +000030License: GPL
31Group: System Environment/Daemons
32Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
paul788cdc62003-01-18 00:22:08 +000033URL: http://www.zebra.org/
34%if %with_snmp
paule0626852003-03-18 14:11:36 +000035#BuildRequires: ucd-snmp-devel
paul788cdc62003-01-18 00:22:08 +000036Prereq: ucd-snmp
37%endif
pauld7ccae22003-01-18 00:24:00 +000038%if %with_vtysh
paul30b9d892003-01-18 22:57:15 +000039BuildRequires: readline readline-devel ncurses ncurses-devel
pauld7ccae22003-01-18 00:24:00 +000040Prereq: readline ncurses
41%endif
42BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch
paul788cdc62003-01-18 00:22:08 +000043# Initscripts > 5.60 is required for IPv6 support
paul30b9d892003-01-18 22:57:15 +000044Prereq: initscripts >= 5.60
45Prereq: openssl ncurses readline pam
paul788cdc62003-01-18 00:22:08 +000046Prereq: /sbin/install-info
47Provides: routingdaemon
48BuildRoot: %{_tmppath}/%{name}-%{version}-root
49Obsoletes: bird gated mrt
50
51%description
52GNU Zebra is a free software that manages TCP/IP based routing
53protocol. It takes multi-server and multi-thread approach to resolve
54the current complexity of the Internet.
55
56GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
57
58GNU Zebra is intended to be used as a Route Server and a Route
59Reflector. It is not a toolkit, it provides full routing power under
60a new architecture. GNU Zebra is unique in design in that it has a
61process for each protocol.
62
paul448ed4a2003-03-01 15:43:28 +000063%package contrib
64Summary: contrib tools for zebra
65Group: System Environment/Daemons
66
67%description contrib
68Contributed/3rd party tools which may be of use with zebra.
69
paule0626852003-03-18 14:11:36 +000070%package devel
71Summary: Header and object files for zebra development
72Group: System Environment/Daemons
73
74%description devel
75The zebra-devel package contains the header and object files neccessary for
76developing OSPF-API and zebra applications.
77
paul788cdc62003-01-18 00:22:08 +000078%prep
79%setup -q
paul788cdc62003-01-18 00:22:08 +000080
81%build
paule0626852003-03-18 14:11:36 +000082./update-autotools
paul788cdc62003-01-18 00:22:08 +000083%configure \
84 --with-cflags="-O2" \
85 --enable-netlink \
86%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
121 --with-libpam
122%endif
123
124pushd vtysh
125make %{?_smp_mflags} rebuild
126popd
127
128make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
129
130pushd doc
131texi2html zebra.texi
132popd
133
134%install
135rm -rf $RPM_BUILD_ROOT
136
137install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
138 $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
139
140make install \
141 DESTDIR=$RPM_BUILD_ROOT
142
paul8f754982003-01-20 04:55:51 +0000143install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
144install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
pauld7ccae22003-01-18 00:24:00 +0000145%if %with_ipv6
paul8f754982003-01-20 04:55:51 +0000146install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
147install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
pauld7ccae22003-01-18 00:24:00 +0000148%endif
paul8f754982003-01-20 04:55:51 +0000149install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
150install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
151install -m644 %{zeb_rh_src}/zebra.pam $RPM_BUILD_ROOT/etc/pam.d/zebra
152install -m644 %{zeb_rh_src}/zebra.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/zebra
paul788cdc62003-01-18 00:22:08 +0000153
paul788cdc62003-01-18 00:22:08 +0000154%post
paul30b9d892003-01-18 22:57:15 +0000155# zebra_spec_add_service <service name> <port/proto> <comment>
paul788cdc62003-01-18 00:22:08 +0000156# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
157
158zebra_spec_add_service ()
159{
160 # Add port /etc/services entry if it isn't already there
161 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
162 echo "$1 $2 # $3" >> /etc/services
163 fi
164}
165
166zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
167zebra_spec_add_service zebra 2601/tcp "zebra vty"
168zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000169%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000170zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000171%endif
paul788cdc62003-01-18 00:22:08 +0000172zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
173zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000174%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000175zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000176%endif
paul788cdc62003-01-18 00:22:08 +0000177
178/sbin/chkconfig --add zebra
179/sbin/chkconfig --add ripd
pauld7ccae22003-01-18 00:24:00 +0000180%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000181/sbin/chkconfig --add ripngd
paul788cdc62003-01-18 00:22:08 +0000182/sbin/chkconfig --add ospf6d
pauld7ccae22003-01-18 00:24:00 +0000183%endif
paul30b9d892003-01-18 22:57:15 +0000184/sbin/chkconfig --add ospfd
paul788cdc62003-01-18 00:22:08 +0000185/sbin/chkconfig --add bgpd
186
187/sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
188
189# Create dummy files if they don't exist so basic functions can be used.
190if [ ! -e %{_sysconfdir}/zebra.conf ]; then
191 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
192 chmod 640 %{_sysconfdir}/zebra.conf
193fi
194if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
195 touch %{_sysconfdir}/vtysh.conf
196 chmod 640 %{_sysconfdir}/vtysh.conf
197fi
198
199%postun
200if [ "$1" -ge "1" ]; then
201 /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
202 /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000203%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000204 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000205%endif
paul788cdc62003-01-18 00:22:08 +0000206 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000207%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000208 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000209%endif
paul788cdc62003-01-18 00:22:08 +0000210 /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
211fi
212/sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
213
214%preun
215if [ "$1" = "0" ]; then
216 /sbin/chkconfig --del zebra
217 /sbin/chkconfig --del ripd
pauld7ccae22003-01-18 00:24:00 +0000218%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000219 /sbin/chkconfig --del ripngd
pauld7ccae22003-01-18 00:24:00 +0000220%endif
paul788cdc62003-01-18 00:22:08 +0000221 /sbin/chkconfig --del ospfd
pauld7ccae22003-01-18 00:24:00 +0000222%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000223 /sbin/chkconfig --del ospf6d
pauld7ccae22003-01-18 00:24:00 +0000224%endif
paul788cdc62003-01-18 00:22:08 +0000225 /sbin/chkconfig --del bgpd
226fi
227
228%clean
229#rm -rf $RPM_BUILD_ROOT
230
231%files
232%defattr(-,root,root)
paul448ed4a2003-03-01 15:43:28 +0000233%doc */*.sample* AUTHORS COPYING
paul8f754982003-01-20 04:55:51 +0000234%doc doc/zebra.html
paul30b9d892003-01-18 22:57:15 +0000235%doc doc/mpls
paul8f754982003-01-20 04:55:51 +0000236%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
paul788cdc62003-01-18 00:22:08 +0000237%dir %attr(750,root,root) %{_sysconfdir}
238%dir %attr(750,root,root) /var/log/zebra
239%dir %attr(755,root,root) /usr/share/info
240%{_infodir}/*info*
241%{_mandir}/man*/*
242%{_sbindir}/*
pauld7ccae22003-01-18 00:24:00 +0000243%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000244%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000245%endif
paul788cdc62003-01-18 00:22:08 +0000246%config /etc/zebra/*
247%config /etc/rc.d/init.d/*
248%config(noreplace) /etc/pam.d/zebra
249%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
250
paul448ed4a2003-03-01 15:43:28 +0000251%files contrib
252%defattr(-,root,root)
253%doc tools
254
paule0626852003-03-18 14:11:36 +0000255%files devel
256%defattr(-,root,root)
257%dir %{_libdir}/*
paul68980082003-03-25 05:07:42 +0000258%dir %{_includedir}/ospfd/*
259%if %with_ospfapi
paule0626852003-03-18 14:11:36 +0000260%dir %{_includedir}/ospfapi/*
paul68980082003-03-25 05:07:42 +0000261%endif
paule0626852003-03-18 14:11:36 +0000262
paul788cdc62003-01-18 00:22:08 +0000263%changelog
paule0626852003-03-18 14:11:36 +0000264* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
265- Fix mem leak in 'show thread cpu'
266- Ralph Keller's OSPF-API
267- Amir: Fix configure.ac for net-snmp
268
paul448ed4a2003-03-01 15:43:28 +0000269* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
270- ospfd IOS prefix to interface matching for 'network' statement
271- temporary fix for PtP and IPv6
272- sync to zebra.org CVS
273
paul8f754982003-01-20 04:55:51 +0000274* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
275- update to latest cvs
276- Yon's "show thread cpu" patch - 17217
277- walk up tree - 17218
278- ospfd NSSA fixes - 16681
279- ospfd nsm fixes - 16824
280- ospfd OLSA fixes and new feature - 16823
281- KAME and ifindex fixes - 16525
282- spec file changes to allow redhat files to be in tree
283
pauld7ccae22003-01-18 00:24:00 +0000284* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
285- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
286- Fixed up some build requirements (patch)
287- Added conditional build requirements for vtysh / snmp
288- Added conditional to %files for %_bindir depending on vtysh
289
paul788cdc62003-01-18 00:22:08 +0000290* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
291- update to latest CVS
292- add Greg Troxel's md5 buffer copy/dup fix
293- add RIPv1 fix
294- add Frank's multicast flag fix
295
296* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
297- update to latest CVS
298- timestamped crypt_seqnum patch
299- oi->on_write_q fix
300
301* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
302- update to latest CVS
303- add vtysh 'write-config (integrated|daemon)' patch
304- always 'make rebuild' in vtysh/ to catch new commands
305
306* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
307- update to 0.93b
308
309* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
310- update to latest CVS
311- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
312
313* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
314- update to current CVS
315- add OSPF point to multipoint patch
316- add OSPF bugfixes
317- add BGP hash optimisation patch
318
319* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
320- update to 0.93-pre1 / CVS
321- add link state detection support
322- add generic PtP and RFC3021 support
323- various bug fixes
324
325* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
326- Fix bug #51336
327
328* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
329- Use generic initscript strings instead of initscript specific
330 ( "Starting foo: " -> "Starting $prog:" )
331
332* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
333- Bump the release when rebuilding into the dist.
334
335* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
336- built for Powertools
337
338* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
339- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
340- Update to 0.91a
341- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
342- Should be quite Red Hat'isque now.