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 for systemd or init.d (upstart)
47 # Check for init.d (upstart) as used in CentOS 6 or systemd (ie CentOS 7)
48 %if 0%{?fedora} >= 15 || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
49 %global initsystem systemd
51 %if (0%{?fedora} && 0%{?fedora} < 15) || (0%{?rhel} && 0%{?rhel} < 7)
52 %global initsystem upstart
54 %{expand: %%global initsystem %(if [[ `/sbin/init --version 2> /dev/null` =~ upstart ]]; then echo upstart; elif [[ `readlink -f /sbin/init` = /usr/lib/systemd/systemd ]]; then echo systemd; elif [[ `systemctl` =~ -\.mount ]]; then echo systemd; fi)}
58 # If init system is systemd, then always disable watchfrr
60 %if "
%{initsystem}"
== "systemd"
61 # Note: For systems with systemd, watchfrr will NOT be built. Systemd
62 # takes over the role of restarting crashed processes. Value will
63 # be overwritten with 0 below for systemd independent on the setting here
64 %global with_watchfrr
1
67 #### Check for RedHat 6.x or CentOS 6.x - they are too old to support PIM.
68 #### Always disable it on these old systems unconditionally
70 # if CentOS / RedHat and version < 7, then disable PIMd (too old, won't work)
71 %if 0%{?rhel} && 0%{?rhel} < 7
75 # if FPM is enabled, then enable tcp_zebra as well
78 %global with_tcp_zebra
1
81 # misc internal defines
82 %{!?frr_uid: %global frr_uid 92 }
83 %{!?frr_gid: %global frr_gid 92 }
84 %{!?vty_gid: %global vty_gid 85 }
86 %define daemon_list zebra ripd ospfd bgpd isisd ripngd ospf6d
89 %define daemon_ldpd ldpd
91 %define daemon_ldpd ""
95 %define daemon_pimd pimd
97 %define daemon_pimd ""
101 %define daemon_watchfrr watchfrr
103 %define daemon_watchfrr ""
106 %define all_daemons
%{daemon_list} %{daemon_ldpd} %{daemon_pimd} %{daemon_watchfrr}
108 # allow build dir to be kept
109 %{!?keep_build: %global keep_build 0 }
111 #release sub-revision (the two digits after the CONFDATE)
112 %{!?release_rev: %global release_rev 01 }
114 Summary: Routing daemon
116 Version: %{rpmversion}
117 Release: @CONFDATE@
%{release_rev}%{?dist}
119 Group: System Environment
/Daemons
120 Source0: http
://www.frrouting.org
/releases
/frr
/%{name}-%{frrversion}.tar.gz
121 URL: http
://www.frrouting.org
122 Requires(pre
): /sbin
/install-info
123 Requires(preun
): /sbin
/install-info
124 Requires(post
): /sbin
/install-info
125 BuildRequires
: gcc texi2html texinfo patch libcap
-devel groff
126 BuildRequires
: readline readline
-devel ncurses ncurses
-devel
127 BuildRequires
: json
-c
-devel bison
>= 2.7 flex
make
128 Requires: ncurses json
-c initscripts
130 BuildRequires
: pam
-devel
133 %if "
%{initsystem}"
== "systemd"
134 BuildRequires
: systemd systemd
-devel
135 Requires(post
): systemd
136 Requires(preun
): systemd
137 Requires(postun
): systemd
139 # Initscripts > 5.60 is required for IPv6 support
140 Requires(pre
): initscripts
>= 5.60
142 Provides: routingdaemon
= %{version}-%{release}
143 BuildRoot: %{_tmppath}/%{name}-%{version}-root
144 Obsoletes
: bird gated mrt zebra frr
-sysvinit
147 FRRouting is a free software that manages TCP
/IP based routing
148 protocol. It takes multi
-server and multi
-thread approach to resolve
149 the current complexity of the Internet.
151 FRRouting supports BGP4
, OSPFv2
, OSPFv3
, ISIS
, RIP
, RIPng
, PIM
154 FRRouting is a fork of Quagga.
157 Summary: contrib tools
for frr
158 Group: System Environment
/Daemons
161 Contributed
/3rd party tools which may be of use with frr.
164 Summary: python tools
for frr
165 BuildRequires
: python
166 Requires: python python
-ipaddr
167 Group: System Environment
/Daemons
169 %description pythontools
170 Contributed python
2.7 tools which may be of use with frr.
173 Summary: Header and object files
for frr development
174 Group: System Environment
/Daemons
175 Requires: %{name} = %{version}-%{release}
178 The frr
-devel package contains the header and object files neccessary
for
179 developing OSPF
-API and frr applications.
182 %setup -q
-n frr
-%{frrversion}
186 # For standard gcc verbosity, uncomment these lines:
187 #CFLAGS="%{optflags} -Wall -Wsign-compare -Wpointer-arith"
188 #CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
190 # For ultra gcc verbosity, uncomment these lines also:
191 #CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
192 #CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
193 #CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
194 #CFLAGS="${CFLAGS} -Wpacked -Wpadded"
197 --sbindir
=%{_sbindir} \
198 --sysconfdir
=%{_sysconfdir} \
199 --libdir
=%{_libdir} \
200 --libexecdir
=%{_libexecdir} \
201 --localstatedir
=%{_localstatedir} \
206 %if %{with_multipath}
207 --enable-multipath
=%{with_multipath} \
209 %if %{with_tcp_zebra}
213 %if %{with_ospfclient}
214 --enable-ospfclient \
216 --disable
-ospfclient\
219 --enable-ospfapi
=yes \
221 --enable-ospfapi
=no \
247 --enable-user
=%frr_user \
248 --enable-group
=%frr_user \
251 --enable-vty
-group
=%vty_group \
269 %if "
%{initsystem}"
== "systemd"
270 --enable-systemd
=yes \
274 make %{?_smp_mflags} MAKEINFO
="makeinfo
--no
-split"
277 if [ $
(texi2html
--version | cut
-d.
-f1
) -lt
5 ]; then
278 texi2html
--number
-sections frr.texi
280 texi2html
--number
-footnotes
--number
-sections frr.texi
285 mkdir -p
%{buildroot}/etc/{frr,sysconfig,logrotate.d,pam.d,default} \
286 %{buildroot}/var/log/frr %{buildroot}%{_infodir}
287 make DESTDIR
=%{buildroot} INSTALL
="
install -p" CP
="cp
-p"
install
289 # Remove this file, as it is uninstalled and causes errors when building on RH9
290 rm -rf
%{buildroot}/usr
/share
/info
/dir
292 # Remove debian init script if it was installed
293 rm -f
%{buildroot}%{_sbindir}/frr
295 # install /etc sources
296 %if "
%{initsystem}"
== "systemd"
297 mkdir -p
%{buildroot}%{_unitdir}
298 install %{zeb_rh_src}/frr.service \
299 %{buildroot}%{_unitdir}/frr.service
300 install %{zeb_rh_src}/frr.init \
301 %{buildroot}%{_sbindir}/frr
303 mkdir -p
%{buildroot}/etc
/rc.d
/init.d
304 install %{zeb_rh_src}/frr.init \
305 %{buildroot}/etc
/rc.d
/init.d
/frr
308 install %{zeb_rh_src}/daemons %{buildroot}/etc
/frr
309 install -m644
%{zeb_rh_src}/frr.pam \
310 %{buildroot}/etc
/pam.d
/frr
311 install -m644
%{zeb_rh_src}/frr.logrotate \
312 %{buildroot}/etc
/logrotate.d
/frr
313 install -d
-m750
%{buildroot}/var
/run
/frr
318 if getent group
%vty_group > /dev
/null
; then : ; else \
319 /usr
/sbin
/groupadd
-r
-g
%vty_gid %vty_group > /dev
/null ||
: ; fi
322 # add frr user and group
324 # Ensure that frr_gid gets correctly allocated
325 if getent group
%frr_user >/dev
/null
; then : ; else \
326 /usr
/sbin
/groupadd
-g
%frr_gid %frr_user > /dev
/null ||
: ; \
328 if getent passwd
%frr_user >/dev
/null
; then : ; else \
329 /usr
/sbin
/useradd
-u
%frr_uid -g
%frr_gid \
330 -M
-r
-s
/sbin
/nologin
-c "FRRouting suite" \
331 -d
%_localstatedir %frr_user 2> /dev
/null ||
: ; \
334 /usr
/sbin
/usermod
-a
-G
%vty_group %frr_user
340 # zebra_spec_add_service <service name> <port/proto> <comment>
341 # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
343 zebra_spec_add_service
()
345 # Add port /etc/services entry if it isn't already there
346 if [ -f
/etc
/services
] && \
347 ! %__sed -e 's
/#.*$//' /etc/services | %__grep -wq $1 ; then
348 echo "$
1 $
2 # $3" >> /etc/services
352 zebra_spec_add_service zebrasrv
2600/tcp "zebra service"
353 zebra_spec_add_service zebra
2601/tcp "zebra vty"
354 zebra_spec_add_service ripd
2602/tcp "RIPd vty"
355 zebra_spec_add_service ripngd
2603/tcp "RIPngd vty"
356 zebra_spec_add_service ospfd
2604/tcp "OSPFd vty"
357 zebra_spec_add_service bgpd
2605/tcp "BGPd vty"
358 zebra_spec_add_service ospf6d
2606/tcp "OSPF6d vty"
360 zebra_spec_add_service ospfapi
2607/tcp "OSPF
-API"
362 zebra_spec_add_service isisd
2608/tcp "ISISd vty"
364 zebra_spec_add_service pimd
2611/tcp "PIMd vty"
367 zebra_spec_add_service ldpd
2612/tcp "LDPd vty"
370 %if "
%{initsystem}"
== "systemd"
371 for daemon
in %all_daemons ; do
372 %systemd_post frr.service
375 /sbin
/chkconfig
--add frr
378 /sbin
/install-info
%{_infodir}/frr.info.gz %{_infodir}/dir
380 # Create dummy files if they don't exist so basic functions can be used.
381 if [ ! -e
%{_sysconfdir}/zebra.conf
]; then
382 echo "hostname `hostname`"
> %{_sysconfdir}/zebra.conf
384 chown
%frr_user:%frr_user %{_sysconfdir}/zebra.conf
*
386 chmod
640 %{_sysconfdir}/zebra.conf
*
388 for daemon
in %{all_daemons} ; do
389 if [ x"$
{daemon
}"
!= x""
] ; then
390 if [ ! -e
%{_sysconfdir}/${daemon}.conf
]; then
391 touch
%{_sysconfdir}/${daemon}.conf
393 chown
%frr_user:%frr_user %{_sysconfdir}/${daemon}.conf
*
399 chown
%frr_user:%frr_user %{_sysconfdir}/daemons
403 # No config for watchfrr - this is part of /etc/sysconfig/frr
404 rm -f
%{_sysconfdir}/watchfrr.
*
407 if [ ! -e
%{_sysconfdir}/vtysh.conf
]; then
408 touch
%{_sysconfdir}/vtysh.conf
409 chmod
640 %{_sysconfdir}/vtysh.conf
412 chown
%{frr_user}:%{vty_group} %{_sysconfdir}/vtysh.conf
*
418 if [ "$
1"
-ge
1 ]; then
420 # Upgrade from older version
422 %if "
%{initsystem}"
== "systemd"
426 %systemd_postun frr.service
431 /etc
/rc.d
/init.d
/frr restart
>/dev
/null
2>&1
437 %if "
%{initsystem}"
== "systemd"
441 if [ "$
1"
= "
0"
]; then
442 for daemon
in %all_daemons ; do
443 if [ x"$
{daemon
}"
!= x""
] ; then
444 %systemd_preun frr.service
452 if [ "$
1"
= "
0"
]; then
453 /etc
/rc.d
/init.d
/frr stop
>/dev
/null
2>&1
454 /sbin
/chkconfig
--del frr
457 /sbin
/install-info
--delete
%{_infodir}/frr.info.gz %{_infodir}/dir
460 %if !0%{?keep_build:1}
465 %defattr(-,root
,root
)
466 %doc */*.sample
* AUTHORS COPYING
469 %doc ChangeLog INSTALL NEWS README REPORTING
-BUGS SERVICES
471 %dir %attr(751,%frr_user,%frr_user) %{_sysconfdir}
472 %dir %attr(750,%frr_user,%frr_user) /var
/log
/frr
473 %dir %attr(751,%frr_user,%frr_user) /var
/run
/frr
475 %dir %attr(750,root
,root
) %{_sysconfdir}
476 %dir %attr(750,root
,root
) /var
/log
/frr
477 %dir %attr(750,root
,root
) /var
/run
/frr
480 %attr(750,%frr_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
482 %{_infodir}/frr.info.gz
488 %exclude %{_sbindir}/ssd
504 %attr(755,root
,root
) %{_libdir}/lib
*.so
.0.
*
507 %config(noreplace
) /etc
/frr
/[!v
]*.conf
*
508 %config(noreplace
) %attr(750,%frr_user,%frr_user) /etc
/frr
/daemons
509 %if "
%{initsystem}"
== "systemd"
510 %config %{_unitdir}/frr.service
513 %config /etc
/rc.d
/init.d
/frr
515 %config(noreplace
) /etc
/pam.d
/frr
516 %config(noreplace
) %attr(640,root
,root
) /etc
/logrotate.d
/*
519 %defattr(-,root
,root
)
523 %defattr(-,root
,root
)
524 %{_sbindir}/frr
-reload.py
525 %{_sbindir}/frr
-reload.pyc
526 %{_sbindir}/frr
-reload.pyo
529 %defattr(-,root
,root
)
530 %if %{with_ospfclient}
531 %{_sbindir}/ospfclient
535 %dir %attr(755,root
,root
) %{_includedir}/%{name}
536 %{_includedir}/%name/*.h
537 %dir %attr(755,root
,root
) %{_includedir}/%{name}/ospfd
538 %{_includedir}/%name/ospfd
/*.h
540 %dir %attr(755,root
,root
) %{_includedir}/%{name}/ospfapi
541 %{_includedir}/%name/ospfapi
/*.h
545 * Mon Apr
17 2017 Martin Winter
<mwinter@opensourcerouting.org
> - %{version}
546 - new subpackage frr
-pythontools with python
2.7 restart script
547 - remove PIMd from CentOS
/RedHat
6 RPM packages
(won't work
- too old
)
548 - converted to single frr init script
(not per daemon
) based on debian init script
549 - created systemd service file
for systemd based systems
(which uses init script
)
550 - Various other RPM package fixes
for FRR
2.0
552 * Fri Jan
6 2017 Martin Winter
<mwinter@opensourcerouting.org
>
553 - Renamed to frr
for FRRouting fork of Quagga
555 * Thu Feb
11 2016 Paul Jakma
<paul@jakma.org
>
556 - remove with_ipv6 conditionals
, always build v6
557 - Fix UTF
-8 char
in spec changelog
558 - remove quagga.pam.stack
, long deprecated.
560 * Thu Oct
22 2015 Martin Winter
<mwinter@opensourcerouting.org
>
561 - Cleanup configure
: remove
--enable-ipv6
(default now
), --enable-nssa
,
563 - Remove support
for old fedora
4/5
564 - Fix
for package nameing
565 - Fix Weekdays of previous changelogs
(bogus dates
)
566 - Add conditional logic to only build tex footnotes with supported texi2html
567 - Added pimd to files section and fix double listing of
/var
/lib
*/quagga
568 - Numerous fixes to unify upstart
/systemd startup into same spec file
569 - Only allow use of watchfrr
for non
-systemd systems. no need with systemd
571 * Fri Sep
4 2015 Paul Jakma
<paul@jakma.org
>
573 - add a default define
for with_pimd
575 * Mon Sep
12 2005 Paul Jakma
<paul@dishone.st
>
576 - Steal some changes from Fedora spec file
:
577 - Add with_rtadv variable
578 - Test
for groups
/users with getent before group
/user adding
579 - Readline need not be an explicit prerequisite
580 - install-info delete should be postun
, not preun
582 * Wed Jan
12 2005 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
583 - on package upgrade
, implement careful
, phased restart logic
584 - use gcc
-rdynamic flag when linking
for better backtraces
586 * Wed Dec
22 2004 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
587 - daemonv6_list should contain only IPv6 daemons
589 * Wed Dec
22 2004 Andrew J. Schorr
<ajschorr@alumni.princeton.edu
>
591 - on upgrade
, all daemons should be condrestart'ed
592 - on removal
, all daemons should be stopped
594 * Mon Nov
08 2004 Paul Jakma
<paul@dishone.st
>
595 - Use makeinfo
--html to generate quagga.html
597 * Sun Nov
07 2004 Paul Jakma
<paul@dishone.st
>
598 - Fix with_ipv6
set to
0 build
600 * Sat Oct
23 2004 Paul Jakma
<paul@dishone.st
>
603 * Sat Oct
23 2004 Andrew J. Schorr
<aschorr@telemetry
-investments.com
>
604 - Make directories be owned by the packages concerned
605 - Update logrotate scripts to use correct path to killall and use pid files
607 * Fri Oct
08 2004 Paul Jakma
<paul@dishone.st
>
610 * Wed Sep
15 2004 Paul Jakma
<paul@dishone.st
>
611 - build snmp support by default
613 - build with shared libs
614 - devel subpackage
for archives and headers
616 * Thu Jan
08 2004 Paul Jakma
<paul@dishone.st
>
617 - updated sysconfig files to specify
local dir
618 - added ospf_dump.c crash quick fix patch
619 - added ospfd persistent interface configuration patch
621 * Tue Dec
30 2003 Paul Jakma
<paul@dishone.st
>
623 - integrate RH sysconfig patch to specify daemon options
(RH
)
624 - default to have vty listen only to
127.1 (RH
)
625 - add user with fixed UID
/GID
(RH
)
626 - create user with shell
/sbin
/nologin rather than
/bin
/false
(RH
)
627 - stop daemons on uninstall
(RH
)
628 - delete info file on preun
, not postun to avoid deletion on upgrade.
(RH
)
630 - cleanup tasks carried out
for every daemon
632 * Sun Nov
2 2003 Paul Jakma
<paul@dishone.st
>
633 - Fix
-devel package to include all files
636 * Tue Aug
12 2003 Paul Jakma
<paul@dishone.st
>
638 - Sync to Quagga release
0.96
640 * Thu Mar
20 2003 Paul Jakma
<paul@dishone.st
>
641 - zebra privileges support
643 * Tue Mar
18 2003 Paul Jakma
<paul@dishone.st
>
644 - Fix mem leak
in 'show thread cpu'
645 - Ralph Keller's OSPF
-API
646 - Amir
: Fix configure.ac
for net
-snmp
648 * Sat Mar
1 2003 Paul Jakma
<paul@dishone.st
>
649 - ospfd IOS prefix to interface matching
for 'network' statement
650 - temporary fix
for PtP and IPv6
651 - sync to zebra.org CVS
653 * Mon Jan
20 2003 Paul Jakma
<paul@dishone.st
>
654 - update to latest cvs
655 - Yon's "show thread cpu" patch
- 17217
656 - walk up tree
- 17218
657 - ospfd NSSA fixes
- 16681
658 - ospfd nsm fixes
- 16824
659 - ospfd OLSA fixes and new feature
- 16823
660 - KAME and ifindex fixes
- 16525
661 - spec file changes to allow redhat files to be
in tree
663 * Sat Dec
28 2002 Alexander Hoogerhuis
<alexh@ihatent.com
>
664 - Added conditionals
for building with
(out
) IPv6
, vtysh
, RIP
, BGP
665 - Fixed up some build requirements
(patch
)
666 - Added conditional build requirements
for vtysh
/ snmp
667 - Added conditional to files
for _bindir depending on vtysh
669 * Mon Nov
11 2002 Paul Jakma
<paulj@alphyra.ie
>
670 - update to latest CVS
671 - add Greg Troxel's md5 buffer copy
/dup fix
673 - add Frank's multicast flag fix
675 * Wed Oct
09 2002 Paul Jakma
<paulj@alphyra.ie
>
676 - update to latest CVS
677 - timestamped crypt_seqnum patch
680 * Mon Sep
30 2002 Paul Jakma
<paulj@alphyra.ie
>
681 - update to latest CVS
682 - add vtysh 'write
-config
(integrated|daemon
)' patch
683 - always '
make rebuild'
in vtysh
/ to catch new commands
685 * Fri Sep
13 2002 Paul Jakma
<paulj@alphyra.ie
>
688 * Wed Sep
11 2002 Paul Jakma
<paulj@alphyra.ie
>
689 - update to latest CVS
690 - add "
/sbin
/ip route flush proto zebra" to zebra RH init on startup
692 * Sat Aug
24 2002 Paul Jakma
<paulj@alphyra.ie
>
693 - update to current CVS
694 - add OSPF point to multipoint patch
696 - add BGP
hash optimisation patch
698 * Fri Jun
14 2002 Paul Jakma
<paulj@alphyra.ie
>
699 - update to
0.93-pre1
/ CVS
700 - add link state detection support
701 - add generic PtP and RFC3021 support
704 * Thu Aug
09 2001 Elliot Lee
<sopwith@redhat.com
> 0.91a
-6
707 * Wed Aug
1 2001 Trond Eivind Glomsrød
<teg@redhat.com
> 0.91a
-5
708 - Use generic initscript strings instead of initscript specific
709 ( "Starting foo
: "
-> "Starting $prog
:"
)
711 * Fri Jul
27 2001 Elliot Lee
<sopwith@redhat.com
> 0.91a
-4
712 - Bump the release when rebuilding into the dist.
714 * Tue Feb
6 2001 Tim Powers
<timp@redhat.com
>
715 - built
for Powertools
717 * Sun Feb
4 2001 Pekka Savola
<pekkas@netcore.
fi>
718 - Hacked up from PLD Linux
0.90-1, Mandrake
0.90-1mdk and one from zebra.org.
720 - Very heavy modifications to init.d
/*, .spec
, pam
, i18n
, logrotate
, etc.
721 - Should be quite Red Hat'isque now.