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