3 # Some can be overriden on rpmbuild commandline with:
4 # rpmbuild --define 'variable value'
6 # E.g. rpmbuild --define 'release_rev 02' may be useful if building
7 # rpms again and again on the same day, so the newer rpms can be installed.
8 # bumping the number each time.
10 ####################### Quagga configure options #########################
11 # with-feature options
12 %{!?with_snmp: %define with_snmp 1 }
13 %{!?with_vtysh: %define with_vtysh 1 }
14 %{!?with_ospf_te: %define with_ospf_te 1 }
15 %{!?with_nssa: %define with_nssa 1 }
16 %{!?with_opaque_lsa: %define with_opaque_lsa 1 }
17 %{!?with_tcp_zebra: %define with_tcp_zebra 0 }
18 %{!?with_vtysh: %define with_vtysh 1 }
19 %{!?with_pam: %define with_pam 1 }
20 %{!?with_ospfclient: %define with_ospfclient 1 }
21 %{!?with_ospfapi: %define with_ospfapi 1 }
22 %{!?with_irdp: %define with_irdp 1 }
23 %{!?with_rtadv: %define with_rtadv 1 }
24 %{!?with_isisd: %define with_isisd 1 }
25 %{!?with_pimd: %define with_pimd 1 }
26 %{!?with_shared: %define with_shared 1 }
27 %{!?with_multipath: %define with_multipath 64 }
28 %{!?quagga_user: %define quagga_user quagga }
29 %{!?vty_group: %define vty_group quaggavty }
32 %define _sysconfdir
/etc
/quagga
33 %define zeb_src
%{_builddir}/%{name}-%{version}
34 %define zeb_rh_src
%{zeb_src}/redhat
35 %define zeb_docs
%{zeb_src}/doc
37 # defines for configure
38 %define _libexecdir
%{_exec_prefix}/libexec
/quagga
39 %define _libdir
%{_exec_prefix}/%{_lib}/quagga
40 %define _includedir
%{_prefix}/include
41 %define _localstatedir
/var
/run
/quagga
42 ############################################################################
44 ####################### distro specific tweaks #############################
45 # default distro. Override with rpmbuild -D "dist XXX"
46 %{expand: %%define default_dist %(rpm -q --qf 'fc%%{VERSION}' fedora-release | grep -v 'not installed')}
47 %{!?dist: %define dist %{default_dist}}
49 # as distros change packages we depend on, our Requires have to change, sadly.
50 %define quagga_buildreqs texi2html texinfo autoconf pam
-devel
51 %define quagga_buildreqs
%{expand:%{quagga_buildreqs}} patch libcap
-devel
53 # FC4 and 5 split texi2html out of tetex package.
54 %define quagga_buildreqs
%{expand:%{quagga_buildreqs}} texi2html
56 # man page probably needs groff for groff_ms macros
57 %define quagga_buildreqs
%{expand:%{quagga_buildreqs}} groff
59 ############################################################################
61 # misc internal defines
62 %{!?quagga_uid: %define quagga_uid 92 }
63 %{!?quagga_gid: %define quagga_gid 92 }
64 %define daemon_list zebra ripd ospfd bgpd
66 %define daemonv6_list ripngd ospf6d
69 %define daemon_other isisd
71 %define daemon_other ""
74 %define all_daemons
%{daemon_list} %{daemonv6_list} %{daemon_other} watchquagga
76 # allow build dir to be kept
77 %{!?keep_build: %define keep_build 0 }
79 #release sub-revision (the two digits after the CONFDATE)
80 %{!?release_rev: %define release_rev 01 }
82 Summary: Routing daemon
85 Release: @CONFDATE@
%{release_rev}
87 Group: System Environment
/Daemons
88 Source0: http
://www.quagga.net
/snapshots
/cvs
/%{name}-%{version}.tar.gz
89 URL: http
://www.quagga.net
91 BuildRequires
: net
-snmp
-devel
92 Requires(pre
): net
-snmp
95 BuildRequires
: readline readline
-devel ncurses ncurses
-devel
96 Requires(pre
): ncurses
98 BuildRequires
: %{quagga_buildreqs}
99 # Initscripts > 5.60 is required for IPv6 support
100 Requires(pre
): initscripts
>= 5.60
101 Requires(pre
): ncurses pam
102 Requires(pre
): /sbin
/install-info
103 Provides: routingdaemon
104 BuildRoot: %{_tmppath}/%{name}-%{version}-root
105 Obsoletes
: bird gated mrt zebra
108 Quagga is a free software that manages TCP
/IP based routing
109 protocol. It takes multi
-server and multi
-thread approach to resolve
110 the current complexity of the Internet.
112 Quagga supports BGP4
, BGP4
+, OSPFv2
, OSPFv3
, RIPv1
, RIPv2
, and RIPng.
114 Quagga is intended to be used as a Route Server and a Route Reflector. It is
115 not a toolkit
, it provides full routing power under a new architecture.
116 Quagga by design has a process
for each protocol.
118 Quagga is a fork of GNU Zebra.
121 Summary: contrib tools
for quagga
122 Group: System Environment
/Daemons
125 Contributed
/3rd party tools which may be of use with quagga.
128 Summary: Header and object files
for quagga development
129 Group: System Environment
/Daemons
132 The quagga
-devel package contains the header and object files neccessary
for
133 developing OSPF
-API and quagga applications.
140 # For standard gcc verbosity, uncomment these lines:
141 #CFLAGS="%{optflags} -Wall -Wsign-compare -Wpointer-arith"
142 #CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
144 # For ultra gcc verbosity, uncomment these lines also:
145 #CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
146 #CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
147 #CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
148 #CFLAGS="${CFLAGS} -Wpacked -Wpadded"
157 %if %{with_multipath}
158 --enable-multipath
=%{with_multipath} \
160 %if %{with_tcp_zebra}
166 %if %{with_opaque_lsa}
167 --enable-opaque
-lsa \
175 %if %{with_ospfclient}
176 --enable-ospfclient
=yes \
178 --enable-ospfclient
=no\
181 --enable-ospfapi
=yes \
183 --enable-ospfapi
=no \
204 --enable-user
=%quagga_user \
205 --enable-group
=%quagga_user \
208 --enable-vty
-group
=%vty_group \
210 --enable-netlink
--enable-gcc
-rdynamic
212 make %{?_smp_mflags} MAKEINFO
="makeinfo
--no
-split"
215 texi2html
--number
-footnotes
--number
-sections quagga.texi
219 rm -rf $RPM_BUILD_ROOT
221 install -d $RPM_BUILD_ROOT
/etc
/{rc.d
/init.d
,sysconfig
,logrotate.d
,pam.d
} \
222 $RPM_BUILD_ROOT
/var
/log
/quagga $RPM_BUILD_ROOT
%{_infodir}
225 DESTDIR
=$RPM_BUILD_ROOT
227 # Remove this file, as it is uninstalled and causes errors when building on RH9
228 rm -rf $RPM_BUILD_ROOT
/usr
/share
/info
/dir
230 # install etc sources
231 for daemon
in %{all_daemons} ; do
232 if [ x"$
{daemon
}"
!= x""
] ; then
233 install %{zeb_rh_src}/${daemon}.init \
234 $RPM_BUILD_ROOT
/etc
/rc.d
/init.d
/$
{daemon
}
237 install -m644
%{zeb_rh_src}/quagga.pam \
238 $RPM_BUILD_ROOT
/etc
/pam.d
/quagga
239 install -m644
%{zeb_rh_src}/quagga.logrotate \
240 $RPM_BUILD_ROOT
/etc
/logrotate.d
/quagga
241 install -m644
%{zeb_rh_src}/quagga.sysconfig \
242 $RPM_BUILD_ROOT
/etc
/sysconfig
/quagga
243 install -d
-m750 $RPM_BUILD_ROOT
/var
/run
/quagga
248 if getent group
%vty_group > /dev
/null
; then : ; else \
249 /usr
/sbin
/groupadd
-r
%vty_group > /dev
/null ||
: ; fi
252 # add quagga user and group
254 # Ensure that quagga_gid gets correctly allocated
255 if getent group
%quagga_user >/dev
/null
; then : ; else \
256 /usr
/sbin
/groupadd
-g
%quagga_gid %quagga_user > /dev
/null ||
: ; \
258 if getent passwd
%quagga_user >/dev
/null
; then : ; else \
259 /usr
/sbin
/useradd
-u
%quagga_uid -g
%quagga_gid \
260 -M
-r
-s
/sbin
/nologin
-c "Quagga routing suite" \
261 -d
%_localstatedir %quagga_user 2> /dev
/null ||
: ; \
266 # zebra_spec_add_service <service name> <port/proto> <comment>
267 # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
269 zebra_spec_add_service
()
271 # Add port /etc/services entry if it isn't already there
272 if [ -f
/etc
/services
] && \
273 ! %__sed -e 's
/#.*$//' /etc/services | %__grep -wq $1 ; then
274 echo "$
1 $
2 # $3" >> /etc/services
278 zebra_spec_add_service zebrasrv
2600/tcp "zebra service"
279 zebra_spec_add_service zebra
2601/tcp "zebra vty"
280 zebra_spec_add_service ripd
2602/tcp "RIPd vty"
281 zebra_spec_add_service ripngd
2603/tcp "RIPngd vty"
282 zebra_spec_add_service ospfd
2604/tcp "OSPFd vty"
283 zebra_spec_add_service bgpd
2605/tcp "BGPd vty"
284 zebra_spec_add_service ospf6d
2606/tcp "OSPF6d vty"
286 zebra_spec_add_service ospfapi
2607/tcp "OSPF
-API"
289 zebra_spec_add_service isisd
2608/tcp "ISISd vty"
292 zebra_spec_add_service pimd
2611/tcp "PIMd vty"
295 for daemon
in %daemon_list ; do
296 /sbin
/chkconfig
--add $
{daemon
}
299 /sbin
/install-info
%{_infodir}/quagga.info.gz %{_infodir}/dir
301 # Create dummy files if they don't exist so basic functions can be used.
302 if [ ! -e
%{_sysconfdir}/zebra.conf
]; then
303 echo "hostname `hostname`"
> %{_sysconfdir}/zebra.conf
305 chown
%quagga_user:%quagga_user %{_sysconfdir}/zebra.conf
307 chmod
640 %{_sysconfdir}/zebra.conf
309 if [ ! -e
%{_sysconfdir}/vtysh.conf
]; then
310 touch
%{_sysconfdir}/vtysh.conf
311 chmod
640 %{_sysconfdir}/vtysh.conf
315 if [ "$
1"
-ge
1 ]; then
316 # Find out which daemons need to be restarted.
317 for daemon
in %all_daemons ; do
318 if [ -f
/var
/lock
/subsys
/$daemon
]; then
319 eval restart_$daemon
=yes
321 eval restart_$daemon
=no
324 # Rename restart flags for daemons handled specially.
325 running_zebra
="$restart_zebra"
327 running_watchquagga
="$restart_watchquagga"
328 restart_watchquagga
=no
329 # Stop watchquagga first.
330 [ "$running_watchquagga"
= yes
] && \
331 /etc
/rc.d
/init.d
/watchquagga stop
>/dev
/null
2>&1
332 # Stop all daemons other than zebra and watchquagga.
333 for daemon
in %all_daemons ; do
334 eval restart
=\$restart_$
{daemon
}
335 [ "$restart"
= yes
] && \
336 /etc
/rc.d
/init.d
/$daemon stop
>/dev
/null
2>&1
339 [ "$running_zebra"
= yes
] && \
340 /etc
/rc.d
/init.d
/zebra restart
>/dev
/null
2>&1
341 # Start all daemons other than zebra and watchquagga.
342 for daemon
in %all_daemons ; do
343 eval restart
=\$restart_$
{daemon
}
344 [ "$restart"
= yes
] && \
345 /etc
/rc.d
/init.d
/$daemon start
>/dev
/null
2>&1
347 # Start watchquagga last.
348 # Avoid postun scriptlet error if watchquagga is not running.
349 [ "$running_watchquagga"
= yes
] && \
350 /etc
/rc.d
/init.d
/watchquagga start
>/dev
/null
2>&1 ||
:
352 /sbin
/install-info
--delete
%{_infodir}/quagga.info.gz %{_infodir}/dir
355 if [ "$
1"
= "
0"
]; then
356 for daemon
in %all_daemons ; do
357 /etc
/rc.d
/init.d
/$
{daemon
} stop
>/dev
/null
2>&1
358 /sbin
/chkconfig
--del $
{daemon
}
360 /sbin
/install-info
--delete
%{_infodir}/quagga.info.gz %{_infodir}/dir
365 rm -rf $RPM_BUILD_ROOT
369 %defattr(-,root
,root
)
370 %doc */*.sample
* AUTHORS COPYING
373 %doc ChangeLog INSTALL NEWS README REPORTING
-BUGS SERVICES TODO
375 %dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
376 %dir %attr(750,%quagga_user,%quagga_user) /var
/log
/quagga
377 %dir %attr(751,%quagga_user,%quagga_user) /var
/run
/quagga
379 %dir %attr(750,root
,root
) %{_sysconfdir}
380 %dir %attr(750,root
,root
) /var
/log
/quagga
381 %dir %attr(755,root
,root
) /usr
/share
/info
382 %dir %attr(750,root
,root
) /var
/run
/quagga
385 %attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
393 %{_sbindir}/watchquagga
402 %dir %attr(755,root
,root
) %{_libdir}
411 %config /etc
/quagga
/[!v
]*
412 %config /etc
/rc.d
/init.d
/*
413 %config(noreplace
) /etc
/sysconfig
/quagga
414 %config(noreplace
) /etc
/pam.d
/quagga
415 %config(noreplace
) %attr(640,root
,root
) /etc
/logrotate.d
/*
418 %defattr(-,root
,root
)
422 %defattr(-,root
,root
)
423 %if %{with_ospfclient}
424 %{_sbindir}/ospfclient
428 %dir %attr(755,root
,root
) %{_includedir}/%{name}
429 %{_includedir}/%name/*.h
430 %dir %attr(755,root
,root
) %{_includedir}/%{name}/ospfd
431 %{_includedir}/%name/ospfd
/*.h
433 %dir %attr(755,root
,root
) %{_includedir}/%{name}/ospfapi
434 %{_includedir}/%name/ospfapi
/*.h
438 * Fri Sep
4 2015 Paul Jakma
<paul@jakma.org
> - %{version}
439 - package the pimd binary
440 - remove with_ipv6 conditionals
, always build v6
441 - Fix UTF
-8 char
in spec changelog
442 - remove quagga.pam.stack
, long deprecated.
444 * Fri Sep
4 2015 Paul Jakma
<paul@jakma.org
> - %{version}
446 - add a default define
for with_pimd
448 * Thu Sep
12 2005 Paul Jakma
<paul@dishone.st
>
449 - Steal some changes from Fedora spec file
:
450 - Add with_rtadv variable
451 - Test
for groups
/users with getent before group
/user adding
452 - Readline need not be an explicit prerequisite
453 - install-info delete should be postun
, not preun
455 * Wed Jan
12 2005 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
456 - on package upgrade
, implement careful
, phased restart logic
457 - use gcc
-rdynamic flag when linking
for better backtraces
459 * Wed Dec
22 2004 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
460 - daemonv6_list should contain only IPv6 daemons
462 * Wed Dec
22 2004 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
464 - on upgrade
, all daemons should be condrestart'ed
465 - on removal
, all daemons should be stopped
467 * Mon Nov
08 2004 Paul Jakma
<paul@dishone.st
>
468 - Use makeinfo
--html to generate quagga.html
470 * Sun Nov
07 2004 Paul Jakma
<paul@dishone.st
>
471 - Fix with_ipv6
set to
0 build
473 * Sat Oct
23 2004 Paul Jakma
<paul@dishone.st
>
476 * Sat Oct
23 2004 Andrew J. Schorr
<aschorr@telemetry
-investments.com
>
477 - Make directories be owned by the packages concerned
478 - Update logrotate scripts to use correct path to killall and use pid files
480 * Fri Oct
08 2004 Paul Jakma
<paul@dishone.st
>
483 * Wed Sep
15 2004 Paul Jakma
<paul@dishone.st
>
484 - build snmp support by default
486 - build with shared libs
487 - devel subpackage
for archives and headers
489 * Thu Jan
08 2004 Paul Jakma
<paul@dishone.st
>
490 - updated sysconfig files to specify
local dir
491 - added ospf_dump.c crash quick fix patch
492 - added ospfd persistent interface configuration patch
494 * Tue Dec
30 2003 Paul Jakma
<paul@dishone.st
>
496 - integrate RH sysconfig patch to specify daemon options
(RH
)
497 - default to have vty listen only to
127.1 (RH
)
498 - add user with fixed UID
/GID
(RH
)
499 - create user with shell
/sbin
/nologin rather than
/bin
/false
(RH
)
500 - stop daemons on uninstall
(RH
)
501 - delete info file on
%preun, not
%postun to avoid deletion on upgrade.
(RH
)
503 - cleanup tasks carried out
for every daemon
505 * Sun Nov
2 2003 Paul Jakma
<paul@dishone.st
>
506 - Fix
-devel package to include all files
509 * Tue Aug
12 2003 Paul Jakma
<paul@dishone.st
>
511 - Sync to Quagga release
0.96
513 * Tue Mar
20 2003 Paul Jakma
<paul@dishone.st
>
514 - zebra privileges support
516 * Mon Mar
18 2003 Paul Jakma
<paul@dishone.st
>
517 - Fix mem leak
in 'show thread cpu'
518 - Ralph Keller's OSPF
-API
519 - Amir
: Fix configure.ac
for net
-snmp
521 * Sat Mar
1 2003 Paul Jakma
<paul@dishone.st
>
522 - ospfd IOS prefix to interface matching
for 'network' statement
523 - temporary fix
for PtP and IPv6
524 - sync to zebra.org CVS
526 * Mon Jan
20 2003 Paul Jakma
<paul@dishone.st
>
527 - update to latest cvs
528 - Yon's "show thread cpu" patch
- 17217
529 - walk up tree
- 17218
530 - ospfd NSSA fixes
- 16681
531 - ospfd nsm fixes
- 16824
532 - ospfd OLSA fixes and new feature
- 16823
533 - KAME and ifindex fixes
- 16525
534 - spec file changes to allow redhat files to be
in tree
536 * Sat Dec
28 2002 Alexander Hoogerhuis
<alexh@ihatent.com
>
537 - Added conditionals
for building with
(out
) IPv6
, vtysh
, RIP
, BGP
538 - Fixed up some build requirements
(patch
)
539 - Added conditional build requirements
for vtysh
/ snmp
540 - Added conditional to
%files for %_bindir depending on vtysh
542 * Mon Nov
11 2002 Paul Jakma
<paulj@alphyra.ie
>
543 - update to latest CVS
544 - add Greg Troxel's md5 buffer copy
/dup fix
546 - add Frank's multicast flag fix
548 * Wed Oct
09 2002 Paul Jakma
<paulj@alphyra.ie
>
549 - update to latest CVS
550 - timestamped crypt_seqnum patch
553 * Mon Sep
30 2002 Paul Jakma
<paulj@alphyra.ie
>
554 - update to latest CVS
555 - add vtysh 'write
-config
(integrated|daemon
)' patch
556 - always '
make rebuild'
in vtysh
/ to catch new commands
558 * Fri Sep
13 2002 Paul Jakma
<paulj@alphyra.ie
>
561 * Wed Sep
11 2002 Paul Jakma
<paulj@alphyra.ie
>
562 - update to latest CVS
563 - add "
/sbin
/ip route flush proto zebra" to zebra RH init on startup
565 * Sat Aug
24 2002 Paul Jakma
<paulj@alphyra.ie
>
566 - update to current CVS
567 - add OSPF point to multipoint patch
569 - add BGP
hash optimisation patch
571 * Fri Jun
14 2002 Paul Jakma
<paulj@alphyra.ie
>
572 - update to
0.93-pre1
/ CVS
573 - add link state detection support
574 - add generic PtP and RFC3021 support
577 * Thu Aug
09 2001 Elliot Lee
<sopwith@redhat.com
> 0.91a
-6
580 * Wed Aug
1 2001 Trond Eivind Glomsrød
<teg@redhat.com
> 0.91a
-5
581 - Use generic initscript strings instead of initscript specific
582 ( "Starting foo
: "
-> "Starting $prog
:"
)
584 * Fri Jul
27 2001 Elliot Lee
<sopwith@redhat.com
> 0.91a
-4
585 - Bump the release when rebuilding into the dist.
587 * Tue Feb
6 2001 Tim Powers
<timp@redhat.com
>
588 - built
for Powertools
590 * Sun Feb
4 2001 Pekka Savola
<pekkas@netcore.
fi>
591 - Hacked up from PLD Linux
0.90-1, Mandrake
0.90-1mdk and one from zebra.org.
593 - Very heavy modifications to init.d
/*, .spec
, pam
, i18n
, logrotate
, etc.
594 - Should be quite Red Hat'isque now.