]> git.proxmox.com Git - mirror_frr.git/blame - redhat/zebra.spec
Sync to latest Zebra CVS
[mirror_frr.git] / redhat / zebra.spec
CommitLineData
8f754983 1# conditionals
788cdc6d 2%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
8f754983 11%define with_multipath 64
30b9d89b 12
13# path defines
788cdc6d 14%define _sysconfdir /etc/zebra
8f754983 15%define zeb_src %{_builddir}/%{name}-%{version}
16%define zeb_rh_src %{zeb_src}/redhat
17%define zeb_docs %{zeb_src}/doc
788cdc6d 18
19Summary: Routing daemon
20Name: zebra
21Version: 0.93b
8f754983 22Release: 2003012001
788cdc6d 23License: GPL
24Group: System Environment/Daemons
25Source0: ftp://ftp.zebra.org/pub/zebra/%{name}-%{version}.tar.gz
788cdc6d 26URL: http://www.zebra.org/
27%if %with_snmp
28BuildRequires: ucd-snmp-devel
29Prereq: ucd-snmp
30%endif
d7ccae28 31%if %with_vtysh
30b9d89b 32BuildRequires: readline readline-devel ncurses ncurses-devel
d7ccae28 33Prereq: readline ncurses
34%endif
35BuildRequires: texinfo tetex autoconf openssl-devel pam-devel patch
788cdc6d 36# Initscripts > 5.60 is required for IPv6 support
30b9d89b 37Prereq: initscripts >= 5.60
38Prereq: openssl ncurses readline pam
788cdc6d 39Prereq: /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
788cdc6d 58
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
8f754983 110install %{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
d7ccae28 112%if %with_ipv6
8f754983 113install %{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
d7ccae28 115%endif
8f754983 116install %{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
788cdc6d 120
788cdc6d 121%post
30b9d89b 122# zebra_spec_add_service <service name> <port/proto> <comment>
788cdc6d 123# 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"
d7ccae28 136%if %with_ipv6
788cdc6d 137zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
d7ccae28 138%endif
788cdc6d 139zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
140zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
d7ccae28 141%if %with_ipv6
788cdc6d 142zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
d7ccae28 143%endif
788cdc6d 144
145/sbin/chkconfig --add zebra
146/sbin/chkconfig --add ripd
d7ccae28 147%if %with_ipv6
788cdc6d 148/sbin/chkconfig --add ripngd
788cdc6d 149/sbin/chkconfig --add ospf6d
d7ccae28 150%endif
30b9d89b 151/sbin/chkconfig --add ospfd
788cdc6d 152/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
d7ccae28 170%if %with_ipv6
788cdc6d 171 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
d7ccae28 172%endif
788cdc6d 173 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
d7ccae28 174%if %with_ipv6
788cdc6d 175 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
d7ccae28 176%endif
788cdc6d 177 /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
d7ccae28 185%if %with_ipv6
788cdc6d 186 /sbin/chkconfig --del ripngd
d7ccae28 187%endif
788cdc6d 188 /sbin/chkconfig --del ospfd
d7ccae28 189%if %with_ipv6
788cdc6d 190 /sbin/chkconfig --del ospf6d
d7ccae28 191%endif
788cdc6d 192 /sbin/chkconfig --del bgpd
193fi
194
195%clean
196#rm -rf $RPM_BUILD_ROOT
197
198%files
199%defattr(-,root,root)
8f754983 200%doc */*.sample* tools AUTHORS COPYING
201%doc doc/zebra.html
30b9d89b 202%doc doc/mpls
8f754983 203%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
788cdc6d 204%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}/*
d7ccae28 210%if %with_vtysh
788cdc6d 211%{_bindir}/*
d7ccae28 212%endif
788cdc6d 213%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
8f754983 219* 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
d7ccae28 229* 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
788cdc6d 235* 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