blob: 77f514659e49270ae7d978332405b41d1a7f72f7 [file] [log] [blame]
paul8f754982003-01-20 04:55:51 +00001# conditionals
paul448ed4a2003-03-01 15:43:28 +00002%define with_snmp 1
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
paul8f754982003-01-20 04:55:51 +000011%define with_multipath 64
paul30b9d892003-01-18 22:57:15 +000012
13# path defines
paul788cdc62003-01-18 00:22:08 +000014%define _sysconfdir /etc/zebra
paul8f754982003-01-20 04:55:51 +000015%define zeb_src %{_builddir}/%{name}-%{version}
16%define zeb_rh_src %{zeb_src}/redhat
17%define zeb_docs %{zeb_src}/doc
paul788cdc62003-01-18 00:22:08 +000018
paule0626852003-03-18 14:11:36 +000019# defines for configure
20%define _libexecdir %{_exec_prefix}/libexec/zebra
21%define _includedir %{_prefix}/include/zebra
22%define _libdir %{_exec_prefix}/%{_lib}/zebra
23
paul788cdc62003-01-18 00:22:08 +000024Summary: Routing daemon
25Name: zebra
paul78edbf82003-02-13 20:18:50 +000026Version: 0.94
paule0626852003-03-18 14:11:36 +000027Release: 2003031801
paul788cdc62003-01-18 00:22:08 +000028License: GPL
29Group: System Environment/Daemons
30Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
paul788cdc62003-01-18 00:22:08 +000031URL: http://www.zebra.org/
32%if %with_snmp
paule0626852003-03-18 14:11:36 +000033#BuildRequires: ucd-snmp-devel
paul788cdc62003-01-18 00:22:08 +000034Prereq: ucd-snmp
35%endif
pauld7ccae22003-01-18 00:24:00 +000036%if %with_vtysh
paul30b9d892003-01-18 22:57:15 +000037BuildRequires: readline readline-devel ncurses ncurses-devel
pauld7ccae22003-01-18 00:24:00 +000038Prereq: readline ncurses
39%endif
40BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch
paul788cdc62003-01-18 00:22:08 +000041# Initscripts > 5.60 is required for IPv6 support
paul30b9d892003-01-18 22:57:15 +000042Prereq: initscripts >= 5.60
43Prereq: openssl ncurses readline pam
paul788cdc62003-01-18 00:22:08 +000044Prereq: /sbin/install-info
45Provides: routingdaemon
46BuildRoot: %{_tmppath}/%{name}-%{version}-root
47Obsoletes: bird gated mrt
48
49%description
50GNU Zebra is a free software that manages TCP/IP based routing
51protocol. It takes multi-server and multi-thread approach to resolve
52the current complexity of the Internet.
53
54GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
55
56GNU Zebra is intended to be used as a Route Server and a Route
57Reflector. It is not a toolkit, it provides full routing power under
58a new architecture. GNU Zebra is unique in design in that it has a
59process for each protocol.
60
paul448ed4a2003-03-01 15:43:28 +000061%package contrib
62Summary: contrib tools for zebra
63Group: System Environment/Daemons
64
65%description contrib
66Contributed/3rd party tools which may be of use with zebra.
67
paule0626852003-03-18 14:11:36 +000068%package devel
69Summary: Header and object files for zebra development
70Group: System Environment/Daemons
71
72%description devel
73The zebra-devel package contains the header and object files neccessary for
74developing OSPF-API and zebra applications.
75
paul788cdc62003-01-18 00:22:08 +000076%prep
77%setup -q
paul788cdc62003-01-18 00:22:08 +000078
79%build
paule0626852003-03-18 14:11:36 +000080./update-autotools
paul788cdc62003-01-18 00:22:08 +000081%configure \
82 --with-cflags="-O2" \
83 --enable-netlink \
84%if %with_ipv6
85 --enable-ipv6 \
86%endif
87%if %with_snmp
88 --enable-snmp \
89%endif
90%if %with_multipath
91 --enable-multipath=%with_multipath \
92%endif
93%if %with_tcp_zebra
94 --enable-tcp-zebra \
95%endif
96%if %with_nssa
97 --enable-nssa \
98%endif
99%if %with_opaque_lsa
100 --enable-opaque-lsa \
101%endif
102%if %with_ospf_te
103 --enable-ospf-te \
104%endif
105%if %with_vtysh
106 --enable-vtysh \
107%endif
108%if %with_pam
109 --with-libpam
110%endif
111
112pushd vtysh
113make %{?_smp_mflags} rebuild
114popd
115
116make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
117
118pushd doc
119texi2html zebra.texi
120popd
121
122%install
123rm -rf $RPM_BUILD_ROOT
124
125install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
126 $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
127
128make install \
129 DESTDIR=$RPM_BUILD_ROOT
130
paul8f754982003-01-20 04:55:51 +0000131install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
132install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
pauld7ccae22003-01-18 00:24:00 +0000133%if %with_ipv6
paul8f754982003-01-20 04:55:51 +0000134install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
135install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
pauld7ccae22003-01-18 00:24:00 +0000136%endif
paul8f754982003-01-20 04:55:51 +0000137install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
138install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
139install -m644 %{zeb_rh_src}/zebra.pam $RPM_BUILD_ROOT/etc/pam.d/zebra
140install -m644 %{zeb_rh_src}/zebra.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/zebra
paul788cdc62003-01-18 00:22:08 +0000141
paul788cdc62003-01-18 00:22:08 +0000142%post
paul30b9d892003-01-18 22:57:15 +0000143# zebra_spec_add_service <service name> <port/proto> <comment>
paul788cdc62003-01-18 00:22:08 +0000144# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
145
146zebra_spec_add_service ()
147{
148 # Add port /etc/services entry if it isn't already there
149 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
150 echo "$1 $2 # $3" >> /etc/services
151 fi
152}
153
154zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
155zebra_spec_add_service zebra 2601/tcp "zebra vty"
156zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000157%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000158zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000159%endif
paul788cdc62003-01-18 00:22:08 +0000160zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
161zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000162%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000163zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000164%endif
paul788cdc62003-01-18 00:22:08 +0000165
166/sbin/chkconfig --add zebra
167/sbin/chkconfig --add ripd
pauld7ccae22003-01-18 00:24:00 +0000168%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000169/sbin/chkconfig --add ripngd
paul788cdc62003-01-18 00:22:08 +0000170/sbin/chkconfig --add ospf6d
pauld7ccae22003-01-18 00:24:00 +0000171%endif
paul30b9d892003-01-18 22:57:15 +0000172/sbin/chkconfig --add ospfd
paul788cdc62003-01-18 00:22:08 +0000173/sbin/chkconfig --add bgpd
174
175/sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
176
177# Create dummy files if they don't exist so basic functions can be used.
178if [ ! -e %{_sysconfdir}/zebra.conf ]; then
179 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
180 chmod 640 %{_sysconfdir}/zebra.conf
181fi
182if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
183 touch %{_sysconfdir}/vtysh.conf
184 chmod 640 %{_sysconfdir}/vtysh.conf
185fi
186
187%postun
188if [ "$1" -ge "1" ]; then
189 /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
190 /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000191%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000192 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000193%endif
paul788cdc62003-01-18 00:22:08 +0000194 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000195%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000196 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000197%endif
paul788cdc62003-01-18 00:22:08 +0000198 /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
199fi
200/sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
201
202%preun
203if [ "$1" = "0" ]; then
204 /sbin/chkconfig --del zebra
205 /sbin/chkconfig --del ripd
pauld7ccae22003-01-18 00:24:00 +0000206%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000207 /sbin/chkconfig --del ripngd
pauld7ccae22003-01-18 00:24:00 +0000208%endif
paul788cdc62003-01-18 00:22:08 +0000209 /sbin/chkconfig --del ospfd
pauld7ccae22003-01-18 00:24:00 +0000210%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000211 /sbin/chkconfig --del ospf6d
pauld7ccae22003-01-18 00:24:00 +0000212%endif
paul788cdc62003-01-18 00:22:08 +0000213 /sbin/chkconfig --del bgpd
214fi
215
216%clean
217#rm -rf $RPM_BUILD_ROOT
218
219%files
220%defattr(-,root,root)
paul448ed4a2003-03-01 15:43:28 +0000221%doc */*.sample* AUTHORS COPYING
paul8f754982003-01-20 04:55:51 +0000222%doc doc/zebra.html
paul30b9d892003-01-18 22:57:15 +0000223%doc doc/mpls
paul8f754982003-01-20 04:55:51 +0000224%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
paul788cdc62003-01-18 00:22:08 +0000225%dir %attr(750,root,root) %{_sysconfdir}
226%dir %attr(750,root,root) /var/log/zebra
227%dir %attr(755,root,root) /usr/share/info
228%{_infodir}/*info*
229%{_mandir}/man*/*
230%{_sbindir}/*
pauld7ccae22003-01-18 00:24:00 +0000231%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000232%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000233%endif
paul788cdc62003-01-18 00:22:08 +0000234%config /etc/zebra/*
235%config /etc/rc.d/init.d/*
236%config(noreplace) /etc/pam.d/zebra
237%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
238
paul448ed4a2003-03-01 15:43:28 +0000239%files contrib
240%defattr(-,root,root)
241%doc tools
242
paule0626852003-03-18 14:11:36 +0000243%files devel
244%defattr(-,root,root)
245%dir %{_libdir}/*
246%dir %{_includedir}/ospfd/*
247%dir %{_includedir}/ospfapi/*
248
paul788cdc62003-01-18 00:22:08 +0000249%changelog
paule0626852003-03-18 14:11:36 +0000250* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
251- Fix mem leak in 'show thread cpu'
252- Ralph Keller's OSPF-API
253- Amir: Fix configure.ac for net-snmp
254
paul448ed4a2003-03-01 15:43:28 +0000255* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
256- ospfd IOS prefix to interface matching for 'network' statement
257- temporary fix for PtP and IPv6
258- sync to zebra.org CVS
259
paul8f754982003-01-20 04:55:51 +0000260* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
261- update to latest cvs
262- Yon's "show thread cpu" patch - 17217
263- walk up tree - 17218
264- ospfd NSSA fixes - 16681
265- ospfd nsm fixes - 16824
266- ospfd OLSA fixes and new feature - 16823
267- KAME and ifindex fixes - 16525
268- spec file changes to allow redhat files to be in tree
269
pauld7ccae22003-01-18 00:24:00 +0000270* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
271- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
272- Fixed up some build requirements (patch)
273- Added conditional build requirements for vtysh / snmp
274- Added conditional to %files for %_bindir depending on vtysh
275
paul788cdc62003-01-18 00:22:08 +0000276* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
277- update to latest CVS
278- add Greg Troxel's md5 buffer copy/dup fix
279- add RIPv1 fix
280- add Frank's multicast flag fix
281
282* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
283- update to latest CVS
284- timestamped crypt_seqnum patch
285- oi->on_write_q fix
286
287* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
288- update to latest CVS
289- add vtysh 'write-config (integrated|daemon)' patch
290- always 'make rebuild' in vtysh/ to catch new commands
291
292* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
293- update to 0.93b
294
295* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
296- update to latest CVS
297- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
298
299* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
300- update to current CVS
301- add OSPF point to multipoint patch
302- add OSPF bugfixes
303- add BGP hash optimisation patch
304
305* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
306- update to 0.93-pre1 / CVS
307- add link state detection support
308- add generic PtP and RFC3021 support
309- various bug fixes
310
311* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
312- Fix bug #51336
313
314* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
315- Use generic initscript strings instead of initscript specific
316 ( "Starting foo: " -> "Starting $prog:" )
317
318* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
319- Bump the release when rebuilding into the dist.
320
321* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
322- built for Powertools
323
324* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
325- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
326- Update to 0.91a
327- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
328- Should be quite Red Hat'isque now.