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