3 # Some can be overriden on rpmbuild commandline with:
4 # rpmbuild --define 'variable value'
5 # (use any value, ie 1 for flag "with_XXXX" definitions)
7 # E.g. rpmbuild --define 'release_rev 02' may be useful if building
8 # rpms again and again on the same day, so the newer rpms can be installed.
9 # bumping the number each time.
11 #################### FRRouting (FRR) configure options #####################
12 # with-feature options
13 %{!?with_tcp_zebra: %global with_tcp_zebra 0 }
14 %{!?with_pam: %global with_pam 0 }
15 %{!?with_ospfclient: %global with_ospfclient 1 }
16 %{!?with_ospfapi: %global with_ospfapi 1 }
17 %{!?with_irdp: %global with_irdp 1 }
18 %{!?with_rtadv: %global with_rtadv 1 }
19 %{!?with_ldpd: %global with_ldpd 1 }
20 %{!?with_shared: %global with_shared 1 }
21 %{!?with_multipath: %global with_multipath 256 }
22 %{!?frr_user: %global frr_user frr }
23 %{!?vty_group: %global vty_group frrvty }
24 %{!?with_fpm: %global with_fpm 0 }
25 %{!?with_watchfrr: %global with_watchfrr 1 }
26 %{!?with_bgp_vnc: %global with_bgp_vnc 0 }
27 %{!?with_pimd: %global with_pimd 1 }
30 %define _sysconfdir
/etc
/frr
31 %define _sbindir
/usr
/lib
/frr
32 %define zeb_src
%{_builddir}/%{name}-%{frrversion}
33 %define zeb_rh_src
%{zeb_src}/redhat
34 %define zeb_docs
%{zeb_src}/doc
35 %define frr_tools
%{zeb_src}/tools
37 # defines for configure
38 %define _localstatedir
/var
/run
/frr
39 ############################################################################
41 #### Version String tweak
42 # Remove invalid characters form version string and replace with _
43 %{expand: %%global rpmversion %(echo '@VERSION@' | tr [:blank:]- _ )}
44 %define frrversion @VERSION@
46 #### Check version of texi2html
47 # Old versions don't support "--number-footnotes" option.
48 %{expand: %%global texi2htmlversion %(if [[ -f /usr/bin/texi2html ]]; then /usr/bin/texi2html --version | cut -d. -f1; else echo 0; fi)}
50 #### Check for systemd or init.d (upstart)
51 # Check for init.d (upstart) as used in CentOS 6 or systemd (ie CentOS 7)
52 %{expand: %%global initsystem %(if [[ `/sbin/init --version 2> /dev/null` =~ upstart ]]; then echo upstart; elif [[ `file /sbin/init` =~ "symbolic link to \`../lib/systemd/systemd'" ]]; then echo systemd; elif [[ `systemctl` =~ -\.mount ]]; then echo systemd; fi)}
54 # If init system is systemd, then always disable watchfrr
56 %if "
%{initsystem}"
== "systemd"
57 # Note: For systems with systemd, watchfrr will NOT be built. Systemd
58 # takes over the role of restarting crashed processes. Value will
59 # be overwritten with 0 below for systemd independent on the setting here
60 %global with_watchfrr
1
63 #### Check for RedHat 6.x or CentOS 6.x - they are too old to support PIM.
64 #### Always disable it on these old systems unconditionally
65 %{expand: %%global redhat6 %(if [[ `cat /etc/redhat-release 2> /dev/null` =~ release\ 6\. ]]; then echo 6; else echo 0; fi)}
67 # if CentOS 6 / RedHat 6, then disable PIMd
68 %if "
%{redhat6}"
== "
6"
72 # if FPM is enabled, then enable tcp_zebra as well
75 %global with_tcp_zebra
1
78 # misc internal defines
79 %{!?frr_uid: %global frr_uid 92 }
80 %{!?frr_gid: %global frr_gid 92 }
81 %{!?vty_gid: %global vty_gid 85 }
83 %define daemon_list zebra ripd ospfd bgpd isisd ripngd ospf6d
86 %define daemon_ldpd ldpd
88 %define daemon_ldpd ""
92 %define daemon_pimd pimd
94 %define daemon_pimd ""
98 %define daemon_watchfrr watchfrr
100 %define daemon_watchfrr ""
103 %define all_daemons
%{daemon_list} %{daemon_ldpd} %{daemon_pimd} %{daemon_watchfrr}
105 # allow build dir to be kept
106 %{!?keep_build: %global keep_build 0 }
108 #release sub-revision (the two digits after the CONFDATE)
109 %{!?release_rev: %global release_rev 01 }
111 Summary: Routing daemon
113 Version: %{rpmversion}
114 Release: @CONFDATE@
%{release_rev}%{?dist}
116 Group: System Environment
/Daemons
117 Source0: http
://www.frrouting.org
/releases
/frr
/%{name}-%{frrversion}.tar.gz
118 URL: http
://www.frrouting.org
119 Requires(pre
): /sbin
/install-info
120 Requires(preun
): /sbin
/install-info
121 Requires(post
): /sbin
/install-info
122 BuildRequires
: gcc texi2html texinfo patch libcap
-devel groff
123 BuildRequires
: readline readline
-devel ncurses ncurses
-devel
124 BuildRequires
: json
-c
-devel bison
>= 2.7 flex
make
125 Requires: ncurses json
-c initscripts
127 BuildRequires
: pam
-devel
130 %if "
%{initsystem}"
== "systemd"
131 BuildRequires
: systemd systemd
-devel
132 Requires(post
): systemd
133 Requires(preun
): systemd
134 Requires(postun
): systemd
136 # Initscripts > 5.60 is required for IPv6 support
137 Requires(pre
): initscripts
>= 5.60
139 Provides: routingdaemon
= %{version}-%{release}
140 BuildRoot: %{_tmppath}/%{name}-%{version}-root
141 Obsoletes
: bird gated mrt zebra frr
-sysvinit
144 FRRouting is a free software that manages TCP
/IP based routing
145 protocol. It takes multi
-server and multi
-thread approach to resolve
146 the current complexity of the Internet.
148 FRRouting supports BGP4
, OSPFv2
, OSPFv3
, ISIS
, RIP
, RIPng
, PIM
151 FRRouting is a fork of Quagga.
154 Summary: contrib tools
for frr
155 Group: System Environment
/Daemons
158 Contributed
/3rd party tools which may be of use with frr.
161 Summary: python tools
for frr
162 BuildRequires
: python
163 Requires: python python
-ipaddr
164 Group: System Environment
/Daemons
166 %description pythontools
167 Contributed python
2.7 tools which may be of use with frr.
170 Summary: Header and object files
for frr development
171 Group: System Environment
/Daemons
172 Requires: %{name} = %{version}-%{release}
175 The frr
-devel package contains the header and object files neccessary
for
176 developing OSPF
-API and frr applications.
179 %setup -q
-n frr
-%{frrversion}
183 # For standard gcc verbosity, uncomment these lines:
184 #CFLAGS="%{optflags} -Wall -Wsign-compare -Wpointer-arith"
185 #CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
187 # For ultra gcc verbosity, uncomment these lines also:
188 #CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
189 #CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
190 #CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
191 #CFLAGS="${CFLAGS} -Wpacked -Wpadded"
194 --sbindir
=%{_sbindir} \
195 --sysconfdir
=%{_sysconfdir} \
196 --libdir
=%{_libdir} \
197 --libexecdir
=%{_libexecdir} \
198 --localstatedir
=%{_localstatedir} \
203 %if %{with_multipath}
204 --enable-multipath
=%{with_multipath} \
206 %if %{with_tcp_zebra}
210 %if %{with_ospfclient}
211 --enable-ospfclient \
213 --disable
-ospfclient\
216 --enable-ospfapi
=yes \
218 --enable-ospfapi
=no \
244 --enable-user
=%frr_user \
245 --enable-group
=%frr_user \
248 --enable-vty
-group
=%vty_group \
265 --enable-gcc
-rdynamic \
267 %if "
%{initsystem}"
== "systemd"
268 --enable-systemd
=yes \
272 make %{?_smp_mflags} MAKEINFO
="makeinfo
--no
-split"
275 %if %{texi2htmlversion} < 5
276 texi2html
--number
-sections frr.texi
278 texi2html
--number
-footnotes
--number
-sections frr.texi
283 mkdir -p
%{buildroot}/etc/{frr,sysconfig,logrotate.d,pam.d,default} \
284 %{buildroot}/var/log/frr %{buildroot}%{_infodir}
285 make DESTDIR
=%{buildroot} INSTALL
="
install -p" CP
="cp
-p"
install
287 # Remove this file, as it is uninstalled and causes errors when building on RH9
288 rm -rf
%{buildroot}/usr
/share
/info
/dir
290 # Remove debian init script if it was installed
291 rm -f
%{buildroot}%{_sbindir}/frr
293 # install /etc sources
294 %if "
%{initsystem}"
== "systemd"
295 mkdir -p
%{buildroot}%{_unitdir}
296 install %{zeb_rh_src}/frr.service \
297 %{buildroot}%{_unitdir}/frr.service
298 install %{zeb_rh_src}/frr.init \
299 %{buildroot}%{_sbindir}/frr
301 mkdir -p
%{buildroot}/etc
/rc.d
/init.d
302 install %{zeb_rh_src}/frr.init \
303 %{buildroot}/etc
/rc.d
/init.d
/frr
306 install %{zeb_rh_src}/daemons %{buildroot}/etc
/frr
307 install -m644
%{zeb_rh_src}/frr.pam \
308 %{buildroot}/etc
/pam.d
/frr
309 install -m644
%{zeb_rh_src}/frr.logrotate \
310 %{buildroot}/etc
/logrotate.d
/frr
311 install -d
-m750
%{buildroot}/var
/run
/frr
316 if getent group
%vty_group > /dev
/null
; then : ; else \
317 /usr
/sbin
/groupadd
-r
-g
%vty_gid %vty_group > /dev
/null ||
: ; fi
320 # add frr user and group
322 # Ensure that frr_gid gets correctly allocated
323 if getent group
%frr_user >/dev
/null
; then : ; else \
324 /usr
/sbin
/groupadd
-g
%frr_gid %frr_user > /dev
/null ||
: ; \
326 if getent passwd
%frr_user >/dev
/null
; then : ; else \
327 /usr
/sbin
/useradd
-u
%frr_uid -g
%frr_gid \
328 -M
-r
-s
/sbin
/nologin
-c "FRRouting suite" \
329 -d
%_localstatedir %frr_user 2> /dev
/null ||
: ; \
332 /usr
/sbin
/usermod
-a
-G
%vty_group %frr_user
338 # zebra_spec_add_service <service name> <port/proto> <comment>
339 # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
341 zebra_spec_add_service
()
343 # Add port /etc/services entry if it isn't already there
344 if [ -f
/etc
/services
] && \
345 ! %__sed -e 's
/#.*$//' /etc/services | %__grep -wq $1 ; then
346 echo "$
1 $
2 # $3" >> /etc/services
350 zebra_spec_add_service zebrasrv
2600/tcp "zebra service"
351 zebra_spec_add_service zebra
2601/tcp "zebra vty"
352 zebra_spec_add_service ripd
2602/tcp "RIPd vty"
353 zebra_spec_add_service ripngd
2603/tcp "RIPngd vty"
354 zebra_spec_add_service ospfd
2604/tcp "OSPFd vty"
355 zebra_spec_add_service bgpd
2605/tcp "BGPd vty"
356 zebra_spec_add_service ospf6d
2606/tcp "OSPF6d vty"
358 zebra_spec_add_service ospfapi
2607/tcp "OSPF
-API"
360 zebra_spec_add_service isisd
2608/tcp "ISISd vty"
362 zebra_spec_add_service pimd
2611/tcp "PIMd vty"
365 zebra_spec_add_service ldpd
2612/tcp "LDPd vty"
368 %if "
%{initsystem}"
== "systemd"
369 for daemon
in %all_daemons ; do
370 %systemd_post frr.service
373 /sbin
/chkconfig
--add frr
376 /sbin
/install-info
%{_infodir}/frr.info.gz %{_infodir}/dir
378 # Create dummy files if they don't exist so basic functions can be used.
379 if [ ! -e
%{_sysconfdir}/zebra.conf
]; then
380 echo "hostname `hostname`"
> %{_sysconfdir}/zebra.conf
382 chown
%frr_user:%frr_user %{_sysconfdir}/zebra.conf
*
384 chmod
640 %{_sysconfdir}/zebra.conf
*
386 for daemon
in %{all_daemons} ; do
387 if [ x"$
{daemon
}"
!= x""
] ; then
388 if [ ! -e
%{_sysconfdir}/${daemon}.conf
]; then
389 touch
%{_sysconfdir}/${daemon}.conf
391 chown
%frr_user:%frr_user %{_sysconfdir}/${daemon}.conf
*
397 chown
%frr_user:%frr_user %{_sysconfdir}/daemons
401 # No config for watchfrr - this is part of /etc/sysconfig/frr
402 rm -f
%{_sysconfdir}/watchfrr.
*
405 if [ ! -e
%{_sysconfdir}/vtysh.conf
]; then
406 touch
%{_sysconfdir}/vtysh.conf
407 chmod
640 %{_sysconfdir}/vtysh.conf
410 chown
%{frr_user}:%{vty_group} %{_sysconfdir}/vtysh.conf
*
416 if [ "$
1"
-ge
1 ]; then
418 # Upgrade from older version
420 %if "
%{initsystem}"
== "systemd"
424 %systemd_postun frr.service
429 /etc
/rc.d
/init.d
/frr restart
>/dev
/null
2>&1
434 %if "
%{initsystem}"
== "systemd"
438 if [ "$
1"
= "
0"
]; then
439 for daemon
in %all_daemons ; do
440 if [ x"$
{daemon
}"
!= x""
] ; then
441 %systemd_preun frr.service
449 if [ "$
1"
= "
0"
]; then
450 /etc
/rc.d
/init.d
/frr stop
>/dev
/null
2>&1
451 /sbin
/chkconfig
--del frr
454 /sbin
/install-info
--delete
%{_infodir}/frr.info.gz %{_infodir}/dir
457 %if !0%{?keep_build:1}
462 %defattr(-,root
,root
)
463 %doc */*.sample
* AUTHORS COPYING
466 %doc ChangeLog INSTALL NEWS README REPORTING
-BUGS SERVICES
468 %dir %attr(751,%frr_user,%frr_user) %{_sysconfdir}
469 %dir %attr(750,%frr_user,%frr_user) /var
/log
/frr
470 %dir %attr(751,%frr_user,%frr_user) /var
/run
/frr
472 %dir %attr(750,root
,root
) %{_sysconfdir}
473 %dir %attr(750,root
,root
) /var
/log
/frr
474 %dir %attr(750,root
,root
) /var
/run
/frr
477 %attr(750,%frr_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
479 %{_infodir}/frr.info.gz
485 %exclude %{_sbindir}/ssd
501 %attr(755,root
,root
) %{_libdir}/lib
*.so
.0.
*
504 %config(noreplace
) /etc
/frr
/[!v
]*.conf
*
505 %config(noreplace
) %attr(750,%frr_user,%frr_user) /etc
/frr
/daemons
506 %if "
%{initsystem}"
== "systemd"
507 %config %{_unitdir}/frr.service
510 %config /etc
/rc.d
/init.d
/frr
512 %config(noreplace
) /etc
/pam.d
/frr
513 %config(noreplace
) %attr(640,root
,root
) /etc
/logrotate.d
/*
516 %defattr(-,root
,root
)
520 %defattr(-,root
,root
)
521 %{_sbindir}/frr
-reload.py
522 %{_sbindir}/frr
-reload.pyc
523 %{_sbindir}/frr
-reload.pyo
526 %defattr(-,root
,root
)
527 %if %{with_ospfclient}
528 %{_sbindir}/ospfclient
532 %dir %attr(755,root
,root
) %{_includedir}/%{name}
533 %{_includedir}/%name/*.h
534 %dir %attr(755,root
,root
) %{_includedir}/%{name}/ospfd
535 %{_includedir}/%name/ospfd
/*.h
537 %dir %attr(755,root
,root
) %{_includedir}/%{name}/ospfapi
538 %{_includedir}/%name/ospfapi
/*.h
542 * Mon Apr
17 2017 Martin Winter
<mwinter@opensourcerouting.org
> - %{version}
543 - new subpackage frr
-pythontools with python
2.7 restart script
544 - remove PIMd from CentOS
/RedHat
6 RPM packages
(won't work
- too old
)
545 - converted to single frr init script
(not per daemon
) based on debian init script
546 - created systemd service file
for systemd based systems
(which uses init script
)
547 - Various other RPM package fixes
for FRR
2.0
549 * Fri Jan
6 2017 Martin Winter
<mwinter@opensourcerouting.org
>
550 - Renamed to frr
for FRRouting fork of Quagga
552 * Thu Feb
11 2016 Paul Jakma
<paul@jakma.org
>
553 - remove with_ipv6 conditionals
, always build v6
554 - Fix UTF
-8 char
in spec changelog
555 - remove quagga.pam.stack
, long deprecated.
557 * Thu Oct
22 2015 Martin Winter
<mwinter@opensourcerouting.org
>
558 - Cleanup configure
: remove
--enable-ipv6
(default now
), --enable-nssa
,
560 - Remove support
for old fedora
4/5
561 - Fix
for package nameing
562 - Fix Weekdays of previous changelogs
(bogus dates
)
563 - Add conditional logic to only build tex footnotes with supported texi2html
564 - Added pimd to files section and fix double listing of
/var
/lib
*/quagga
565 - Numerous fixes to unify upstart
/systemd startup into same spec file
566 - Only allow use of watchfrr
for non
-systemd systems. no need with systemd
568 * Fri Sep
4 2015 Paul Jakma
<paul@jakma.org
>
570 - add a default define
for with_pimd
572 * Mon Sep
12 2005 Paul Jakma
<paul@dishone.st
>
573 - Steal some changes from Fedora spec file
:
574 - Add with_rtadv variable
575 - Test
for groups
/users with getent before group
/user adding
576 - Readline need not be an explicit prerequisite
577 - install-info delete should be postun
, not preun
579 * Wed Jan
12 2005 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
580 - on package upgrade
, implement careful
, phased restart logic
581 - use gcc
-rdynamic flag when linking
for better backtraces
583 * Wed Dec
22 2004 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
584 - daemonv6_list should contain only IPv6 daemons
586 * Wed Dec
22 2004 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
588 - on upgrade
, all daemons should be condrestart'ed
589 - on removal
, all daemons should be stopped
591 * Mon Nov
08 2004 Paul Jakma
<paul@dishone.st
>
592 - Use makeinfo
--html to generate quagga.html
594 * Sun Nov
07 2004 Paul Jakma
<paul@dishone.st
>
595 - Fix with_ipv6
set to
0 build
597 * Sat Oct
23 2004 Paul Jakma
<paul@dishone.st
>
600 * Sat Oct
23 2004 Andrew J. Schorr
<aschorr@telemetry
-investments.com
>
601 - Make directories be owned by the packages concerned
602 - Update logrotate scripts to use correct path to killall and use pid files
604 * Fri Oct
08 2004 Paul Jakma
<paul@dishone.st
>
607 * Wed Sep
15 2004 Paul Jakma
<paul@dishone.st
>
608 - build snmp support by default
610 - build with shared libs
611 - devel subpackage
for archives and headers
613 * Thu Jan
08 2004 Paul Jakma
<paul@dishone.st
>
614 - updated sysconfig files to specify
local dir
615 - added ospf_dump.c crash quick fix patch
616 - added ospfd persistent interface configuration patch
618 * Tue Dec
30 2003 Paul Jakma
<paul@dishone.st
>
620 - integrate RH sysconfig patch to specify daemon options
(RH
)
621 - default to have vty listen only to
127.1 (RH
)
622 - add user with fixed UID
/GID
(RH
)
623 - create user with shell
/sbin
/nologin rather than
/bin
/false
(RH
)
624 - stop daemons on uninstall
(RH
)
625 - delete info file on preun
, not postun to avoid deletion on upgrade.
(RH
)
627 - cleanup tasks carried out
for every daemon
629 * Sun Nov
2 2003 Paul Jakma
<paul@dishone.st
>
630 - Fix
-devel package to include all files
633 * Tue Aug
12 2003 Paul Jakma
<paul@dishone.st
>
635 - Sync to Quagga release
0.96
637 * Thu Mar
20 2003 Paul Jakma
<paul@dishone.st
>
638 - zebra privileges support
640 * Tue Mar
18 2003 Paul Jakma
<paul@dishone.st
>
641 - Fix mem leak
in 'show thread cpu'
642 - Ralph Keller's OSPF
-API
643 - Amir
: Fix configure.ac
for net
-snmp
645 * Sat Mar
1 2003 Paul Jakma
<paul@dishone.st
>
646 - ospfd IOS prefix to interface matching
for 'network' statement
647 - temporary fix
for PtP and IPv6
648 - sync to zebra.org CVS
650 * Mon Jan
20 2003 Paul Jakma
<paul@dishone.st
>
651 - update to latest cvs
652 - Yon's "show thread cpu" patch
- 17217
653 - walk up tree
- 17218
654 - ospfd NSSA fixes
- 16681
655 - ospfd nsm fixes
- 16824
656 - ospfd OLSA fixes and new feature
- 16823
657 - KAME and ifindex fixes
- 16525
658 - spec file changes to allow redhat files to be
in tree
660 * Sat Dec
28 2002 Alexander Hoogerhuis
<alexh@ihatent.com
>
661 - Added conditionals
for building with
(out
) IPv6
, vtysh
, RIP
, BGP
662 - Fixed up some build requirements
(patch
)
663 - Added conditional build requirements
for vtysh
/ snmp
664 - Added conditional to files
for _bindir depending on vtysh
666 * Mon Nov
11 2002 Paul Jakma
<paulj@alphyra.ie
>
667 - update to latest CVS
668 - add Greg Troxel's md5 buffer copy
/dup fix
670 - add Frank's multicast flag fix
672 * Wed Oct
09 2002 Paul Jakma
<paulj@alphyra.ie
>
673 - update to latest CVS
674 - timestamped crypt_seqnum patch
677 * Mon Sep
30 2002 Paul Jakma
<paulj@alphyra.ie
>
678 - update to latest CVS
679 - add vtysh 'write
-config
(integrated|daemon
)' patch
680 - always '
make rebuild'
in vtysh
/ to catch new commands
682 * Fri Sep
13 2002 Paul Jakma
<paulj@alphyra.ie
>
685 * Wed Sep
11 2002 Paul Jakma
<paulj@alphyra.ie
>
686 - update to latest CVS
687 - add "
/sbin
/ip route flush proto zebra" to zebra RH init on startup
689 * Sat Aug
24 2002 Paul Jakma
<paulj@alphyra.ie
>
690 - update to current CVS
691 - add OSPF point to multipoint patch
693 - add BGP
hash optimisation patch
695 * Fri Jun
14 2002 Paul Jakma
<paulj@alphyra.ie
>
696 - update to
0.93-pre1
/ CVS
697 - add link state detection support
698 - add generic PtP and RFC3021 support
701 * Thu Aug
09 2001 Elliot Lee
<sopwith@redhat.com
> 0.91a
-6
704 * Wed Aug
1 2001 Trond Eivind Glomsrød
<teg@redhat.com
> 0.91a
-5
705 - Use generic initscript strings instead of initscript specific
706 ( "Starting foo
: "
-> "Starting $prog
:"
)
708 * Fri Jul
27 2001 Elliot Lee
<sopwith@redhat.com
> 0.91a
-4
709 - Bump the release when rebuilding into the dist.
711 * Tue Feb
6 2001 Tim Powers
<timp@redhat.com
>
712 - built
for Powertools
714 * Sun Feb
4 2001 Pekka Savola
<pekkas@netcore.
fi>
715 - Hacked up from PLD Linux
0.90-1, Mandrake
0.90-1mdk and one from zebra.org.
717 - Very heavy modifications to init.d
/*, .spec
, pam
, i18n
, logrotate
, etc.
718 - Should be quite Red Hat'isque now.