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