3 # Some can be overriden on rpmbuild commandline with:
4 # rpmbuild --define 'variable value'
7 ####################### Quagga configure options #########################
9 %{!?with_snmp: %define with_snmp 1 }
10 %{!?with_vtysh: %define with_vtysh 1 }
11 %{!?with_ospf_te: %define with_ospf_te 1 }
12 %{!?with_nssa: %define with_nssa 1 }
13 %{!?with_opaque_lsa: %define with_opaque_lsa 1 }
14 %{!?with_tcp_zebra: %define with_tcp_zebra 0 }
15 %{!?with_vtysh: %define with_vtysh 1 }
16 %{!?with_pam: %define with_pam 1 }
17 %{!?with_ipv6: %define with_ipv6 1 }
18 %{!?with_ospfclient: %define with_ospfclient 1 }
19 %{!?with_ospfapi: %define with_ospfapi 1 }
20 %{!?with_irdp: %define with_irdp 1 }
21 %{!?with_rtadv: %define with_rtadv 1 }
22 %{!?with_isisd: %define with_isisd 1 }
23 %{!?with_shared: %define with_shared 1 }
24 %{!?with_multipath: %define with_multipath 64 }
25 %{!?quagga_user: %define quagga_user quagga }
26 %{!?vty_group: %define vty_group quaggavty }
29 %define _sysconfdir
/etc
/quagga
30 %define zeb_src
%{_builddir}/%{name}-%{version}
31 %define zeb_rh_src
%{zeb_src}/redhat
32 %define zeb_docs
%{zeb_src}/doc
34 # defines for configure
35 %define _libexecdir
%{_exec_prefix}/libexec
/quagga
36 %define _libdir
%{_exec_prefix}/%{_lib}/quagga
37 %define _includedir
%{_prefix}/include
38 %define _localstatedir
/var
/run
/quagga
39 ############################################################################
41 ####################### distro specific tweaks #############################
42 # default distro. Override with rpmbuild -D "dist XXX"
43 %{expand: %%define default_dist %(rpm -q --qf 'fc%%{VERSION}' fedora-release | grep -v 'not installed')}
44 %{!?dist: %define dist %{default_dist}}
46 # as distros change packages we depend on, our Requires have to change, sadly.
47 %define quagga_buildreqs texi2html texinfo tetex autoconf pam
-devel
48 %define quagga_buildreqs
%{quagga_buildreqs} patch libcap
-devel
50 # FC4 and 5 split texi2html out of tetex package.
51 %if "
%dist"
!= "fc2" || "
%dist"
!= "fc3"
52 %define quagga_buildreqs
%{quagga_buildreqs} texi2html
55 # pam_stack is deprecated in FC5
56 # default to pam_stack, default should be changed later.
57 %if "
%dist"
== "fc4" || "
%dist"
== "fc3"
58 %define quagga_pam_source quagga.pam.stack
60 %define quagga_pam_source quagga.pam
62 ############################################################################
65 # misc internal defines
66 %{!?quagga_uid: %define quagga_uid 92 }
67 %{!?quagga_gid: %define quagga_gid 92 }
68 %define daemon_list zebra ripd ospfd bgpd
71 %define daemonv6_list ripngd ospf6d
73 %define daemonv6_list ""
77 %define daemon_other isisd
79 %define daemon_other ""
82 %define all_daemons
%{daemon_list} %{daemonv6_list} %{daemon_other} watchquagga
84 # allow build dir to be kept
85 %{!?keep_build: %define keep_build 0 }
87 #release sub-revision (the two digits after the CONFDATE)
88 %{!?release_rev: %define release_rev 01 }
90 Summary: Routing daemon
93 Release: @CONFDATE@
%{release_rev}
95 Group: System Environment
/Daemons
96 Source0: http
://www.quagga.net
/snapshots
/cvs
/%{name}-%{version}.tar.gz
97 URL: http
://www.quagga.net
99 BuildRequires
: net
-snmp
-devel
100 Requires(pre
): net
-snmp
103 BuildRequires
: readline readline
-devel ncurses ncurses
-devel
104 Requires(pre
): ncurses
106 BuildRequires
: texinfo tetex autoconf pam
-devel patch libcap
-devel tetex
107 # Initscripts > 5.60 is required for IPv6 support
108 Requires(pre
): initscripts
>= 5.60
109 Requires(pre
): ncurses pam
110 Requires(pre
): /sbin
/install-info
111 Provides: routingdaemon
112 BuildRoot: %{_tmppath}/%{name}-%{version}-root
113 Obsoletes
: bird gated mrt zebra
116 Quagga is a free software that manages TCP
/IP based routing
117 protocol. It takes multi
-server and multi
-thread approach to resolve
118 the current complexity of the Internet.
120 Quagga supports BGP4
, BGP4
+, OSPFv2
, OSPFv3
, RIPv1
, RIPv2
, and RIPng.
122 Quagga is intended to be used as a Route Server and a Route Reflector. It is
123 not a toolkit
, it provides full routing power under a new architecture.
124 Quagga by design has a process
for each protocol.
126 Quagga is a fork of GNU Zebra.
129 Summary: contrib tools
for quagga
130 Group: System Environment
/Daemons
133 Contributed
/3rd party tools which may be of use with quagga.
136 Summary: Header and object files
for quagga development
137 Group: System Environment
/Daemons
140 The quagga
-devel package contains the header and object files neccessary
for
141 developing OSPF
-API and quagga applications.
148 # For standard gcc verbosity, uncomment these lines:
149 #CFLAGS="%{optflags} -Wall -Wsign-compare -Wpointer-arith"
150 #CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
152 # For ultra gcc verbosity, uncomment these lines also:
153 #CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
154 #CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
155 #CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
156 #CFLAGS="${CFLAGS} -Wpacked -Wpadded"
168 %if %{with_multipath}
169 --enable-multipath
=%{with_multipath} \
171 %if %{with_tcp_zebra}
177 %if %{with_opaque_lsa}
178 --enable-opaque
-lsa \
186 %if %{with_ospfclient}
187 --enable-ospfclient
=yes \
189 --enable-ospfclient
=no\
192 --enable-ospfapi
=yes \
194 --enable-ospfapi
=no \
215 --enable-user
=%quagga_user \
216 --enable-group
=%quagga_user \
219 --enable-vty
-group
=%vty_group \
221 --enable-netlink
--enable-gcc
-rdynamic
223 make %{?_smp_mflags} MAKEINFO
="makeinfo
--no
-split"
226 texi2html
-number quagga.texi
230 rm -rf $RPM_BUILD_ROOT
232 install -d $RPM_BUILD_ROOT
/etc
/{rc.d
/init.d
,sysconfig
,logrotate.d
,pam.d
} \
233 $RPM_BUILD_ROOT
/var
/log
/quagga $RPM_BUILD_ROOT
%{_infodir}
236 DESTDIR
=$RPM_BUILD_ROOT
238 # Remove this file, as it is uninstalled and causes errors when building on RH9
239 rm -rf $RPM_BUILD_ROOT
/usr
/share
/info
/dir
241 # install etc sources
242 for daemon
in %{all_daemons} ; do
243 if [ x"$
{daemon
}"
!= x""
] ; then
244 install %{zeb_rh_src}/${daemon}.init \
245 $RPM_BUILD_ROOT
/etc
/rc.d
/init.d
/$
{daemon
}
248 install -m644
%{zeb_rh_src}/%{quagga_pam_source} \
249 $RPM_BUILD_ROOT
/etc
/pam.d
/quagga
250 install -m644
%{zeb_rh_src}/quagga.logrotate \
251 $RPM_BUILD_ROOT
/etc
/logrotate.d
/quagga
252 install -m644
%{zeb_rh_src}/quagga.sysconfig \
253 $RPM_BUILD_ROOT
/etc
/sysconfig
/quagga
254 install -d
-m750 $RPM_BUILD_ROOT
/var
/run
/quagga
259 if getent group
%vty_group > /dev
/null
; then : ; else \
260 /usr
/sbin
/groupadd
-r
%vty_group > /dev
/null ||
: ; fi
263 # add quagga user and group
265 # Ensure that quagga_gid gets correctly allocated
266 if getent group
%quagga_user >/dev
/null
; then : ; else \
267 /usr
/sbin
/groupadd
-g
%quagga_gid %quagga_user > /dev
/null ||
: ; \
269 if getent passwd
%quagga_user >/dev
/null
; then : ; else \
270 /usr
/sbin
/useradd
-u
%quagga_uid -g
%quagga_gid \
271 -M
-r
-s
/sbin
/nologin
-c "Quagga routing suite" \
272 -d
%_localstatedir %quagga_user 2> /dev
/null ||
: ; \
277 # zebra_spec_add_service <service name> <port/proto> <comment>
278 # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
280 zebra_spec_add_service
()
282 # Add port /etc/services entry if it isn't already there
283 if [ -f
/etc
/services
] && \
284 ! %__sed -e 's
/#.*$//' /etc/services | %__grep -wq $1 ; then
285 echo "$
1 $
2 # $3" >> /etc/services
289 zebra_spec_add_service zebrasrv
2600/tcp "zebra service"
290 zebra_spec_add_service zebra
2601/tcp "zebra vty"
291 zebra_spec_add_service ripd
2602/tcp "RIPd vty"
293 zebra_spec_add_service ripngd
2603/tcp "RIPngd vty"
295 zebra_spec_add_service ospfd
2604/tcp "OSPFd vty"
296 zebra_spec_add_service bgpd
2605/tcp "BGPd vty"
298 zebra_spec_add_service ospf6d
2606/tcp "OSPF6d vty"
301 zebra_spec_add_service ospfapi
2607/tcp "OSPF
-API"
304 zebra_spec_add_service isisd
2608/tcp "ISISd vty"
307 zebra_spec_add_service pimd
2611/tcp "PIMd vty"
310 for daemon
in %daemon_list ; do
311 /sbin
/chkconfig
--add $
{daemon
}
314 /sbin
/install-info
%{_infodir}/quagga.info.gz %{_infodir}/dir
316 # Create dummy files if they don't exist so basic functions can be used.
317 if [ ! -e
%{_sysconfdir}/zebra.conf
]; then
318 echo "hostname `hostname`"
> %{_sysconfdir}/zebra.conf
320 chown
%quagga_user:%quagga_user %{_sysconfdir}/zebra.conf
322 chmod
640 %{_sysconfdir}/zebra.conf
324 if [ ! -e
%{_sysconfdir}/vtysh.conf
]; then
325 touch
%{_sysconfdir}/vtysh.conf
326 chmod
640 %{_sysconfdir}/vtysh.conf
330 if [ "$
1"
-ge
1 ]; then
331 # Find out which daemons need to be restarted.
332 for daemon
in %all_daemons ; do
333 if [ -f
/var
/lock
/subsys
/$daemon
]; then
334 eval restart_$daemon
=yes
336 eval restart_$daemon
=no
339 # Rename restart flags for daemons handled specially.
340 running_zebra
="$restart_zebra"
342 running_watchquagga
="$restart_watchquagga"
343 restart_watchquagga
=no
344 # Stop watchquagga first.
345 [ "$running_watchquagga"
= yes
] && \
346 /etc
/rc.d
/init.d
/watchquagga stop
>/dev
/null
2>&1
347 # Stop all daemons other than zebra and watchquagga.
348 for daemon
in %all_daemons ; do
349 eval restart
=\$restart_$
{daemon
}
350 [ "$restart"
= yes
] && \
351 /etc
/rc.d
/init.d
/$daemon stop
>/dev
/null
2>&1
354 [ "$running_zebra"
= yes
] && \
355 /etc
/rc.d
/init.d
/zebra restart
>/dev
/null
2>&1
356 # Start all daemons other than zebra and watchquagga.
357 for daemon
in %all_daemons ; do
358 eval restart
=\$restart_$
{daemon
}
359 [ "$restart"
= yes
] && \
360 /etc
/rc.d
/init.d
/$daemon start
>/dev
/null
2>&1
362 # Start watchquagga last.
363 # Avoid postun scriptlet error if watchquagga is not running.
364 [ "$running_watchquagga"
= yes
] && \
365 /etc
/rc.d
/init.d
/watchquagga start
>/dev
/null
2>&1 ||
:
367 /sbin
/install-info
--delete
%{_infodir}/quagga.info.gz %{_infodir}/dir
370 if [ "$
1"
= "
0"
]; then
371 for daemon
in %all_daemons ; do
372 /etc
/rc.d
/init.d
/$
{daemon
} stop
>/dev
/null
2>&1
373 /sbin
/chkconfig
--del $
{daemon
}
375 /sbin
/install-info
--delete
%{_infodir}/quagga.info.gz %{_infodir}/dir
380 rm -rf $RPM_BUILD_ROOT
384 %defattr(-,root
,root
)
385 %doc */*.sample
* AUTHORS COPYING
388 %doc ChangeLog INSTALL NEWS README REPORTING
-BUGS SERVICES TODO
390 %dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
391 %dir %attr(750,%quagga_user,%quagga_user) /var
/log
/quagga
392 %dir %attr(751,%quagga_user,%quagga_user) /var
/run
/quagga
394 %dir %attr(750,root
,root
) %{_sysconfdir}
395 %dir %attr(750,root
,root
) /var
/log
/quagga
396 %dir %attr(755,root
,root
) /usr
/share
/info
397 %dir %attr(750,root
,root
) /var
/run
/quagga
400 %attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
408 %{_sbindir}/watchquagga
416 %dir %attr(755,root
,root
) %{_libdir}
425 %config /etc
/quagga
/[!v
]*
426 %config /etc
/rc.d
/init.d
/*
427 %config(noreplace
) /etc
/sysconfig
/quagga
428 %config(noreplace
) /etc
/pam.d
/quagga
429 %config(noreplace
) %attr(640,root
,root
) /etc
/logrotate.d
/*
432 %defattr(-,root
,root
)
436 %defattr(-,root
,root
)
437 %if %{with_ospfclient}
438 %{_sbindir}/ospfclient
442 %dir %attr(755,root
,root
) %{_includedir}/%{name}
443 %{_includedir}/%name/*.h
444 %dir %attr(755,root
,root
) %{_includedir}/%{name}/ospfd
445 %{_includedir}/%name/ospfd
/*.h
447 %dir %attr(755,root
,root
) %{_includedir}/%{name}/ospfapi
448 %{_includedir}/%name/ospfapi
/*.h
452 * Thu Sep
12 2005 Paul Jakma
<paul@dishone.st
>
453 - Steal some changes from Fedora spec file
:
454 - Add with_rtadv variable
455 - Test
for groups
/users with getent before group
/user adding
456 - Readline need not be an explicit prerequisite
457 - install-info delete should be postun
, not preun
459 * Wed Jan
12 2005 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
460 - on package upgrade
, implement careful
, phased restart logic
461 - use gcc
-rdynamic flag when linking
for better backtraces
463 * Wed Dec
22 2004 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
464 - daemonv6_list should contain only IPv6 daemons
466 * Wed Dec
22 2004 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
468 - on upgrade
, all daemons should be condrestart'ed
469 - on removal
, all daemons should be stopped
471 * Mon Nov
08 2004 Paul Jakma
<paul@dishone.st
>
472 - Use makeinfo
--html to generate quagga.html
474 * Sun Nov
07 2004 Paul Jakma
<paul@dishone.st
>
475 - Fix with_ipv6
set to
0 build
477 * Sat Oct
23 2004 Paul Jakma
<paul@dishone.st
>
480 * Sat Oct
23 2004 Andrew J. Schorr
<aschorr@telemetry
-investments.com
>
481 - Make directories be owned by the packages concerned
482 - Update logrotate scripts to use correct path to killall and use pid files
484 * Fri Oct
08 2004 Paul Jakma
<paul@dishone.st
>
487 * Wed Sep
15 2004 Paul Jakma
<paul@dishone.st
>
488 - build snmp support by default
490 - build with shared libs
491 - devel subpackage
for archives and headers
493 * Thu Jan
08 2004 Paul Jakma
<paul@dishone.st
>
494 - updated sysconfig files to specify
local dir
495 - added ospf_dump.c crash quick fix patch
496 - added ospfd persistent interface configuration patch
498 * Tue Dec
30 2003 Paul Jakma
<paul@dishone.st
>
500 - integrate RH sysconfig patch to specify daemon options
(RH
)
501 - default to have vty listen only to
127.1 (RH
)
502 - add user with fixed UID
/GID
(RH
)
503 - create user with shell
/sbin
/nologin rather than
/bin
/false
(RH
)
504 - stop daemons on uninstall
(RH
)
505 - delete info file on
%preun, not
%postun to avoid deletion on upgrade.
(RH
)
507 - cleanup tasks carried out
for every daemon
509 * Sun Nov
2 2003 Paul Jakma
<paul@dishone.st
>
510 - Fix
-devel package to include all files
513 * Tue Aug
12 2003 Paul Jakma
<paul@dishone.st
>
515 - Sync to Quagga release
0.96
517 * Tue Mar
20 2003 Paul Jakma
<paul@dishone.st
>
518 - zebra privileges support
520 * Mon Mar
18 2003 Paul Jakma
<paul@dishone.st
>
521 - Fix mem leak
in 'show thread cpu'
522 - Ralph Keller's OSPF
-API
523 - Amir
: Fix configure.ac
for net
-snmp
525 * Sat Mar
1 2003 Paul Jakma
<paul@dishone.st
>
526 - ospfd IOS prefix to interface matching
for 'network' statement
527 - temporary fix
for PtP and IPv6
528 - sync to zebra.org CVS
530 * Mon Jan
20 2003 Paul Jakma
<paul@dishone.st
>
531 - update to latest cvs
532 - Yon's "show thread cpu" patch
- 17217
533 - walk up tree
- 17218
534 - ospfd NSSA fixes
- 16681
535 - ospfd nsm fixes
- 16824
536 - ospfd OLSA fixes and new feature
- 16823
537 - KAME and ifindex fixes
- 16525
538 - spec file changes to allow redhat files to be
in tree
540 * Sat Dec
28 2002 Alexander Hoogerhuis
<alexh@ihatent.com
>
541 - Added conditionals
for building with
(out
) IPv6
, vtysh
, RIP
, BGP
542 - Fixed up some build requirements
(patch
)
543 - Added conditional build requirements
for vtysh
/ snmp
544 - Added conditional to
%files for %_bindir depending on vtysh
546 * Mon Nov
11 2002 Paul Jakma
<paulj@alphyra.ie
>
547 - update to latest CVS
548 - add Greg Troxel's md5 buffer copy
/dup fix
550 - add Frank's multicast flag fix
552 * Wed Oct
09 2002 Paul Jakma
<paulj@alphyra.ie
>
553 - update to latest CVS
554 - timestamped crypt_seqnum patch
557 * Mon Sep
30 2002 Paul Jakma
<paulj@alphyra.ie
>
558 - update to latest CVS
559 - add vtysh 'write
-config
(integrated|daemon
)' patch
560 - always '
make rebuild'
in vtysh
/ to catch new commands
562 * Fri Sep
13 2002 Paul Jakma
<paulj@alphyra.ie
>
565 * Wed Sep
11 2002 Paul Jakma
<paulj@alphyra.ie
>
566 - update to latest CVS
567 - add "
/sbin
/ip route flush proto zebra" to zebra RH init on startup
569 * Sat Aug
24 2002 Paul Jakma
<paulj@alphyra.ie
>
570 - update to current CVS
571 - add OSPF point to multipoint patch
573 - add BGP
hash optimisation patch
575 * Fri Jun
14 2002 Paul Jakma
<paulj@alphyra.ie
>
576 - update to
0.93-pre1
/ CVS
577 - add link state detection support
578 - add generic PtP and RFC3021 support
581 * Thu Aug
09 2001 Elliot Lee
<sopwith@redhat.com
> 0.91a
-6
584 * Wed Aug
1 2001 Trond Eivind Glomsrød
<teg@redhat.com
> 0.91a
-5
585 - Use generic initscript strings instead of initscript specific
586 ( "Starting foo
: "
-> "Starting $prog
:"
)
588 * Fri Jul
27 2001 Elliot Lee
<sopwith@redhat.com
> 0.91a
-4
589 - Bump the release when rebuilding into the dist.
591 * Tue Feb
6 2001 Tim Powers
<timp@redhat.com
>
592 - built
for Powertools
594 * Sun Feb
4 2001 Pekka Savola
<pekkas@netcore.
fi>
595 - Hacked up from PLD Linux
0.90-1, Mandrake
0.90-1mdk and one from zebra.org.
597 - Very heavy modifications to init.d
/*, .spec
, pam
, i18n
, logrotate
, etc.
598 - Should be quite Red Hat'isque now.