]> git.proxmox.com Git - mirror_frr.git/blame - redhat/zebra.spec
Indentation fix
[mirror_frr.git] / redhat / zebra.spec
CommitLineData
8f754983 1# conditionals
68980084 2%define with_snmp 0
788cdc6d 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
68980084 11%define with_ospfclient 0
12%define with_ospfapi 0
8f754983 13%define with_multipath 64
30b9d89b 14
15# path defines
788cdc6d 16%define _sysconfdir /etc/zebra
8f754983 17%define zeb_src %{_builddir}/%{name}-%{version}
18%define zeb_rh_src %{zeb_src}/redhat
19%define zeb_docs %{zeb_src}/doc
788cdc6d 20
e0626854 21# defines for configure
22%define _libexecdir %{_exec_prefix}/libexec/zebra
23%define _includedir %{_prefix}/include/zebra
24%define _libdir %{_exec_prefix}/%{_lib}/zebra
25
788cdc6d 26Summary: Routing daemon
27Name: zebra
78edbf8f 28Version: 0.94
68980084 29Release: 2003032501
788cdc6d 30License: GPL
31Group: System Environment/Daemons
32Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
788cdc6d 33URL: http://www.zebra.org/
34%if %with_snmp
e0626854 35#BuildRequires: ucd-snmp-devel
788cdc6d 36Prereq: ucd-snmp
37%endif
d7ccae28 38%if %with_vtysh
30b9d89b 39BuildRequires: readline readline-devel ncurses ncurses-devel
d7ccae28 40Prereq: readline ncurses
41%endif
42BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch
788cdc6d 43# Initscripts > 5.60 is required for IPv6 support
30b9d89b 44Prereq: initscripts >= 5.60
45Prereq: openssl ncurses readline pam
788cdc6d 46Prereq: /sbin/install-info
47Provides: routingdaemon
48BuildRoot: %{_tmppath}/%{name}-%{version}-root
49Obsoletes: bird gated mrt
50
51%description
52GNU Zebra is a free software that manages TCP/IP based routing
53protocol. It takes multi-server and multi-thread approach to resolve
54the current complexity of the Internet.
55
56GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
57
58GNU Zebra is intended to be used as a Route Server and a Route
59Reflector. It is not a toolkit, it provides full routing power under
60a new architecture. GNU Zebra is unique in design in that it has a
61process for each protocol.
62
448ed4a2 63%package contrib
64Summary: contrib tools for zebra
65Group: System Environment/Daemons
66
67%description contrib
68Contributed/3rd party tools which may be of use with zebra.
69
e0626854 70%package devel
71Summary: Header and object files for zebra development
72Group: System Environment/Daemons
73
74%description devel
75The zebra-devel package contains the header and object files neccessary for
76developing OSPF-API and zebra applications.
77
788cdc6d 78%prep
79%setup -q
788cdc6d 80
81%build
e0626854 82./update-autotools
788cdc6d 83%configure \
84 --with-cflags="-O2" \
85 --enable-netlink \
86%if %with_ipv6
87 --enable-ipv6 \
88%endif
89%if %with_snmp
90 --enable-snmp \
91%endif
92%if %with_multipath
93 --enable-multipath=%with_multipath \
94%endif
95%if %with_tcp_zebra
96 --enable-tcp-zebra \
97%endif
98%if %with_nssa
99 --enable-nssa \
100%endif
101%if %with_opaque_lsa
102 --enable-opaque-lsa \
103%endif
104%if %with_ospf_te
105 --enable-ospf-te \
106%endif
107%if %with_vtysh
108 --enable-vtysh \
109%endif
68980084 110%if %with_ospfclient
111 --enable-ospfclient=yes \
112%else
113 --enable-ospfclient=no\
114%endif
115%if %with_ospfapi
116 --enable-ospfapi=yes \
117%else
118 --enable-ospfapi=no \
119%endif
788cdc6d 120%if %with_pam
121 --with-libpam
122%endif
123
124pushd vtysh
125make %{?_smp_mflags} rebuild
126popd
127
128make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
129
130pushd doc
131texi2html zebra.texi
132popd
133
134%install
135rm -rf $RPM_BUILD_ROOT
136
137install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
138 $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
139
140make install \
141 DESTDIR=$RPM_BUILD_ROOT
142
8f754983 143install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
144install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
d7ccae28 145%if %with_ipv6
8f754983 146install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
147install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
d7ccae28 148%endif
8f754983 149install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
150install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
151install -m644 %{zeb_rh_src}/zebra.pam $RPM_BUILD_ROOT/etc/pam.d/zebra
152install -m644 %{zeb_rh_src}/zebra.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/zebra
788cdc6d 153
788cdc6d 154%post
30b9d89b 155# zebra_spec_add_service <service name> <port/proto> <comment>
788cdc6d 156# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
157
158zebra_spec_add_service ()
159{
160 # Add port /etc/services entry if it isn't already there
161 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
162 echo "$1 $2 # $3" >> /etc/services
163 fi
164}
165
166zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
167zebra_spec_add_service zebra 2601/tcp "zebra vty"
168zebra_spec_add_service ripd 2602/tcp "RIPd vty"
d7ccae28 169%if %with_ipv6
788cdc6d 170zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
d7ccae28 171%endif
788cdc6d 172zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
173zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
d7ccae28 174%if %with_ipv6
788cdc6d 175zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
d7ccae28 176%endif
788cdc6d 177
178/sbin/chkconfig --add zebra
179/sbin/chkconfig --add ripd
d7ccae28 180%if %with_ipv6
788cdc6d 181/sbin/chkconfig --add ripngd
788cdc6d 182/sbin/chkconfig --add ospf6d
d7ccae28 183%endif
30b9d89b 184/sbin/chkconfig --add ospfd
788cdc6d 185/sbin/chkconfig --add bgpd
186
187/sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
188
189# Create dummy files if they don't exist so basic functions can be used.
190if [ ! -e %{_sysconfdir}/zebra.conf ]; then
191 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
192 chmod 640 %{_sysconfdir}/zebra.conf
193fi
194if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
195 touch %{_sysconfdir}/vtysh.conf
196 chmod 640 %{_sysconfdir}/vtysh.conf
197fi
198
199%postun
200if [ "$1" -ge "1" ]; then
201 /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
202 /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
d7ccae28 203%if %with_ipv6
788cdc6d 204 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
d7ccae28 205%endif
788cdc6d 206 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
d7ccae28 207%if %with_ipv6
788cdc6d 208 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
d7ccae28 209%endif
788cdc6d 210 /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
211fi
212/sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
213
214%preun
215if [ "$1" = "0" ]; then
216 /sbin/chkconfig --del zebra
217 /sbin/chkconfig --del ripd
d7ccae28 218%if %with_ipv6
788cdc6d 219 /sbin/chkconfig --del ripngd
d7ccae28 220%endif
788cdc6d 221 /sbin/chkconfig --del ospfd
d7ccae28 222%if %with_ipv6
788cdc6d 223 /sbin/chkconfig --del ospf6d
d7ccae28 224%endif
788cdc6d 225 /sbin/chkconfig --del bgpd
226fi
227
228%clean
229#rm -rf $RPM_BUILD_ROOT
230
231%files
232%defattr(-,root,root)
448ed4a2 233%doc */*.sample* AUTHORS COPYING
8f754983 234%doc doc/zebra.html
30b9d89b 235%doc doc/mpls
8f754983 236%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
788cdc6d 237%dir %attr(750,root,root) %{_sysconfdir}
238%dir %attr(750,root,root) /var/log/zebra
239%dir %attr(755,root,root) /usr/share/info
240%{_infodir}/*info*
241%{_mandir}/man*/*
242%{_sbindir}/*
d7ccae28 243%if %with_vtysh
788cdc6d 244%{_bindir}/*
d7ccae28 245%endif
788cdc6d 246%config /etc/zebra/*
247%config /etc/rc.d/init.d/*
248%config(noreplace) /etc/pam.d/zebra
249%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
250
448ed4a2 251%files contrib
252%defattr(-,root,root)
253%doc tools
254
e0626854 255%files devel
256%defattr(-,root,root)
257%dir %{_libdir}/*
68980084 258%dir %{_includedir}/ospfd/*
259%if %with_ospfapi
e0626854 260%dir %{_includedir}/ospfapi/*
68980084 261%endif
e0626854 262
788cdc6d 263%changelog
e0626854 264* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
265- Fix mem leak in 'show thread cpu'
266- Ralph Keller's OSPF-API
267- Amir: Fix configure.ac for net-snmp
268
448ed4a2 269* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
270- ospfd IOS prefix to interface matching for 'network' statement
271- temporary fix for PtP and IPv6
272- sync to zebra.org CVS
273
8f754983 274* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
275- update to latest cvs
276- Yon's "show thread cpu" patch - 17217
277- walk up tree - 17218
278- ospfd NSSA fixes - 16681
279- ospfd nsm fixes - 16824
280- ospfd OLSA fixes and new feature - 16823
281- KAME and ifindex fixes - 16525
282- spec file changes to allow redhat files to be in tree
283
d7ccae28 284* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
285- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
286- Fixed up some build requirements (patch)
287- Added conditional build requirements for vtysh / snmp
288- Added conditional to %files for %_bindir depending on vtysh
289
788cdc6d 290* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
291- update to latest CVS
292- add Greg Troxel's md5 buffer copy/dup fix
293- add RIPv1 fix
294- add Frank's multicast flag fix
295
296* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
297- update to latest CVS
298- timestamped crypt_seqnum patch
299- oi->on_write_q fix
300
301* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
302- update to latest CVS
303- add vtysh 'write-config (integrated|daemon)' patch
304- always 'make rebuild' in vtysh/ to catch new commands
305
306* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
307- update to 0.93b
308
309* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
310- update to latest CVS
311- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
312
313* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
314- update to current CVS
315- add OSPF point to multipoint patch
316- add OSPF bugfixes
317- add BGP hash optimisation patch
318
319* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
320- update to 0.93-pre1 / CVS
321- add link state detection support
322- add generic PtP and RFC3021 support
323- various bug fixes
324
325* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
326- Fix bug #51336
327
328