]> git.proxmox.com Git - mirror_frr.git/blob - redhat/quagga.spec.in
- update with andrew's modifications
[mirror_frr.git] / redhat / quagga.spec.in
1 # configure options
2 %define with_snmp 1
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
11 %define with_ospfclient 1
12 %define with_ospfapi 1
13 %define with_irdp 1
14 %define with_isisd 0
15 %define with_shared 1
16 %define with_multipath 64
17 %define quagga_user quagga
18 %define vty_group quaggavty
19
20 # path defines
21 %define _sysconfdir /etc/quagga
22 %define zeb_src %{_builddir}/%{name}-%{version}
23 %define zeb_rh_src %{zeb_src}/redhat
24 %define zeb_docs %{zeb_src}/doc
25
26 # defines for configure
27 %define _libexecdir %{_exec_prefix}/libexec/quagga
28 %define _libdir %{_exec_prefix}/%{_lib}/quagga
29 %define _includedir %{_prefix}/include
30 %define _localstatedir /var/run/quagga
31
32 # misc internal defines
33 %define quagga_uid 92
34 %define quagga_gid 92
35 %define daemon_list zebra ripd ospfd bgpd
36 %if %{with_ipv6}
37 %define daemonv6_list %{daemon_list} ripngd ospf6d
38 %endif
39 %if %{with_isisd}
40 %define daemon_other isisd
41 %else
42 %define daemon_other ""
43 %endif
44
45 # allow build dir to be kept
46 %define keep_build 0
47
48 Summary: Routing daemon
49 Name: quagga
50 Version: @VERSION@
51 Release: @CONFDATE@01
52 License: GPL
53 Group: System Environment/Daemons
54 Source0: http://www.quagga.net/snapshots/cvs/%{name}-%{version}.tar.gz
55 URL: http://www.quagga.net
56 %if %{with_snmp}
57 BuildRequires: net-snmp-devel
58 Prereq: net-snmp
59 %endif
60 %if %{with_vtysh}
61 BuildRequires: readline readline-devel ncurses ncurses-devel
62 Prereq: readline ncurses
63 %endif
64 BuildRequires: texinfo tetex autoconf pam-devel patch libcap-devel
65 # Initscripts > 5.60 is required for IPv6 support
66 Prereq: initscripts >= 5.60
67 Prereq: ncurses readline pam
68 Prereq: /sbin/install-info
69 Provides: routingdaemon
70 BuildRoot: %{_tmppath}/%{name}-%{version}-root
71 Obsoletes: bird gated mrt zebra
72
73 %description
74 Quagga is a free software that manages TCP/IP based routing
75 protocol. It takes multi-server and multi-thread approach to resolve
76 the current complexity of the Internet.
77
78 Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
79
80 Quagga is intended to be used as a Route Server and a Route Reflector. It is
81 not a toolkit, it provides full routing power under a new architecture.
82 Quagga by design has a process for each protocol.
83
84 Quagga is a fork of GNU Zebra.
85
86 %package contrib
87 Summary: contrib tools for quagga
88 Group: System Environment/Daemons
89
90 %description contrib
91 Contributed/3rd party tools which may be of use with quagga.
92
93 %package devel
94 Summary: Header and object files for quagga development
95 Group: System Environment/Daemons
96
97 %description devel
98 The quagga-devel package contains the header and object files neccessary for
99 developing OSPF-API and quagga applications.
100
101 %prep
102 %setup -q
103
104 %build
105 %configure \
106 %if !%{with_shared}
107 --disable-shared \
108 %endif
109 %if %{with_ipv6}
110 --enable-ipv6 \
111 %endif
112 %if %{with_snmp}
113 --enable-snmp \
114 %endif
115 %if %{with_multipath}
116 --enable-multipath=%{with_multipath} \
117 %endif
118 %if %{with_tcp_zebra}
119 --enable-tcp-zebra \
120 %endif
121 %if %{with_nssa}
122 --enable-nssa \
123 %endif
124 %if %{with_opaque_lsa}
125 --enable-opaque-lsa \
126 %endif
127 %if %{with_ospf_te}
128 --enable-ospf-te \
129 %endif
130 %if %{with_vtysh}
131 --enable-vtysh \
132 %endif
133 %if %{with_ospfclient}
134 --enable-ospfclient=yes \
135 %else
136 --enable-ospfclient=no\
137 %endif
138 %if %{with_ospfapi}
139 --enable-ospfapi=yes \
140 %else
141 --enable-ospfapi=no \
142 %endif
143 %if %{with_irdp}
144 --enable-irdp=yes \
145 %else
146 --enable-irdp=no \
147 %endif
148 %if %{with_isisd}
149 --enable-isisd \
150 %else
151 --disable-isisd \
152 %endif
153 %if %{with_pam}
154 --with-libpam \
155 %endif
156 %if %quagga_user
157 --enable-user=%quagga_user \
158 --enable-group=%quagga_user \
159 %endif
160 %if %vty_group
161 --enable-vty-group=%vty_group \
162 %endif
163 --enable-netlink
164
165 make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
166
167 pushd doc
168 texi2html quagga.texi
169 popd
170
171 %install
172 rm -rf $RPM_BUILD_ROOT
173
174 install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
175 $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
176
177 make install \
178 DESTDIR=$RPM_BUILD_ROOT
179
180 # Remove this file, as it is uninstalled and causes errors when building on RH9
181 rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
182
183 # install etc sources
184 for daemon in %{daemon_list} %{daemonv6_list} %{daemon_other} ; do
185 if [ x"${daemon}" != x"" ] ; then
186 install %{zeb_rh_src}/${daemon}.init \
187 $RPM_BUILD_ROOT/etc/rc.d/init.d/${daemon}
188 fi
189 done
190 install -m644 %{zeb_rh_src}/quagga.pam \
191 $RPM_BUILD_ROOT/etc/pam.d/quagga
192 install -m644 %{zeb_rh_src}/quagga.logrotate \
193 $RPM_BUILD_ROOT/etc/logrotate.d/quagga
194 install -m644 %{zeb_rh_src}/quagga.sysconfig \
195 $RPM_BUILD_ROOT/etc/sysconfig/quagga
196 install -d -m750 $RPM_BUILD_ROOT/var/run/quagga
197
198 %pre
199 # add vty_group
200 %if %vty_group
201 groupadd -r %vty_group 2> /dev/null || :
202 %endif
203 # add quagga user and group
204 %if %quagga_user
205 /usr/sbin/groupadd -g %quagga_gid quagga 2> /dev/null || :
206 /usr/sbin/useradd -u %quagga_uid -g %quagga_gid \
207 -M -r -s /sbin/nologin -c "Quagga routing suite" \
208 -d %_localstatedir %quagga_user 2> /dev/null || :
209 %endif
210
211 %post
212 # zebra_spec_add_service <service name> <port/proto> <comment>
213 # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
214
215 zebra_spec_add_service ()
216 {
217 # Add port /etc/services entry if it isn't already there
218 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
219 echo "$1 $2 # $3" >> /etc/services
220 fi
221 }
222
223 zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
224 zebra_spec_add_service zebra 2601/tcp "zebra vty"
225 zebra_spec_add_service ripd 2602/tcp "RIPd vty"
226 %if %{with_ipv6}
227 zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
228 %endif
229 zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
230 zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
231 %if %{with_ipv6}
232 zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
233 %endif
234 %if %{with_ospfapi}
235 zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
236 %endif
237 %if %{with_isisd}
238 zebra_spec_add_service isisd 2608/tcp "ISISd vty"
239 %endif
240
241 for daemon in %daemon_list ; do
242 /sbin/chkconfig --add ${daemon}
243 done
244
245 /sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
246
247 # Create dummy files if they don't exist so basic functions can be used.
248 if [ ! -e %{_sysconfdir}/zebra.conf ]; then
249 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
250 chmod 640 %{_sysconfdir}/zebra.conf
251 fi
252 if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
253 touch %{_sysconfdir}/vtysh.conf
254 chmod 640 %{_sysconfdir}/vtysh.conf
255 fi
256
257 %postun
258 if [ "$1" -ge "1" ]; then
259 for daemon in %daemon_list ; do
260 /etc/rc.d/init.d/${daemon} condrestart >/dev/null 2>&1
261 done
262 fi
263
264 %preun
265 if [ "$1" = "0" ]; then
266 for daemon in %daemon_list ; do
267 /etc/rc.d/init.d/${daemon} stop >/dev/null 2>&1
268 /sbin/chkconfig --del ${daemon}
269 done
270 /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
271 fi
272
273 %clean
274 %if !%{keep_build}
275 rm -rf $RPM_BUILD_ROOT
276 %endif
277
278 %files
279 %defattr(-,root,root)
280 %doc */*.sample* AUTHORS COPYING
281 %doc doc/quagga.html
282 %doc doc/mpls
283 %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
284 %if %{quagga_user}
285 %dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
286 %dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga
287 %dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga
288 %else
289 %dir %attr(750,root,root) %{_sysconfdir}
290 %dir %attr(750,root,root) /var/log/quagga
291 %dir %attr(755,root,root) /usr/share/info
292 %dir %attr(750,root,root) /var/run/quagga
293 %endif
294 %if %{vty_group}
295 %attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
296 %endif
297 %{_infodir}/*info*
298 %{_mandir}/man*/*
299 %{_sbindir}/zebra
300 %{_sbindir}/ospfd
301 %{_sbindir}/ripd
302 %{_sbindir}/bgpd
303 %if %{with_ipv6}
304 %{_sbindir}/ripngd
305 %{_sbindir}/ospf6d
306 %endif
307 %if %{with_isisd}
308 %{_sbindir}/isisd
309 %endif
310 %if %{with_shared}
311 %dir %attr(755,root,root) %{_libdir}
312 %{_libdir}/lib*.so
313 %{_libdir}/lib*.so.*
314 %endif
315 %if %{with_vtysh}
316 %{_bindir}/*
317 %endif
318 %config /etc/quagga/[!v]*
319 %config /etc/rc.d/init.d/*
320 %config(noreplace) /etc/sysconfig/quagga
321 %config(noreplace) /etc/pam.d/quagga
322 %config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
323
324 %files contrib
325 %defattr(-,root,root)
326 %doc tools
327
328 %files devel
329 %defattr(-,root,root)
330 %if %{with_ospfclient}
331 %{_sbindir}/ospfclient
332 %endif
333 %dir %{_libdir}/*.a
334 %dir %{_libdir}/*.la
335 %dir %attr(755,root,root) %{_includedir}/%{name}
336 %dir %{_includedir}/%name/*.h
337 %dir %attr(755,root,root) %{_includedir}/%{name}/ospfd
338 %dir %{_includedir}/%name/ospfd/*.h
339 %if %{with_ospfapi}
340 %dir %attr(755,root,root) %{_includedir}/%{name}/ospfapi
341 %dir %{_includedir}/%name/ospfapi/*.h
342 %endif
343
344 %changelog
345 %changelog
346 * Sat Oct 23 2004 Paul Jakma <paul@dishone.st>
347 - Update to 0.97.2
348
349 * Sat Oct 23 2004 Andrew J. Schorr <aschorr@telemetry-investments.com>
350 - Make directories be owned by the packages concerned
351 - Update logrotate scripts to use correct path to killall and use pid files
352
353 * Fri Oct 08 2004 Paul Jakma <paul@dishone.st>
354 - Update to 0.97.0
355
356 * Wed Sep 15 2004 Paul Jakma <paul@dishone.st>
357 - build snmp support by default
358 - build irdp support
359 - build with shared libs
360 - devel subpackage for archives and headers
361
362 * Thu Jan 08 2004 Paul Jakma <paul@dishone.st>
363 - updated sysconfig files to specify local dir
364 - added ospf_dump.c crash quick fix patch
365 - added ospfd persistent interface configuration patch
366
367 * Tue Dec 30 2003 Paul Jakma <paul@dishone.st>
368 - sync to CVS
369 - integrate RH sysconfig patch to specify daemon options (RH)
370 - default to have vty listen only to 127.1 (RH)
371 - add user with fixed UID/GID (RH)
372 - create user with shell /sbin/nologin rather than /bin/false (RH)
373 - stop daemons on uninstall (RH)
374 - delete info file on %preun, not %postun to avoid deletion on upgrade. (RH)
375 - isisd added
376 - cleanup tasks carried out for every daemon
377
378 * Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
379 - Fix -devel package to include all files
380 - Sync to 0.96.4
381
382 * Tue Aug 12 2003 Paul Jakma <paul@dishone.st>
383 - Renamed to Quagga
384 - Sync to Quagga release 0.96
385
386 * Tue Mar 20 2003 Paul Jakma <paul@dishone.st>
387 - zebra privileges support
388
389 * Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
390 - Fix mem leak in 'show thread cpu'
391 - Ralph Keller's OSPF-API
392 - Amir: Fix configure.ac for net-snmp
393
394 * Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
395 - ospfd IOS prefix to interface matching for 'network' statement
396 - temporary fix for PtP and IPv6
397 - sync to zebra.org CVS
398
399 * Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
400 - update to latest cvs
401 - Yon's "show thread cpu" patch - 17217
402 - walk up tree - 17218
403 - ospfd NSSA fixes - 16681
404 - ospfd nsm fixes - 16824
405 - ospfd OLSA fixes and new feature - 16823
406 - KAME and ifindex fixes - 16525
407 - spec file changes to allow redhat files to be in tree
408
409 * Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
410 - Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
411 - Fixed up some build requirements (patch)
412 - Added conditional build requirements for vtysh / snmp
413 - Added conditional to %files for %_bindir depending on vtysh
414
415 * Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
416 - update to latest CVS
417 - add Greg Troxel's md5 buffer copy/dup fix
418 - add RIPv1 fix
419 - add Frank's multicast flag fix
420
421 * Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
422 - update to latest CVS
423 - timestamped crypt_seqnum patch
424 - oi->on_write_q fix
425
426 * Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
427 - update to latest CVS
428 - add vtysh 'write-config (integrated|daemon)' patch
429 - always 'make rebuild' in vtysh/ to catch new commands
430
431 * Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
432 - update to 0.93b
433
434 * Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
435 - update to latest CVS
436 - add "/sbin/ip route flush proto zebra" to zebra RH init on startup
437
438 * Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
439 - update to current CVS
440 - add OSPF point to multipoint patch
441 - add OSPF bugfixes
442 - add BGP hash optimisation patch
443
444 * Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
445 - update to 0.93-pre1 / CVS
446 - add link state detection support
447 - add generic PtP and RFC3021 support
448 - various bug fixes
449
450 * Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
451 - Fix bug #51336
452
453 * Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
454 - Use generic initscript strings instead of initscript specific
455 ( "Starting foo: " -> "Starting $prog:" )
456
457 * Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
458 - Bump the release when rebuilding into the dist.
459
460 * Tue Feb 6 2001 Tim Powers <timp@redhat.com>
461 - built for Powertools
462
463 * Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
464 - Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
465 - Update to 0.91a
466 - Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
467 - Should be quite Red Hat'isque now.