/[packages]/updates/1/quagga/current/SPECS/quagga.spec
ViewVC logotype

Contents of /updates/1/quagga/current/SPECS/quagga.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 232974 - (show annotations) (download)
Mon Apr 23 15:19:42 2012 UTC (11 years, 11 months ago) by luigiwalser
File size: 10700 byte(s)
fix CVE-2012-0249, CVE-2012-0250, CVE-2012-0255 (from upstream)
1 %define _disable_ld_no_undefined 1
2
3 # configure options
4 %define with_snmp 0
5 %define with_vtysh 1
6 %define with_ospf_te 1
7 %define with_nssa 1
8 %define with_opaque_lsa 1
9 %define with_tcp_zebra 0
10 %define with_vtysh 1
11 %define with_pam 1
12 %define with_ipv6 1
13 %define with_ospfclient 1
14 %define with_ospfapi 1
15 %define with_irdp 1
16 %define with_rtadv 1
17 %define with_isisd 1
18 %define with_multipath 64
19 %define quagga_user quagga
20 %define vty_group quaggavt
21
22 # path defines
23 %define zeb_src %{_builddir}/%{name}-%{version}
24 %define zeb_rh_src %{zeb_src}/redhat
25 %define zeb_docs %{zeb_src}/doc
26
27 %define major 0
28 %define libname %mklibname %{name} %{major}
29 %define develname %mklibname %{name} -d
30
31 Summary: Routing daemon
32 Name: quagga
33 Version: 0.99.18
34 %define subrel 2
35 Release: %mkrel 1
36 License: GPL
37 Group: System/Servers
38 URL: http://www.quagga.net
39 Source0: http://www.quagga.net/download/%{name}-%{version}.tar.gz
40 Source1: http://www.quagga.net/download/%{name}-%{version}.tar.gz.asc
41 # patch to ignore netlik message not coing from kernel
42 # not sure if this is still needed
43 # likely related to http://osvdb.org/show/osvdb/55382
44 # to be sent upstream
45 Patch0: quagga-0.99.11-netlink.patch
46 # change initscript to not start them by default
47 Patch1: quagga-0.96.5-nostart.patch
48 # add libpcap in Makefile.am to link with it
49 # to be sent upstream
50 Patch3: quagga-0.99.10-libcap.diff
51 # various format string errors, to send upstream
52 Patch4: quagga-0.99.18-fix_format_string.diff
53 # patch from upstream to fix opaque lsa support :
54 # http://code.quagga.net/?p=quagga.git;a=commit;h=d71ea65270408a45e4bec036671ec73b24b994b4
55 Patch5: fix_compile_opaque_lsa.diff
56 Patch6: quagga-fix_CVE-2011-3323.diff
57 Patch7: quagga-fix_CVE-2011-3324.diff
58 Patch8: quagga-fix_CVE-2011-3325.diff
59 Patch9: quagga-fix_CVE-2011-3325_2.diff
60 # fix a regression in the 2 previous patchs
61 Patch10: quagga-fix_CVE-2011-3325_3.diff
62 Patch11: quagga-fix_CVE-2011-3326.diff
63 Patch12: quagga-fix_CVE-2011-3327.diff
64 Patch13: quagga-fix_CVE-2012-0249-CVE-2012-0250.diff
65 Patch14: quagga-fix_CVE-2012-0255.diff
66 BuildRequires: texinfo
67 BuildRequires: tetex-texi2html
68 BuildRequires: tetex
69 BuildRequires: pam-devel
70 BuildRequires: libpcap-devel
71 BuildRequires: chrpath >= 0.12
72 BuildRequires: automake
73 BuildRequires: autoconf2.5
74 %if %{with_snmp}
75 Requires: net-snmp-mibs
76 BuildRequires: net-snmp-devel
77 BuildRequires: openssl-devel
78 %endif
79 %if %{with_vtysh}
80 BuildRequires: readline-devel ncurses-devel
81 %endif
82 Requires(pre): ncurses readline pam
83 Requires(preun): info-install
84 Requires(post): info-install
85 Requires: %{libname} = %{version}
86 BuildRoot: %{_tmppath}/%{name}-%{version}-root
87
88 %description
89 Quagga is a free software that manages TCP/IP based routing
90 protocol. It takes multi-server and multi-thread approach to resolve
91 the current complexity of the Internet.
92
93 Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
94
95 Quagga is intended to be used as a Route Server and a Route Reflector. It is
96 not a toolkit, it provides full routing power under a new architecture.
97 Quagga by design has a process for each protocol.
98
99 Quagga is a fork of GNU Zebra.
100
101 %package contrib
102 Summary: Tools for quagga
103 Group: System/Servers
104
105 %description contrib
106 Contributed/3rd party tools which may be of use with quagga.
107
108 %package -n %{libname}
109 Summary: Shared %{name} library
110 Group: System/Libraries
111
112 %description -n %{libname}
113 This package provides the shared %{name} library.
114
115 %package -n %{develname}
116 Summary: Header and object files for quagga development
117 Group: Development/C
118 Requires: %{libname} = %{version}
119 Provides: %{name}-devel = %{version}
120 Provides: lib%{name}-devel = %{version}
121 Obsoletes: %{mklibname quagga 0 -d}
122
123 %description -n %{develname}
124 The quagga-devel package contains the header and object files necessary for
125 developing OSPF-API and quagga applications.
126
127 %prep
128 %setup -q
129 %patch0 -p1 -b .netlink
130 %patch1 -p1 -b .nostart
131 %patch3 -p0 -b .libcap
132 %patch4 -p0
133 %patch5 -p1
134 %patch6 -p1
135 %patch7 -p1
136 %patch8 -p1
137 %patch9 -p1
138 %patch10 -p1
139 %patch11 -p1
140 %patch12 -p1
141 %patch13 -p1
142 %patch14 -p1
143 %build
144 export CFLAGS="%{optflags} -fPIC"
145
146 %serverbuild
147 autoreconf -fi
148 %configure2_5x \
149 --sysconfdir=%{_sysconfdir}/quagga \
150 --localstatedir=/var/run/quagga \
151 %if %{with_ipv6}
152 --enable-ipv6 \
153 %endif
154 %if %{with_snmp}
155 --enable-snmp \
156 %endif
157 %if %{with_multipath}
158 --enable-multipath=%{with_multipath} \
159 %endif
160 %if %{with_tcp_zebra}
161 --enable-tcp-zebra \
162 %endif
163 %if %{with_nssa}
164 --enable-nssa \
165 %endif
166 %if %{with_opaque_lsa}
167 --enable-opaque-lsa \
168 %endif
169 %if %{with_ospf_te}
170 --enable-ospf-te \
171 %endif
172 %if %{with_vtysh}
173 --enable-vtysh \
174 %endif
175 %if %{with_ospfclient }
176 --enable-ospfclient=yes \
177 %else
178 --enable-ospfclient=no\
179 %endif
180 %if %{with_ospfapi}
181 --enable-ospfapi=yes \
182 %else
183 --enable-ospfapi=no \
184 %endif
185 %if %{with_irdp}
186 --enable-irdp=yes \
187 %else
188 --enable-irdp=no \
189 %endif
190 %if %{with_isisd}
191 --enable-isisd \
192 %else
193 --disable-isisd \
194 %endif
195 %if %{with_pam}
196 --with-libpam \
197 %endif
198 %if %{quagga_user}
199 --enable-user=%{quagga_user} \
200 --enable-group=%{quagga_user} \
201 %endif
202 %if %{vty_group}
203 --enable-vty-group=%{vty_group} \
204 %endif
205 %if %{with_rtadv}
206 --with-rtadv \
207 %endif
208 --with-cflags="%{optflags}" \
209 --enable-netlink
210
211 make MAKEINFO="makeinfo --no-split"
212
213 pushd doc
214 texi2html quagga.texi
215 popd
216
217 %install
218 rm -rf %{buildroot}
219
220 # don't fiddle with the initscript!
221 export DONT_GPRINTIFY=1
222
223 install -d %{buildroot}%{_initrddir}
224 install -d %{buildroot}%{_sysconfdir}/sysconfig
225 install -d %{buildroot}%{_sysconfdir}/logrotate.d
226 install -d %{buildroot}%{_sysconfdir}/pam.d
227 install -d %{buildroot}/var/log/quagga
228 install -d %{buildroot}/var/run/quagga
229 install -d %{buildroot}%{_infodir}
230
231 %makeinstall_std
232
233 # Remove this file, as it is uninstalled and causes errors when building on RH9
234 rm -rf %{buildroot}/usr/share/info/dir
235
236 install -m755 %{zeb_rh_src}/zebra.init %{buildroot}%{_initrddir}/zebra
237 install -m755 %{zeb_rh_src}/bgpd.init %{buildroot}%{_initrddir}/bgpd
238 %if %{with_ipv6}
239 install -m755 %{zeb_rh_src}/ospf6d.init %{buildroot}%{_initrddir}/ospf6d
240 install -m755 %{zeb_rh_src}/ripngd.init %{buildroot}%{_initrddir}/ripngd
241 %endif
242 install -m755 %{zeb_rh_src}/ospfd.init %{buildroot}%{_initrddir}/ospfd
243 install -m755 %{zeb_rh_src}/ripd.init %{buildroot}%{_initrddir}/ripd
244 install -m755 %{zeb_rh_src}/watchquagga.init %{buildroot}%{_initrddir}/watchquagga
245 %if %{with_isisd}
246 install -m755 %{zeb_rh_src}/isisd.init %{buildroot}%{_initrddir}/isisd
247 %endif
248 install -m644 %{zeb_rh_src}/quagga.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/quagga
249 install -m644 %{zeb_rh_src}/quagga.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/quagga
250
251 # fix conditional pam config file
252 install -m644 %{zeb_rh_src}/quagga.pam %{buildroot}%{_sysconfdir}/pam.d/quagga
253
254 # nuke rpath
255 chrpath -d %{buildroot}%{_bindir}/*
256 chrpath -d %{buildroot}%{_sbindir}/*
257
258 %pre
259 # add vty_group
260 %if %{vty_group}
261 %_pre_groupadd %{vty_group}
262 %endif
263 # add quagga user and group
264 %if %{quagga_user}
265 %_pre_useradd %{quagga_user} %{_localstatedir}/lib /sbin/nologin
266 %endif
267
268 %post
269 %_post_service zebra
270 %_post_service ripd
271 %if %{with_ipv6}
272 %_post_service ospf6d
273 %_post_service ripngd
274 %endif
275 %_post_service ospfd
276 %_post_service bgpd
277 %_post_service watchquagga
278
279 %_install_info %{name}.info
280
281 # Create dummy files if they don't exist so basic functions can be used.
282 if [ ! -e %{_sysconfdir}/quagga/zebra.conf ]; then
283 echo "hostname `hostname`" > %{_sysconfdir}/quagga/zebra.conf
284 %if %{quagga_user}
285 chown %{quagga_user}:%{quagga_user} %{_sysconfdir}/quagga/zebra.conf
286 %endif
287 chmod 640 %{_sysconfdir}/quagga/zebra.conf
288 fi
289 if [ ! -e %{_sysconfdir}/quagga/vtysh.conf ]; then
290 touch %{_sysconfdir}/quagga/vtysh.conf
291 chmod 640 %{_sysconfdir}/quagga/vtysh.conf
292 fi
293
294 %preun
295 %_preun_service zebra
296 %_preun_service ripd
297 %if %{with_ipv6}
298 %_preun_service ripngd
299 %endif
300 %_preun_service ospfd
301 %if %{with_ipv6}
302 %_preun_service ospf6d
303 %endif
304 %_preun_service bgpd
305 %_preun_service watchquagga
306
307 %_remove_install_info %{name}.info
308
309 %postun
310 %if %{quagga_user}
311 %_postun_userdel %{quagga_user}
312 %endif
313
314 %clean
315 rm -rf %{buildroot}
316
317 %files
318 %defattr(-,root,root)
319 %doc */*.sample* AUTHORS COPYING doc/quagga.html doc/mpls
320 %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
321 #
322 %if %{quagga_user}
323 %dir %attr(0751,%{quagga_user},%{quagga_user}) %{_sysconfdir}/quagga
324 %dir %attr(0750,%{quagga_user},%{quagga_user}) /var/log/quagga
325 %dir %attr(0751,%{quagga_user},%{quagga_user}) /var/run/quagga
326 %else
327 #
328 %dir %attr(0750,root,root) %{_sysconfdir}/quagga
329 %dir %attr(0750,root,root) /var/log/quagga
330 %dir %attr(0750,root,root) /var/run/quagga
331 %endif
332 #
333 %if %{vty_group}
334 %attr(0640,%{quagga_user},%{vty_group}) %config(noreplace) %{_sysconfdir}/quagga/vtysh.conf*
335 %endif
336 #
337 %config(noreplace) %{_sysconfdir}/pam.d/quagga
338 %attr(0644,root,root) %config(noreplace) %{_sysconfdir}/logrotate.d/*
339 %config(noreplace) %{_sysconfdir}/sysconfig/quagga
340 %config(noreplace) %{_sysconfdir}/quagga/bgpd.conf*
341 %config(noreplace) %{_sysconfdir}/quagga/ospf6d.conf*
342 %config(noreplace) %{_sysconfdir}/quagga/ospfd.conf*
343 %config(noreplace) %{_sysconfdir}/quagga/ripd.conf*
344 %config(noreplace) %{_sysconfdir}/quagga/ripngd.conf*
345 %config(noreplace) %{_sysconfdir}/quagga/zebra.conf*
346 #
347 %attr(0755,root,root) %{_initrddir}/bgpd
348 %attr(0755,root,root) %{_initrddir}/ospf6d
349 %attr(0755,root,root) %{_initrddir}/ospfd
350 %attr(0755,root,root) %{_initrddir}/ripd
351 %attr(0755,root,root) %{_initrddir}/ripngd
352 %attr(0755,root,root) %{_initrddir}/watchquagga
353 %attr(0755,root,root) %{_initrddir}/zebra
354 #
355 %{_sbindir}/bgpd
356 %{_sbindir}/ospf6d
357 %{_sbindir}/ospfclient
358 %{_sbindir}/ospfd
359 %{_sbindir}/ripd
360 %{_sbindir}/ripngd
361 %{_sbindir}/watchquagga
362 %{_sbindir}/zebra
363 #
364 %if %{with_vtysh}
365 %{_bindir}/vtysh
366 %attr(0644,root,root) %{_mandir}/man1/vtysh.1*
367 %endif
368 #
369 %if %{with_isisd}
370 %attr(0755,root,root) %{_initrddir}/isisd
371 %config(noreplace) %{_sysconfdir}/quagga/isisd.conf*
372 %{_sbindir}/isisd
373 %attr(0644,root,root) %{_mandir}/man8/isisd.8*
374 %endif
375 #
376 %attr(0644,root,root) %{_mandir}/man8/bgpd.8*
377 %attr(0644,root,root) %{_mandir}/man8/ospf6d.8*
378 %attr(0644,root,root) %{_mandir}/man8/ospfd.8*
379 %attr(0644,root,root) %{_mandir}/man8/ripd.8*
380 %attr(0644,root,root) %{_mandir}/man8/ripngd.8*
381 %attr(0644,root,root) %{_mandir}/man8/zebra.8*
382 %{_infodir}/*info*
383
384 %files contrib
385 %defattr(-,root,root)
386 %doc tools
387
388 %files -n %{libname}
389 %defattr(-,root,root)
390 %{_libdir}/*.so.*
391
392 %files -n %{develname}
393 %defattr(-,root,root)
394 %{_libdir}/*.so
395 %{_libdir}/*.a
396 %{_libdir}/*.la
397 %dir %{_includedir}/quagga
398 %{_includedir}/quagga/*.h
399 %dir %{_includedir}/quagga/ospfd/*
400 #
401 %if %{with_ospfapi}
402 %dir %{_includedir}/quagga/ospfapi/*
403 %endif
404
405

  ViewVC Help
Powered by ViewVC 1.1.30