]> git.proxmox.com Git - mirror_frr.git/blame - ports/redhat/zebra.spec
Added RedHat related files, (init, logrotate, pam, rpm spec)
[mirror_frr.git] / ports / 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
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
46BuildRequires: texinfo tetex autoconf readline-devel ncurses-devel openssl-devel pam-devel
47# Initscripts > 5.60 is required for IPv6 support
48Prereq: openssl ncurses readline initscripts pam
49Prereq: /sbin/install-info
50Provides: routingdaemon
51BuildRoot: %{_tmppath}/%{name}-%{version}-root
52Obsoletes: bird gated mrt
53
54%description
55GNU Zebra is a free software that manages TCP/IP based routing
56protocol. It takes multi-server and multi-thread approach to resolve
57the current complexity of the Internet.
58
59GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
60
61GNU Zebra is intended to be used as a Route Server and a Route
62Reflector. It is not a toolkit, it provides full routing power under
63a new architecture. GNU Zebra is unique in design in that it has a
64process for each protocol.
65
66%prep
67%setup -q
68%patch0 -p1 -b .bgphash
69%patch1 -p0 -b .ptp
70%patch2 -p1 -b .linkstate
71%patch3 -p1 -b .ospf-ptmp
72%patch4 -p1 -b .ospf-misc
73%patch5 -p1 -b .ospf-olsa
74%patch7 -p1 -b .vtysh-write
75%patch8 -p2 -b .ospf-md5auth-seqnum
76%patch9 -p0 -b .ospfd-oi_write_q
77%patch10 -p0 -b .ripd-netmask
78%patch11 -p0 -b .ospfd-md5-buffer
79%patch12 -p0 -b .zebra-multi
80%{__tar} -zxf %{SOURCE10}
81
82%build
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
110%if %with_pam
111 --with-libpam
112%endif
113
114pushd vtysh
115make %{?_smp_mflags} rebuild
116popd
117
118make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
119
120pushd doc
121texi2html zebra.texi
122popd
123
124%install
125rm -rf $RPM_BUILD_ROOT
126
127install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
128 $RPM_BUILD_ROOT/var/log/zebra $RPM_BUILD_ROOT%{_infodir}
129
130make install \
131 DESTDIR=$RPM_BUILD_ROOT
132
133install %{SOURCE1} $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
134install %{SOURCE2} $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
135install %{SOURCE3} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
136install %{SOURCE4} $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
137install %{SOURCE5} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
138install %{SOURCE6} $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
139install -m644 %{SOURCE8} $RPM_BUILD_ROOT/etc/pam.d/zebra
140install -m644 %{SOURCE9} $RPM_BUILD_ROOT/etc/logrotate.d/zebra
141
142
143%post
144# zebra_spec_add_service <sercice name> <port/proto> <comment>
145# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
146
147zebra_spec_add_service ()
148{
149 # Add port /etc/services entry if it isn't already there
150 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
151 echo "$1 $2 # $3" >> /etc/services
152 fi
153}
154
155zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
156zebra_spec_add_service zebra 2601/tcp "zebra vty"
157zebra_spec_add_service ripd 2602/tcp "RIPd vty"
158zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
159zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
160zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
161zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
162
163/sbin/chkconfig --add zebra
164/sbin/chkconfig --add ripd
165/sbin/chkconfig --add ripngd
166/sbin/chkconfig --add ospfd
167/sbin/chkconfig --add ospf6d
168/sbin/chkconfig --add bgpd
169
170/sbin/install-info %{_infodir}/zebra.info.gz %{_infodir}/dir
171
172# Create dummy files if they don't exist so basic functions can be used.
173if [ ! -e %{_sysconfdir}/zebra.conf ]; then
174 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
175 chmod 640 %{_sysconfdir}/zebra.conf
176fi
177if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
178 touch %{_sysconfdir}/vtysh.conf
179 chmod 640 %{_sysconfdir}/vtysh.conf
180fi
181
182%postun
183if [ "$1" -ge "1" ]; then
184 /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
185 /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
186 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
187 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
188 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
189 /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
190fi
191/sbin/install-info --delete %{_infodir}/zebra.info.gz %{_infodir}/dir
192
193%preun
194if [ "$1" = "0" ]; then
195 /sbin/chkconfig --del zebra
196 /sbin/chkconfig --del ripd
197 /sbin/chkconfig --del ripngd
198 /sbin/chkconfig --del ospfd
199 /sbin/chkconfig --del ospf6d
200 /sbin/chkconfig --del bgpd
201fi
202
203%clean
204#rm -rf $RPM_BUILD_ROOT
205
206%files
207%defattr(-,root,root)
208%doc */*.sample* doc/zebra.html tools AUTHORS COPYING
209%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
210%dir %attr(750,root,root) %{_sysconfdir}
211%dir %attr(750,root,root) /var/log/zebra
212%dir %attr(755,root,root) /usr/share/info
213%{_infodir}/*info*
214%{_mandir}/man*/*
215%{_sbindir}/*
216%{_bindir}/*
217%config /etc/zebra/*
218%config /etc/rc.d/init.d/*
219%config(noreplace) /etc/pam.d/zebra
220%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
221
222%changelog
223* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
224- update to latest CVS
225- add Greg Troxel's md5 buffer copy/dup fix
226- add RIPv1 fix
227- add Frank's multicast flag fix
228
229* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
230- update to latest CVS
231- timestamped crypt_seqnum patch
232- oi->on_write_q fix
233
234* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
235- update to latest CVS
236- add vtysh 'write-config (integrated|daemon)' patch
237- always 'make rebuild' in vtysh/ to catch new commands
238
239* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
240- update to 0.93b
241
242* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
243- update to latest CVS
244- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
245
246* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
247- update to current CVS
248- add OSPF point to multipoint patch
249- add OSPF bugfixes
250- add BGP hash optimisation patch
251
252* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
253- update to 0.93-pre1 / CVS
254- add link state detection support
255- add generic PtP and RFC3021 support
256- various bug fixes
257
258* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
259- Fix bug #51336
260
261