]> git.proxmox.com Git - mirror_frr.git/blame - redhat/quagga.spec.in
2004-11-10 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
[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
7966b97c 109
110# For standard gcc verbosity, uncomment these lines:
111#CFLAGS="%{optflags} -Wall -Wsign-compare -Wpointer-arith"
112#CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
113
114# For ultra gcc verbosity, uncomment these lines also:
115#CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
116#CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
117#CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
118#CFLAGS="${CFLAGS} -Wpacked -Wpadded"
119
788cdc6d 120%configure \
54b25dca 121%if !%{with_shared}
122 --disable-shared \
123%endif
124%if %{with_ipv6}
788cdc6d 125 --enable-ipv6 \
126%endif
54b25dca 127%if %{with_snmp}
788cdc6d 128 --enable-snmp \
129%endif
54b25dca 130%if %{with_multipath}
131 --enable-multipath=%{with_multipath} \
788cdc6d 132%endif
54b25dca 133%if %{with_tcp_zebra}
788cdc6d 134 --enable-tcp-zebra \
135%endif
54b25dca 136%if %{with_nssa}
788cdc6d 137 --enable-nssa \
138%endif
54b25dca 139%if %{with_opaque_lsa}
788cdc6d 140 --enable-opaque-lsa \
141%endif
54b25dca 142%if %{with_ospf_te}
788cdc6d 143 --enable-ospf-te \
144%endif
54b25dca 145%if %{with_vtysh}
788cdc6d 146 --enable-vtysh \
147%endif
54b25dca 148%if %{with_ospfclient}
68980084 149 --enable-ospfclient=yes \
150%else
151 --enable-ospfclient=no\
152%endif
54b25dca 153%if %{with_ospfapi}
68980084 154 --enable-ospfapi=yes \
155%else
156 --enable-ospfapi=no \
157%endif
54b25dca 158%if %{with_irdp}
5b819262 159 --enable-irdp=yes \
160%else
161 --enable-irdp=no \
162%endif
54b25dca 163%if %{with_isisd}
164 --enable-isisd \
165%else
69f5d260 166 --disable-isisd \
54b25dca 167%endif
168%if %{with_pam}
edd7c245 169 --with-libpam \
788cdc6d 170%endif
6bd8fd3b 171%if %quagga_user
172 --enable-user=%quagga_user \
173 --enable-group=%quagga_user \
edd7c245 174%endif
175%if %vty_group
176 --enable-vty-group=%vty_group \
177%endif
edd7c245 178--enable-netlink
788cdc6d 179
180make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
181
182pushd doc
36002ae5 183makeinfo --no-split --html -o quagga.html quagga.texi
788cdc6d 184popd
185
186%install
187rm -rf $RPM_BUILD_ROOT
188
189install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
6bd8fd3b 190 $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
788cdc6d 191
192make install \
193 DESTDIR=$RPM_BUILD_ROOT
194
9a344b74 195# Remove this file, as it is uninstalled and causes errors when building on RH9
196rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
197
15d74e93 198# install etc sources
69f5d260 199for daemon in %{daemon_list} %{daemonv6_list} %{daemon_other} ; do
da29c6b0 200 if [ x"${daemon}" != x"" ] ; then
201 install %{zeb_rh_src}/${daemon}.init \
202 $RPM_BUILD_ROOT/etc/rc.d/init.d/${daemon}
203 fi
15d74e93 204done
205install -m644 %{zeb_rh_src}/quagga.pam \
206 $RPM_BUILD_ROOT/etc/pam.d/quagga
207install -m644 %{zeb_rh_src}/quagga.logrotate \
208 $RPM_BUILD_ROOT/etc/logrotate.d/quagga
209install -m644 %{zeb_rh_src}/quagga.sysconfig \
210 $RPM_BUILD_ROOT/etc/sysconfig/quagga
6bd8fd3b 211install -d -m750 $RPM_BUILD_ROOT/var/run/quagga
edd7c245 212
213%pre
214# add vty_group
215%if %vty_group
216groupadd -r %vty_group 2> /dev/null || :
217%endif
6bd8fd3b 218# add quagga user and group
219%if %quagga_user
15d74e93 220/usr/sbin/groupadd -g %quagga_gid quagga 2> /dev/null || :
221/usr/sbin/useradd -u %quagga_uid -g %quagga_gid \
222 -M -r -s /sbin/nologin -c "Quagga routing suite" \
6bd8fd3b 223 -d %_localstatedir %quagga_user 2> /dev/null || :
edd7c245 224%endif
788cdc6d 225
788cdc6d 226%post
30b9d89b 227# zebra_spec_add_service <service name> <port/proto> <comment>
788cdc6d 228# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
229
230zebra_spec_add_service ()
231{
232 # Add port /etc/services entry if it isn't already there
6b637e96 233 if [ -f /etc/services ] && \
234 ! %__sed -e 's/#.*$//' /etc/services | %__grep -wq $1 ; then
788cdc6d 235 echo "$1 $2 # $3" >> /etc/services
236 fi
237}
238
239zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
240zebra_spec_add_service zebra 2601/tcp "zebra vty"
241zebra_spec_add_service ripd 2602/tcp "RIPd vty"
54b25dca 242%if %{with_ipv6}
788cdc6d 243zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
d7ccae28 244%endif
788cdc6d 245zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
246zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
54b25dca 247%if %{with_ipv6}
788cdc6d 248zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
d7ccae28 249%endif
54b25dca 250%if %{with_ospfapi}
7021c425 251zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
252%endif
54b25dca 253%if %{with_isisd}
5a514b14 254zebra_spec_add_service isisd 2608/tcp "ISISd vty"
54b25dca 255%endif
788cdc6d 256
15d74e93 257for daemon in %daemon_list ; do
258 /sbin/chkconfig --add ${daemon}
259done
788cdc6d 260
6bd8fd3b 261/sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
788cdc6d 262
263# Create dummy files if they don't exist so basic functions can be used.
264if [ ! -e %{_sysconfdir}/zebra.conf ]; then
265 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
266 chmod 640 %{_sysconfdir}/zebra.conf
267fi
268if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
269 touch %{_sysconfdir}/vtysh.conf
270 chmod 640 %{_sysconfdir}/vtysh.conf
271fi
272
273%postun
274if [ "$1" -ge "1" ]; then
15d74e93 275 for daemon in %daemon_list ; do
276 /etc/rc.d/init.d/${daemon} condrestart >/dev/null 2>&1
277 done
788cdc6d 278fi
788cdc6d 279
280%preun
281if [ "$1" = "0" ]; then
15d74e93 282 for daemon in %daemon_list ; do
283 /etc/rc.d/init.d/${daemon} stop >/dev/null 2>&1
284 /sbin/chkconfig --del ${daemon}
285 done
286 /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
788cdc6d 287fi
288
289%clean
b5f310cb 290%if !%{keep_build}
291rm -rf $RPM_BUILD_ROOT
292%endif
788cdc6d 293
294%files
295%defattr(-,root,root)
448ed4a2 296%doc */*.sample* AUTHORS COPYING
6bd8fd3b 297%doc doc/quagga.html
30b9d89b 298%doc doc/mpls
8f754983 299%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
54b25dca 300%if %{quagga_user}
6bd8fd3b 301%dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
302%dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga
303%dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga
edd7c245 304%else
788cdc6d 305%dir %attr(750,root,root) %{_sysconfdir}
6bd8fd3b 306%dir %attr(750,root,root) /var/log/quagga
788cdc6d 307%dir %attr(755,root,root) /usr/share/info
6bd8fd3b 308%dir %attr(750,root,root) /var/run/quagga
edd7c245 309%endif
54b25dca 310%if %{vty_group}
6bd8fd3b 311%attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
edd7c245 312%endif
788cdc6d 313%{_infodir}/*info*
314%{_mandir}/man*/*
54b25dca 315%{_sbindir}/zebra
316%{_sbindir}/ospfd
317%{_sbindir}/ripd
318%{_sbindir}/bgpd
319%if %{with_ipv6}
320%{_sbindir}/ripngd
321%{_sbindir}/ospf6d
322%endif
323%if %{with_isisd}
324%{_sbindir}/isisd
325%endif
cfc1842b 326%dir %attr(755,root,root) %{_libdir}
28f79728 327%if %{with_shared}
2ff9e826 328%{_libdir}/lib*.so
329%{_libdir}/lib*.so.*
54b25dca 330%endif
331%if %{with_vtysh}
788cdc6d 332%{_bindir}/*
d7ccae28 333%endif
6bd8fd3b 334%config /etc/quagga/[!v]*
788cdc6d 335%config /etc/rc.d/init.d/*
15d74e93 336%config(noreplace) /etc/sysconfig/quagga
6bd8fd3b 337%config(noreplace) /etc/pam.d/quagga
788cdc6d 338%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
339
448ed4a2 340%files contrib
341%defattr(-,root,root)
342%doc tools
343
e0626854 344%files devel
345%defattr(-,root,root)
da29c6b0 346%if %{with_ospfclient}
347%{_sbindir}/ospfclient
348%endif
28f79728 349%{_libdir}/*.a
350%{_libdir}/*.la
cfc1842b 351%dir %attr(755,root,root) %{_includedir}/%{name}
28f79728 352%{_includedir}/%name/*.h
cfc1842b 353%dir %attr(755,root,root) %{_includedir}/%{name}/ospfd
28f79728 354%{_includedir}/%name/ospfd/*.h
54b25dca 355%if %{with_ospfapi}
cfc1842b 356%dir %attr(755,root,root) %{_includedir}/%{name}/ospfapi
28f79728 357%{_includedir}/%name/ospfapi/*.h
68980084 358%endif
e0626854 359
788cdc6d 360%changelog
15d74e93 361%changelog
36002ae5 362* Mon Nov 08 2004 Paul Jakma <paul@dishone.st>
363- Use makeinfo --html to generate quagga.html
364
0df63b52 365* Sun Nov 07 2004 Paul Jakma <paul@dishone.st>
366- Fix with_ipv6 set to 0 build
367
cfc1842b 368* Sat Oct 23 2004 Paul Jakma <paul@dishone.st>
369- Update to 0.97.2
370
371* Sat Oct 23 2004 Andrew J. Schorr <aschorr@telemetry-investments.com>
372- Make directories be owned by the packages concerned
373- Update logrotate scripts to use correct path to killall and use pid files
374
da29c6b0 375* Fri Oct 08 2004 Paul Jakma <paul@dishone.st>
376- Update to 0.97.0
377
54b25dca 378* Wed Sep 15 2004 Paul Jakma <paul@dishone.st>
379- build snmp support by default
380- build irdp support
381- build with shared libs
382- devel subpackage for archives and headers
383
00bc5603 384* Thu Jan 08 2004 Paul Jakma <paul@dishone.st>
385- updated sysconfig files to specify local dir
386- added ospf_dump.c crash quick fix patch
387- added ospfd persistent interface configuration patch
388
15d74e93 389* Tue Dec 30 2003 Paul Jakma <paul@dishone.st>
390- sync to CVS
391- integrate RH sysconfig patch to specify daemon options (RH)
392- default to have vty listen only to 127.1 (RH)
393- add user with fixed UID/GID (RH)
394- create user with shell /sbin/nologin rather than /bin/false (RH)
395- stop daemons on uninstall (RH)
396- delete info file on %preun, not %postun to avoid deletion on upgrade. (RH)
397- isisd added
398- cleanup tasks carried out for every daemon
399
406f7000 400* Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
401- Fix -devel package to include all files
402- Sync to 0.96.4
403
6bd8fd3b 404* Tue Aug 12 2003 Paul Jakma <paul@dishone.st>
405- Renamed to Quagga
406- Sync to Quagga release 0.96
407
edd7c245 408* Tue Mar 20 2003 Paul Jakma <paul@dishone.st>
409- zebra privileges support
410
e0626854 411* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
412- Fix mem leak in 'show thread cpu'
413- Ralph Keller's OSPF-API
414- Amir: Fix configure.ac for net-snmp
415
448ed4a2 416* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
417- ospfd IOS prefix to interface matching for 'network' statement
418- temporary fix for PtP and IPv6
419- sync to zebra.org CVS
420
8f754983 421* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
422- update to latest cvs
423- Yon's "show thread cpu" patch - 17217
424- walk up tree - 17218
425- ospfd NSSA fixes - 16681
426- ospfd nsm fixes - 16824
427- ospfd OLSA fixes and new feature - 16823
428- KAME and ifindex fixes - 16525
429- spec file changes to allow redhat files to be in tree
430
d7ccae28 431* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
432- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
433- Fixed up some build requirements (patch)
434- Added conditional build requirements for vtysh / snmp
435- Added conditional to %files for %_bindir depending on vtysh
436
788cdc6d 437* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
438- update to latest CVS
439- add Greg Troxel's md5 buffer copy/dup fix
440- add RIPv1 fix
441- add Frank's multicast flag fix
442
443* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
444- update to latest CVS
445- timestamped crypt_seqnum patch
446- oi->on_write_q fix
447
448* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
449- update to latest CVS
450- add vtysh 'write-config (integrated|daemon)' patch
451- always 'make rebuild' in vtysh/ to catch new commands
452
453* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
454- update to 0.93b
455
456* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
457- update to latest CVS
458- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
459
460* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
461- update to current CVS
462- add OSPF point to multipoint patch
463- add OSPF bugfixes
464- add BGP hash optimisation patch
465
466* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
467- update to 0.93-pre1 / CVS
468- add link state detection support
469- add generic PtP and RFC3021 support
470- various bug fixes
471
472* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
473- Fix bug #51336
474
475