blob: 3e7f2b9902e13f1e056a918b0fd25711b961e2a2 [file] [log] [blame]
paul788cdc62003-01-18 00:22:08 +00001%define with_snmp 0
2%define with_vtysh 1
3%define with_ospf_te 1
4%define with_nssa 1
5%define with_opaque_lsa 1
6%define with_tcp_zebra 0
7%define with_vtysh 1
8%define with_pam 1
9%define with_ipv6 1
10%define with_multipath 32
paul30b9d892003-01-18 22:57:15 +000011
12# path defines
paul788cdc62003-01-18 00:22:08 +000013%define _sysconfdir /etc/zebra
paul30b9d892003-01-18 22:57:15 +000014%define zeb_builddir %{_builddir}/%{name}-%{version}
15%define zeb_rh_src %{zeb_builddir}/redhat
16%define zeb_docs %{zeb_builddir}/doc
17
18# files
19%define zebra.ini
20%define zebra_init %{zeb_rh_src}/zebra.init
21%define bgpd_init %{zeb_rh_src}/bgpd.init
22%define ospf6d_init %{zeb_rh_src}/ospf6d.init
23%define ospfd_init %{zeb_rh_src}/ospfd.init
24%define ripd_init %{zeb_rh_src}/ripd.init
25%define ripngd_init %{zeb_rh_src}/ripngd.init
26%define zebra_pam %{zeb_rh_src}/zebra.pam
27%define zebra_logrotate %{zeb_rh_src}/zebra.logrotate
28
29#echo %{zeb_docs}
30#echo %{zeb_rh_src}
paul788cdc62003-01-18 00:22:08 +000031
32Summary: Routing daemon
33Name: zebra
34Version: 0.93b
paul30b9d892003-01-18 22:57:15 +000035Release: 2003011801
paul788cdc62003-01-18 00:22:08 +000036License: GPL
37Group: System Environment/Daemons
38Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
paul788cdc62003-01-18 00:22:08 +000039URL: http://www.zebra.org/
40%if %with_snmp
41BuildRequires: ucd-snmp-devel
42Prereq: ucd-snmp
43%endif
pauld7ccae22003-01-18 00:24:00 +000044%if %with_vtysh
paul30b9d892003-01-18 22:57:15 +000045BuildRequires: readline readline-devel ncurses ncurses-devel
pauld7ccae22003-01-18 00:24:00 +000046Prereq: readline ncurses
47%endif
48BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch
paul788cdc62003-01-18 00:22:08 +000049# Initscripts > 5.60 is required for IPv6 support
paul30b9d892003-01-18 22:57:15 +000050Prereq: initscripts >= 5.60
51Prereq: openssl ncurses readline pam
paul788cdc62003-01-18 00:22:08 +000052Prereq: /sbin/install-info
53Provides: routingdaemon
54BuildRoot: %{_tmppath}/%{name}-%{version}-root
55Obsoletes: bird gated mrt
56
57%description
58GNU Zebra is a free software that manages TCP/IP based routing
59protocol. It takes multi-server and multi-thread approach to resolve
60the current complexity of the Internet.
61
62GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
63
64GNU Zebra is intended to be used as a Route Server and a Route
65Reflector. It is not a toolkit, it provides full routing power under
66a new architecture. GNU Zebra is unique in design in that it has a
67process for each protocol.
68
69%prep
70%setup -q
paul788cdc62003-01-18 00:22:08 +000071
72%build
73%configure \
74 --with-cflags="-O2" \
75 --enable-netlink \
76%if %with_ipv6
77 --enable-ipv6 \
78%endif
79%if %with_snmp
80 --enable-snmp \
81%endif
82%if %with_multipath
83 --enable-multipath=%with_multipath \
84%endif
85%if %with_tcp_zebra
86 --enable-tcp-zebra \
87%endif
88%if %with_nssa
89 --enable-nssa \
90%endif
91%if %with_opaque_lsa
92 --enable-opaque-lsa \
93%endif
94%if %with_ospf_te
95 --enable-ospf-te \
96%endif
97%if %with_vtysh
98 --enable-vtysh \
99%endif
100%if %with_pam
101 --with-libpam
102%endif
103
104pushd vtysh
105make %{?_smp_mflags} rebuild
106popd
107
108make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
109
110pushd doc
111texi2html zebra.texi
112popd
113
114%install
115rm -rf $RPM_BUILD_ROOT
116
117install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
118 $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
119
120make install \
121 DESTDIR=$RPM_BUILD_ROOT
122
paul30b9d892003-01-18 22:57:15 +0000123install %{zebra_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
124install %{bgpd_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
pauld7ccae22003-01-18 00:24:00 +0000125%if %with_ipv6
paul30b9d892003-01-18 22:57:15 +0000126install %{ospf6d_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
127install %{ripngd_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
pauld7ccae22003-01-18 00:24:00 +0000128%endif
paul30b9d892003-01-18 22:57:15 +0000129install %{ospfd_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
130install %{ripd_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
131install -m644 %{zebra_pam} $RPM_BUILD_ROOT/etc/pam.d/zebra
132install -m644 %{zebra_logrotate} $RPM_BUILD_ROOT/etc/logrotate.d/zebra
paul788cdc62003-01-18 00:22:08 +0000133
paul788cdc62003-01-18 00:22:08 +0000134%post
paul30b9d892003-01-18 22:57:15 +0000135# zebra_spec_add_service <service name> <port/proto> <comment>
paul788cdc62003-01-18 00:22:08 +0000136# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
137
138zebra_spec_add_service ()
139{
140 # Add port /etc/services entry if it isn't already there
141 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
142 echo "$1 $2 # $3" >> /etc/services
143 fi
144}
145
146zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
147zebra_spec_add_service zebra 2601/tcp "zebra vty"
148zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000149%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000150zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000151%endif
paul788cdc62003-01-18 00:22:08 +0000152zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
153zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000154%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000155zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000156%endif
paul788cdc62003-01-18 00:22:08 +0000157
158/sbin/chkconfig --add zebra
159/sbin/chkconfig --add ripd
pauld7ccae22003-01-18 00:24:00 +0000160%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000161/sbin/chkconfig --add ripngd
paul788cdc62003-01-18 00:22:08 +0000162/sbin/chkconfig --add ospf6d
pauld7ccae22003-01-18 00:24:00 +0000163%endif
paul30b9d892003-01-18 22:57:15 +0000164/sbin/chkconfig --add ospfd
paul788cdc62003-01-18 00:22:08 +0000165/sbin/chkconfig --add bgpd
166
167/sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
168
169# Create dummy files if they don't exist so basic functions can be used.
170if [ ! -e %{_sysconfdir}/zebra.conf ]; then
171 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
172 chmod 640 %{_sysconfdir}/zebra.conf
173fi
174if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
175 touch %{_sysconfdir}/vtysh.conf
176 chmod 640 %{_sysconfdir}/vtysh.conf
177fi
178
179%postun
180if [ "$1" -ge "1" ]; then
181 /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
182 /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000183%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000184 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000185%endif
paul788cdc62003-01-18 00:22:08 +0000186 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000187%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000188 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000189%endif
paul788cdc62003-01-18 00:22:08 +0000190 /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
191fi
192/sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
193
194%preun
195if [ "$1" = "0" ]; then
196 /sbin/chkconfig --del zebra
197 /sbin/chkconfig --del ripd
pauld7ccae22003-01-18 00:24:00 +0000198%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000199 /sbin/chkconfig --del ripngd
pauld7ccae22003-01-18 00:24:00 +0000200%endif
paul788cdc62003-01-18 00:22:08 +0000201 /sbin/chkconfig --del ospfd
pauld7ccae22003-01-18 00:24:00 +0000202%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000203 /sbin/chkconfig --del ospf6d
pauld7ccae22003-01-18 00:24:00 +0000204%endif
paul788cdc62003-01-18 00:22:08 +0000205 /sbin/chkconfig --del bgpd
206fi
207
208%clean
209#rm -rf $RPM_BUILD_ROOT
210
211%files
212%defattr(-,root,root)
213%doc */*.sample* doc/zebra.html tools AUTHORS COPYING
214%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
paul30b9d892003-01-18 22:57:15 +0000215%doc doc/mpls
paul788cdc62003-01-18 00:22:08 +0000216%dir %attr(750,root,root) %{_sysconfdir}
217%dir %attr(750,root,root) /var/log/zebra
218%dir %attr(755,root,root) /usr/share/info
219%{_infodir}/*info*
220%{_mandir}/man*/*
221%{_sbindir}/*
pauld7ccae22003-01-18 00:24:00 +0000222%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000223%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000224%endif
paul788cdc62003-01-18 00:22:08 +0000225%config /etc/zebra/*
226%config /etc/rc.d/init.d/*
227%config(noreplace) /etc/pam.d/zebra
228%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
229
230%changelog
pauld7ccae22003-01-18 00:24:00 +0000231* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
232- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
233- Fixed up some build requirements (patch)
234- Added conditional build requirements for vtysh / snmp
235- Added conditional to %files for %_bindir depending on vtysh
236
paul788cdc62003-01-18 00:22:08 +0000237* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
238- update to latest CVS
239- add Greg Troxel's md5 buffer copy/dup fix
240- add RIPv1 fix
241- add Frank's multicast flag fix
242
243* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
244- update to latest CVS
245- timestamped crypt_seqnum patch
246- oi->on_write_q fix
247
248* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
249- update to latest CVS
250- add vtysh 'write-config (integrated|daemon)' patch
251- always 'make rebuild' in vtysh/ to catch new commands
252
253* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
254- update to 0.93b
255
256* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
257- update to latest CVS
258- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
259
260* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
261- update to current CVS
262- add OSPF point to multipoint patch
263- add OSPF bugfixes
264- add BGP hash optimisation patch
265
266* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
267- update to 0.93-pre1 / CVS
268- add link state detection support
269- add generic PtP and RFC3021 support
270- various bug fixes
271
272* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
273- Fix bug #51336
274
275* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
276- Use generic initscript strings instead of initscript specific
277 ( "Starting foo: " -> "Starting $prog:" )
278
279* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
280- Bump the release when rebuilding into the dist.
281
282* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
283- built for Powertools
284
285* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
286- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
287- Update to 0.91a
288- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
289- Should be quite Red Hat'isque now.