blob: c6b9d643ceb4ef4f03d6a14a7cb0d5279fb07f8c [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
11%define _sysconfdir /etc/zebra
12
13Summary: Routing daemon
14Name: zebra
15Version: 0.93b
16Release: 2002111101
17License: GPL
18Group: System Environment/Daemons
19Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
20Source1: zebra.init
21Source2: bgpd.init
22Source3: ospf6d.init
23Source4: ospfd.init
24Source5: ripd.init
25Source6: ripngd.init
26Source8: zebra.pam
27Source9: zebra.logrotate
28Source10: zebra.mpls-docs.tar.gz
29Patch0: zebra-bgpd-hash.patch
30Patch1: zebra-ptp.patch
31Patch2: zebra-linkstate.patch
32Patch3: zebra-ospfd-ptmp.patch
33Patch4: zebra-ospfd-misc.patch
34Patch5: zebra-ospfd-olsa.patch
35Patch7: zebra-vtysh-write-config.patch
36Patch8: zebra-ospfd-md5auth-seqnum.patch
37Patch9: zebra-ospfd-oi_write_q.patch
38Patch10: zebra-ripv1-netmask.patch
39Patch11: zebra-ospfd-md5-buffer-fix.patch
40Patch12: zebra-multi.patch
41URL: http://www.zebra.org/
42%if %with_snmp
43BuildRequires: ucd-snmp-devel
44Prereq: ucd-snmp
45%endif
pauld7ccae22003-01-18 00:24:00 +000046%if %with_vtysh
47BuildRequires: readline readline-devel ncurses ncuses-devel
48Prereq: readline ncurses
49%endif
50BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch
paul788cdc62003-01-18 00:22:08 +000051# Initscripts > 5.60 is required for IPv6 support
52Prereq: openssl ncurses readline initscripts pam
53Prereq: /sbin/install-info
54Provides: routingdaemon
55BuildRoot: %{_tmppath}/%{name}-%{version}-root
56Obsoletes: bird gated mrt
57
58%description
59GNU Zebra is a free software that manages TCP/IP based routing
60protocol. It takes multi-server and multi-thread approach to resolve
61the current complexity of the Internet.
62
63GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
64
65GNU Zebra is intended to be used as a Route Server and a Route
66Reflector. It is not a toolkit, it provides full routing power under
67a new architecture. GNU Zebra is unique in design in that it has a
68process for each protocol.
69
70%prep
71%setup -q
72%patch0 -p1 -b .bgphash
73%patch1 -p0 -b .ptp
74%patch2 -p1 -b .linkstate
75%patch3 -p1 -b .ospf-ptmp
76%patch4 -p1 -b .ospf-misc
77%patch5 -p1 -b .ospf-olsa
78%patch7 -p1 -b .vtysh-write
79%patch8 -p2 -b .ospf-md5auth-seqnum
80%patch9 -p0 -b .ospfd-oi_write_q
81%patch10 -p0 -b .ripd-netmask
82%patch11 -p0 -b .ospfd-md5-buffer
83%patch12 -p0 -b .zebra-multi
84%{__tar} -zxf %{SOURCE10}
85
86%build
87%configure \
88 --with-cflags="-O2" \
89 --enable-netlink \
90%if %with_ipv6
91 --enable-ipv6 \
92%endif
93%if %with_snmp
94 --enable-snmp \
95%endif
96%if %with_multipath
97 --enable-multipath=%with_multipath \
98%endif
99%if %with_tcp_zebra
100 --enable-tcp-zebra \
101%endif
102%if %with_nssa
103 --enable-nssa \
104%endif
105%if %with_opaque_lsa
106 --enable-opaque-lsa \
107%endif
108%if %with_ospf_te
109 --enable-ospf-te \
110%endif
111%if %with_vtysh
112 --enable-vtysh \
113%endif
114%if %with_pam
115 --with-libpam
116%endif
117
118pushd vtysh
119make %{?_smp_mflags} rebuild
120popd
121
122make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
123
124pushd doc
125texi2html zebra.texi
126popd
127
128%install
129rm -rf $RPM_BUILD_ROOT
130
131install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
132 $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
133
134make install \
135 DESTDIR=$RPM_BUILD_ROOT
136
137install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
138install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
pauld7ccae22003-01-18 00:24:00 +0000139%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000140install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
pauld7ccae22003-01-18 00:24:00 +0000141%endif
paul788cdc62003-01-18 00:22:08 +0000142install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
143install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
pauld7ccae22003-01-18 00:24:00 +0000144%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000145install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
pauld7ccae22003-01-18 00:24:00 +0000146%endif
paul788cdc62003-01-18 00:22:08 +0000147install -m644 %{SOURCE8} $RPM_BUILD_ROOT/etc/pam.d/zebra
148install -m644 %{SOURCE9} $RPM_BUILD_ROOT/etc/logrotate.d/zebra
149
paul788cdc62003-01-18 00:22:08 +0000150%post
151# zebra_spec_add_service <sercice name> <port/proto> <comment>
152# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
153
154zebra_spec_add_service ()
155{
156 # Add port /etc/services entry if it isn't already there
157 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
158 echo "$1 $2 # $3" >> /etc/services
159 fi
160}
161
162zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
163zebra_spec_add_service zebra 2601/tcp "zebra vty"
164zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000165%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000166zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000167%endif
paul788cdc62003-01-18 00:22:08 +0000168zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
169zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000170%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000171zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000172%endif
paul788cdc62003-01-18 00:22:08 +0000173
174/sbin/chkconfig --add zebra
175/sbin/chkconfig --add ripd
pauld7ccae22003-01-18 00:24:00 +0000176%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000177/sbin/chkconfig --add ripngd
pauld7ccae22003-01-18 00:24:00 +0000178%endif
paul788cdc62003-01-18 00:22:08 +0000179/sbin/chkconfig --add ospfd
pauld7ccae22003-01-18 00:24:00 +0000180%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000181/sbin/chkconfig --add ospf6d
pauld7ccae22003-01-18 00:24:00 +0000182%endif
paul788cdc62003-01-18 00:22:08 +0000183/sbin/chkconfig --add bgpd
184
185/sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
186
187# Create dummy files if they don't exist so basic functions can be used.
188if [ ! -e %{_sysconfdir}/zebra.conf ]; then
189 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
190 chmod 640 %{_sysconfdir}/zebra.conf
191fi
192if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
193 touch %{_sysconfdir}/vtysh.conf
194 chmod 640 %{_sysconfdir}/vtysh.conf
195fi
196
197%postun
198if [ "$1" -ge "1" ]; then
199 /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
200 /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000201%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000202 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000203%endif
paul788cdc62003-01-18 00:22:08 +0000204 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000205%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000206 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000207%endif
paul788cdc62003-01-18 00:22:08 +0000208 /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
209fi
210/sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
211
212%preun
213if [ "$1" = "0" ]; then
214 /sbin/chkconfig --del zebra
215 /sbin/chkconfig --del ripd
pauld7ccae22003-01-18 00:24:00 +0000216%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000217 /sbin/chkconfig --del ripngd
pauld7ccae22003-01-18 00:24:00 +0000218%endif
paul788cdc62003-01-18 00:22:08 +0000219 /sbin/chkconfig --del ospfd
pauld7ccae22003-01-18 00:24:00 +0000220%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000221 /sbin/chkconfig --del ospf6d
pauld7ccae22003-01-18 00:24:00 +0000222%endif
paul788cdc62003-01-18 00:22:08 +0000223 /sbin/chkconfig --del bgpd
224fi
225
226%clean
227#rm -rf $RPM_BUILD_ROOT
228
229%files
230%defattr(-,root,root)
231%doc */*.sample* doc/zebra.html tools AUTHORS COPYING
232%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
233%dir %attr(750,root,root) %{_sysconfdir}
234%dir %attr(750,root,root) /var/log/zebra
235%dir %attr(755,root,root) /usr/share/info
236%{_infodir}/*info*
237%{_mandir}/man*/*
238%{_sbindir}/*
pauld7ccae22003-01-18 00:24:00 +0000239%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000240%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000241%endif
paul788cdc62003-01-18 00:22:08 +0000242%config /etc/zebra/*
243%config /etc/rc.d/init.d/*
244%config(noreplace) /etc/pam.d/zebra
245%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
246
247%changelog
pauld7ccae22003-01-18 00:24:00 +0000248* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
249- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
250- Fixed up some build requirements (patch)
251- Added conditional build requirements for vtysh / snmp
252- Added conditional to %files for %_bindir depending on vtysh
253
paul788cdc62003-01-18 00:22:08 +0000254* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
255- update to latest CVS
256- add Greg Troxel's md5 buffer copy/dup fix
257- add RIPv1 fix
258- add Frank's multicast flag fix
259
260* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
261- update to latest CVS
262- timestamped crypt_seqnum patch
263- oi->on_write_q fix
264
265* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
266- update to latest CVS
267- add vtysh 'write-config (integrated|daemon)' patch
268- always 'make rebuild' in vtysh/ to catch new commands
269
270* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
271- update to 0.93b
272
273* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
274- update to latest CVS
275- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
276
277* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
278- update to current CVS
279- add OSPF point to multipoint patch
280- add OSPF bugfixes
281- add BGP hash optimisation patch
282
283* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
284- update to 0.93-pre1 / CVS
285- add link state detection support
286- add generic PtP and RFC3021 support
287- various bug fixes
288
289* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
290- Fix bug #51336
291
292* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
293- Use generic initscript strings instead of initscript specific
294 ( "Starting foo: " -> "Starting $prog:" )
295
296* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
297- Bump the release when rebuilding into the dist.
298
299* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
300- built for Powertools
301
302* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
303- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
304- Update to 0.91a
305- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
306- Should be quite Red Hat'isque now.