]> git.proxmox.com Git - mirror_frr.git/blame - redhat/zebra.spec
Add work around for RFC3021 patch and its problem with certain IPv6 interfaces
[mirror_frr.git] / redhat / zebra.spec
CommitLineData
788cdc6d 1%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
30b9d89b 11
12# path defines
788cdc6d 13%define _sysconfdir /etc/zebra
30b9d89b 14%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}
788cdc6d 31
32Summary: Routing daemon
33Name: zebra
34Version: 0.93b
30b9d89b 35Release: 2003011801
788cdc6d 36License: GPL
37Group: System Environment/Daemons
38Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
788cdc6d 39URL: http://www.zebra.org/
40%if %with_snmp
41BuildRequires: ucd-snmp-devel
42Prereq: ucd-snmp
43%endif
d7ccae28 44%if %with_vtysh
30b9d89b 45BuildRequires: readline readline-devel ncurses ncurses-devel
d7ccae28 46Prereq: readline ncurses
47%endif
48BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch
788cdc6d 49# Initscripts > 5.60 is required for IPv6 support
30b9d89b 50Prereq: initscripts >= 5.60
51Prereq: openssl ncurses readline pam
788cdc6d 52Prereq: /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
788cdc6d 71
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
30b9d89b 123install %{zebra_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
124install %{bgpd_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
d7ccae28 125%if %with_ipv6
30b9d89b 126install %{ospf6d_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
127install %{ripngd_init} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
d7ccae28 128%endif
30b9d89b 129install %{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
788cdc6d 133
788cdc6d 134%post
30b9d89b 135# zebra_spec_add_service <service name> <port/proto> <comment>
788cdc6d 136# 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"
d7ccae28 149%if %with_ipv6
788cdc6d 150zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
d7ccae28 151%endif
788cdc6d 152zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
153zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
d7ccae28 154%if %with_ipv6
788cdc6d 155zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
d7ccae28 156%endif
788cdc6d 157
158/sbin/chkconfig --add zebra
159/sbin/chkconfig --add ripd
d7ccae28 160%if %with_ipv6
788cdc6d 161/sbin/chkconfig --add ripngd
788cdc6d 162/sbin/chkconfig --add ospf6d
d7ccae28 163%endif
30b9d89b 164/sbin/chkconfig --add ospfd
788cdc6d 165/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
d7ccae28 183%if %with_ipv6
788cdc6d 184 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
d7ccae28 185%endif
788cdc6d 186 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
d7ccae28 187%if %with_ipv6
788cdc6d 188 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
d7ccae28 189%endif
788cdc6d 190 /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
d7ccae28 198%if %with_ipv6
788cdc6d 199 /sbin/chkconfig --del ripngd
d7ccae28 200%endif
788cdc6d 201 /sbin/chkconfig --del ospfd
d7ccae28 202%if %with_ipv6
788cdc6d 203 /sbin/chkconfig --del ospf6d
d7ccae28 204%endif
788cdc6d 205 /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
30b9d89b 215%doc doc/mpls
788cdc6d 216%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}/*
d7ccae28 222%if %with_vtysh
788cdc6d 223%{_bindir}/*
d7ccae28 224%endif
788cdc6d 225%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
d7ccae28 231* 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
788cdc6d 237* 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