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