blob: f7fdcd9545253338463aa0559958016125280a2c [file] [log] [blame]
paul8f754982003-01-20 04:55:51 +00001# conditionals
paul788cdc62003-01-18 00:22:08 +00002%define with_snmp 0
3%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
19Summary: Routing daemon
20Name: zebra
paul78edbf82003-02-13 20:18:50 +000021Version: 0.94
22Release: 2003021301
paul788cdc62003-01-18 00:22:08 +000023License: GPL
24Group: System Environment/Daemons
25Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
paul788cdc62003-01-18 00:22:08 +000026URL: http://www.zebra.org/
27%if %with_snmp
28BuildRequires: ucd-snmp-devel
29Prereq: ucd-snmp
30%endif
pauld7ccae22003-01-18 00:24:00 +000031%if %with_vtysh
paul30b9d892003-01-18 22:57:15 +000032BuildRequires: readline readline-devel ncurses ncurses-devel
pauld7ccae22003-01-18 00:24:00 +000033Prereq: readline ncurses
34%endif
35BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch
paul788cdc62003-01-18 00:22:08 +000036# Initscripts > 5.60 is required for IPv6 support
paul30b9d892003-01-18 22:57:15 +000037Prereq: initscripts >= 5.60
38Prereq: openssl ncurses readline pam
paul788cdc62003-01-18 00:22:08 +000039Prereq: /sbin/install-info
40Provides: routingdaemon
41BuildRoot: %{_tmppath}/%{name}-%{version}-root
42Obsoletes: bird gated mrt
43
44%description
45GNU Zebra is a free software that manages TCP/IP based routing
46protocol. It takes multi-server and multi-thread approach to resolve
47the current complexity of the Internet.
48
49GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
50
51GNU Zebra is intended to be used as a Route Server and a Route
52Reflector. It is not a toolkit, it provides full routing power under
53a new architecture. GNU Zebra is unique in design in that it has a
54process for each protocol.
55
56%prep
57%setup -q
paul788cdc62003-01-18 00:22:08 +000058
59%build
60%configure \
61 --with-cflags="-O2" \
62 --enable-netlink \
63%if %with_ipv6
64 --enable-ipv6 \
65%endif
66%if %with_snmp
67 --enable-snmp \
68%endif
69%if %with_multipath
70 --enable-multipath=%with_multipath \
71%endif
72%if %with_tcp_zebra
73 --enable-tcp-zebra \
74%endif
75%if %with_nssa
76 --enable-nssa \
77%endif
78%if %with_opaque_lsa
79 --enable-opaque-lsa \
80%endif
81%if %with_ospf_te
82 --enable-ospf-te \
83%endif
84%if %with_vtysh
85 --enable-vtysh \
86%endif
87%if %with_pam
88 --with-libpam
89%endif
90
91pushd vtysh
92make %{?_smp_mflags} rebuild
93popd
94
95make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
96
97pushd doc
98texi2html zebra.texi
99popd
100
101%install
102rm -rf $RPM_BUILD_ROOT
103
104install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
105 $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
106
107make install \
108 DESTDIR=$RPM_BUILD_ROOT
109
paul8f754982003-01-20 04:55:51 +0000110install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
111install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
pauld7ccae22003-01-18 00:24:00 +0000112%if %with_ipv6
paul8f754982003-01-20 04:55:51 +0000113install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
114install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
pauld7ccae22003-01-18 00:24:00 +0000115%endif
paul8f754982003-01-20 04:55:51 +0000116install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
117install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
118install -m644 %{zeb_rh_src}/zebra.pam $RPM_BUILD_ROOT/etc/pam.d/zebra
119install -m644 %{zeb_rh_src}/zebra.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/zebra
paul788cdc62003-01-18 00:22:08 +0000120
paul788cdc62003-01-18 00:22:08 +0000121%post
paul30b9d892003-01-18 22:57:15 +0000122# zebra_spec_add_service <service name> <port/proto> <comment>
paul788cdc62003-01-18 00:22:08 +0000123# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
124
125zebra_spec_add_service ()
126{
127 # Add port /etc/services entry if it isn't already there
128 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
129 echo "$1 $2 # $3" >> /etc/services
130 fi
131}
132
133zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
134zebra_spec_add_service zebra 2601/tcp "zebra vty"
135zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000136%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000137zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000138%endif
paul788cdc62003-01-18 00:22:08 +0000139zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
140zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000141%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000142zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000143%endif
paul788cdc62003-01-18 00:22:08 +0000144
145/sbin/chkconfig --add zebra
146/sbin/chkconfig --add ripd
pauld7ccae22003-01-18 00:24:00 +0000147%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000148/sbin/chkconfig --add ripngd
paul788cdc62003-01-18 00:22:08 +0000149/sbin/chkconfig --add ospf6d
pauld7ccae22003-01-18 00:24:00 +0000150%endif
paul30b9d892003-01-18 22:57:15 +0000151/sbin/chkconfig --add ospfd
paul788cdc62003-01-18 00:22:08 +0000152/sbin/chkconfig --add bgpd
153
154/sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
155
156# Create dummy files if they don't exist so basic functions can be used.
157if [ ! -e %{_sysconfdir}/zebra.conf ]; then
158 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
159 chmod 640 %{_sysconfdir}/zebra.conf
160fi
161if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
162 touch %{_sysconfdir}/vtysh.conf
163 chmod 640 %{_sysconfdir}/vtysh.conf
164fi
165
166%postun
167if [ "$1" -ge "1" ]; then
168 /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
169 /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000170%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000171 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000172%endif
paul788cdc62003-01-18 00:22:08 +0000173 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000174%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000175 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000176%endif
paul788cdc62003-01-18 00:22:08 +0000177 /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
178fi
179/sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
180
181%preun
182if [ "$1" = "0" ]; then
183 /sbin/chkconfig --del zebra
184 /sbin/chkconfig --del ripd
pauld7ccae22003-01-18 00:24:00 +0000185%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000186 /sbin/chkconfig --del ripngd
pauld7ccae22003-01-18 00:24:00 +0000187%endif
paul788cdc62003-01-18 00:22:08 +0000188 /sbin/chkconfig --del ospfd
pauld7ccae22003-01-18 00:24:00 +0000189%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000190 /sbin/chkconfig --del ospf6d
pauld7ccae22003-01-18 00:24:00 +0000191%endif
paul788cdc62003-01-18 00:22:08 +0000192 /sbin/chkconfig --del bgpd
193fi
194
195%clean
196#rm -rf $RPM_BUILD_ROOT
197
198%files
199%defattr(-,root,root)
paul8f754982003-01-20 04:55:51 +0000200%doc */*.sample* tools AUTHORS COPYING
201%doc doc/zebra.html
paul30b9d892003-01-18 22:57:15 +0000202%doc doc/mpls
paul8f754982003-01-20 04:55:51 +0000203%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
paul788cdc62003-01-18 00:22:08 +0000204%dir %attr(750,root,root) %{_sysconfdir}
205%dir %attr(750,root,root) /var/log/zebra
206%dir %attr(755,root,root) /usr/share/info
207%{_infodir}/*info*
208%{_mandir}/man*/*
209%{_sbindir}/*
pauld7ccae22003-01-18 00:24:00 +0000210%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000211%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000212%endif
paul788cdc62003-01-18 00:22:08 +0000213%config /etc/zebra/*
214%config /etc/rc.d/init.d/*
215%config(noreplace) /etc/pam.d/zebra
216%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
217
218%changelog
paul8f754982003-01-20 04:55:51 +0000219* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
220- update to latest cvs
221- Yon's "show thread cpu" patch - 17217
222- walk up tree - 17218
223- ospfd NSSA fixes - 16681
224- ospfd nsm fixes - 16824
225- ospfd OLSA fixes and new feature - 16823
226- KAME and ifindex fixes - 16525
227- spec file changes to allow redhat files to be in tree
228
pauld7ccae22003-01-18 00:24:00 +0000229* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
230- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
231- Fixed up some build requirements (patch)
232- Added conditional build requirements for vtysh / snmp
233- Added conditional to %files for %_bindir depending on vtysh
234
paul788cdc62003-01-18 00:22:08 +0000235* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
236- update to latest CVS
237- add Greg Troxel's md5 buffer copy/dup fix
238- add RIPv1 fix
239- add Frank's multicast flag fix
240
241* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
242- update to latest CVS
243- timestamped crypt_seqnum patch
244- oi->on_write_q fix
245
246* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
247- update to latest CVS
248- add vtysh 'write-config (integrated|daemon)' patch
249- always 'make rebuild' in vtysh/ to catch new commands
250
251* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
252- update to 0.93b
253
254* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
255- update to latest CVS
256- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
257
258* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
259- update to current CVS
260- add OSPF point to multipoint patch
261- add OSPF bugfixes
262- add BGP hash optimisation patch
263
264* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
265- update to 0.93-pre1 / CVS
266- add link state detection support
267- add generic PtP and RFC3021 support
268- various bug fixes
269
270* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
271- Fix bug #51336
272
273* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
274- Use generic initscript strings instead of initscript specific
275 ( "Starting foo: " -> "Starting $prog:" )
276
277* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
278- Bump the release when rebuilding into the dist.
279
280* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
281- built for Powertools
282
283* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
284- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
285- Update to 0.91a
286- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
287- Should be quite Red Hat'isque now.