-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathfrr.spec.in
2042 lines (1878 loc) · 70 KB
/
frr.spec.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# configure options
#
# Some can be overridden on rpmbuild commandline with:
# rpmbuild --define 'variable value'
# (use any value, ie 1 for flag "with_XXXX" definitions)
#
# E.g. rpmbuild --define 'release_rev 02' may be useful if building
# rpms again and again on the same day, so the newer rpms can be installed.
# bumping the number each time.
#################### FRRouting (FRR) configure options #####################
# with-feature options
%{!?with_babeld: %global with_babeld 1 }
%{!?with_bfdd: %global with_bfdd 1 }
%{!?with_bgp_vnc: %global with_bgp_vnc 0 }
%{!?with_cumulus: %global with_cumulus 0 }
%{!?with_eigrpd: %global with_eigrpd 1 }
%{!?with_fpm: %global with_fpm 1 }
%{!?with_mgmtd_test_be_client: %global with_mgmtd_test_be_client 0 }
%{!?with_ldpd: %global with_ldpd 1 }
%{!?with_multipath: %global with_multipath 256 }
%{!?with_nhrpd: %global with_nhrpd 1 }
%{!?with_ospfapi: %global with_ospfapi 1 }
%{!?with_ospfclient: %global with_ospfclient 1 }
%{!?with_pam: %global with_pam 0 }
%{!?with_pbrd: %global with_pbrd 1 }
%{!?with_pimd: %global with_pimd 1 }
%{!?with_pim6d: %global with_pim6d 1 }
%{!?with_vrrpd: %global with_vrrpd 1 }
%{!?with_rtadv: %global with_rtadv 1 }
%{!?with_watchfrr: %global with_watchfrr 1 }
%{!?with_pathd: %global with_pathd 1 }
%{!?with_grpc: %global with_grpc 0 }
%{!?with_rpki: %global with_rpki 1 }
%{!?with_docs: %global with_docs 1 }
# user and group
%{!?frr_user: %global frr_user frr }
%{!?vty_group: %global vty_group frrvty }
# path defines
%define configdir %{_sysconfdir}/%{name}
%define _sbindir /usr/lib/frr
%define zeb_src %{_builddir}/%{name}-%{frrversion}
%define zeb_rh_src %{zeb_src}/redhat
%define zeb_docs %{zeb_src}/doc
%define frr_tools %{zeb_src}/tools
%if 0%{!?_runstatedir:1}
%define _runstatedir %{_localstatedir}/run
%endif
############################################################################
#### Version String tweak
# Remove invalid characters form version string and replace with _
%{expand: %%global rpmversion %(echo '@VERSION@' | tr [:blank:]- _ )}
%define frrversion @VERSION@
#### Check for systemd or init.d (upstart)
# Check for init.d (upstart) as used in CentOS 6 or systemd (ie CentOS 7)
%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
%global initsystem systemd
%else
%if 0%{?rhel} && 0%{?rhel} < 7
%global initsystem upstart
%else
%{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)}
%endif
%endif
# Check for python version - use python2.7 on CentOS 6, otherwise python3
%if 0%{?rhel} && 0%{?rhel} < 7
%global use_python2 1
%else
%global use_python2 0
%endif
# If init system is systemd, then always enable watchfrr
%if "%{initsystem}" == "systemd"
%global with_watchfrr 1
%endif
#### Check for RedHat 6.x or CentOS 6.x - they are too old to support PIM.
#### Always disable it on these old systems unconditionally
#
# if CentOS / RedHat and version < 7, then disable PIMd (too old, won't work)
%if 0%{?rhel} && 0%{?rhel} < 7
%global with_pimd 0
%global with_pim6d 0
%endif
# misc internal defines
%{!?frr_uid: %global frr_uid 92 }
%{!?frr_gid: %global frr_gid 92 }
%{!?vty_gid: %global vty_gid 85 }
%define daemon_list zebra ripd ospfd bgpd isisd ripngd ospf6d pbrd staticd bfdd fabricd pathd
%if %{with_ldpd}
%define daemon_ldpd ldpd
%else
%define daemon_ldpd ""
%endif
%if %{with_pimd}
%define daemon_pimd pimd
%else
%define daemon_pimd ""
%endif
%if %{with_pim6d}
%define daemon_pim6d pim6d
%else
%define daemon_pim6d ""
%endif
%if %{with_pbrd}
%define daemon_pbrd pbrd
%else
%define daemon_pbrd ""
%endif
%if %{with_nhrpd}
%define daemon_nhrpd nhrpd
%else
%define daemon_nhrpd ""
%endif
%if %{with_eigrpd}
%define daemon_eigrpd eigrpd
%else
%define daemon_eigrpd ""
%endif
%if %{with_babeld}
%define daemon_babeld babeld
%else
%define daemon_babeld ""
%endif
%if %{with_vrrpd}
%define daemon_vrrpd vrrpd
%else
%define daemon_vrrpd ""
%endif
%if %{with_watchfrr}
%define daemon_watchfrr watchfrr
%else
%define daemon_watchfrr ""
%endif
%if %{with_bfdd}
%define daemon_bfdd bfdd
%else
%define daemon_bfdd ""
%endif
%if %{with_pathd}
%define daemon_pathd pathd
%else
%define daemon_pathd ""
%endif
%define all_daemons %{daemon_list} %{daemon_ldpd} %{daemon_pimd} %{daemon_pim6d} %{daemon_nhrpd} %{daemon_eigrpd} %{daemon_babeld} %{daemon_watchfrr} %{daemon_pbrd} %{daemon_bfdd} %{daemon_vrrpd} %{daemon_pathd}
#release sub-revision (the two digits after the CONFDATE)
%{!?release_rev: %global release_rev 01 }
Summary: Routing daemon
Name: frr
Version: %{rpmversion}
Release: %{release_rev}%{?dist}
License: GPLv2+
Group: System Environment/Daemons
Source0: https://github.com/FRRouting/frr/archive/%{name}-%{frrversion}.tar.gz
URL: https://www.frrouting.org
Requires(pre): shadow-utils
Requires(preun): info
Requires(post): info
BuildRequires: bison >= 2.7
BuildRequires: c-ares-devel
BuildRequires: flex
BuildRequires: gcc
BuildRequires: json-c-devel
BuildRequires: libcap-devel
BuildRequires: protobuf-c-devel
BuildRequires: make
BuildRequires: ncurses-devel
BuildRequires: readline-devel
BuildRequires: texinfo
BuildRequires: libyang-devel >= 2.1.128
# Version requirement don't get reflected down from a BuildRequire
# to Require, so need to require libyang version as both ways
Requires: libyang >= 2.1.128
BuildRequires: pcre2-devel
%if 0%{?rhel} && 0%{?rhel} < 7
#python27-devel is available from ius community repo for RedHat/CentOS 6
BuildRequires: python27-devel
%if %{with_docs}
BuildRequires: python27-sphinx
%endif
%else
%if %{use_python2}
BuildRequires: python-devel >= 2.7
%if %{with_docs}
BuildRequires: python-sphinx
%endif
%else
BuildRequires: python3-devel
%if %{with_docs}
BuildRequires: python3-sphinx
%endif
%endif
%endif
%if %{with_grpc}
BuildRequires: grpc-devel >= 1.16.1
BuildRequires: protobuf-devel >= 3.6.1
BuildRequires: protobuf-compiler >= 3.6.1
BuildRequires: protobuf-c-devel
%endif
%if 0%{?rhel} > 7
#platform-python-devel is needed for /usr/bin/pathfix.py
BuildRequires: platform-python-devel
%endif
Requires: initscripts
%if %{with_pam}
BuildRequires: pam-devel
%endif
%if "%{initsystem}" == "systemd"
BuildRequires: systemd
BuildRequires: systemd-devel
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd
%else
Requires(post): chkconfig
Requires(preun): chkconfig
# Initscripts > 5.60 is required for IPv6 support
Requires(pre): initscripts >= 5.60
%endif
Provides: routingdaemon = %{version}-%{release}
Obsoletes: gated mrt zebra frr-sysvinit
Conflicts: bird
%description
FRRouting is a free software that manages TCP/IP based routing
protocol. It takes multi-server and multi-thread approach to resolve
the current complexity of the Internet.
FRRouting supports BGP4, OSPFv2, OSPFv3, ISIS, RIP, RIPng, PIM, LDP
NHRP, Babel, PBR, EIGRP and BFD.
FRRouting is a fork of Quagga.
%package contrib
Summary: contrib tools for frr
Group: System Environment/Daemons
%description contrib
Contributed/3rd party tools which may be of use with frr.
%package pythontools
Summary: python tools for frr
%if 0%{?rhel} && 0%{?rhel} < 7
#python27 is available from ius community repo for RedHat/CentOS 6
BuildRequires: python27
Requires: python27-ipaddress
%else
%if %{use_python2}
BuildRequires: python2
Requires: python2-ipaddress
%else
BuildRequires: python3
%endif
%endif
Group: System Environment/Daemons
%description pythontools
Contributed python 2.7 tools which may be of use with frr.
%package devel
Summary: Header and object files for frr development
Group: System Environment/Daemons
Requires: %{name} = %{version}-%{release}
%description devel
The frr-devel package contains the header and object files necessary for
developing OSPF-API and frr applications.
%if %{with_rpki}
%package rpki-rtrlib
Summary: BGP RPKI support (rtrlib)
Group: System Environment/Daemons
BuildRequires: librtr-devel >= 0.8
Requires: %{name} = %{version}-%{release}
%description rpki-rtrlib
Adds RPKI support to FRR's bgpd, allowing validation of BGP routes
against cryptographic information stored in WHOIS databases. This is
used to prevent hijacking of networks on the wider internet. It is only
relevant to internet service providers using their own autonomous system
number.
%endif
%package snmp
Summary: SNMP support
Group: System Environment/Daemons
BuildRequires: net-snmp-devel
Requires: %{name} = %{version}-%{release}
%description snmp
Adds SNMP support to FRR's daemons by attaching to net-snmp's snmpd
through the AgentX protocol. Provides read-only access to current
routing state through standard SNMP MIBs.
%if %{with_grpc}
%package grpc
Summary: GRPC support for FRR daemons
Group: System Environment/Daemons
License: GPLv3+
Requires: %{name} = %{version}-%{release}
%description grpc
Adds GRPC support to the individual FRR daemons.
%endif
%prep
%setup -q -n frr-%{frrversion}
%build
# For standard gcc verbosity, uncomment these lines:
#CFLAGS="%{optflags} -Wall -Wsign-compare -Wpointer-arith"
#CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
# For ultra gcc verbosity, uncomment these lines also:
#CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
#CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
#CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
#CFLAGS="${CFLAGS} -Wpacked -Wpadded"
%configure \
--sbindir=%{_sbindir} \
--sysconfdir=%{_sysconfdir} \
--localstatedir=%{_localstatedir} \
--disable-static \
--disable-werror \
%if %{with_mgmtd_test_be_client}
--enable-mgmtd-test-be-client \
%endif
%if %{with_multipath}
--enable-multipath=%{with_multipath} \
%endif
--enable-vtysh \
%if %{with_ospfclient}
--enable-ospfclient \
%else
--disable-ospfclient\
%endif
%if %{with_ospfapi}
--enable-ospfapi \
%else
--disable-ospfapi \
%endif
%if %{with_rtadv}
--enable-rtadv \
%else
--disable-rtadv \
%endif
%if %{with_ldpd}
--enable-ldpd \
%else
--disable-ldpd \
%endif
%if %{with_pimd}
--enable-pimd \
%else
--disable-pimd \
%endif
%if %{with_pim6d}
--enable-pim6d \
%else
--disable-pim6d \
%endif
%if %{with_pbrd}
--enable-pbrd \
%else
--disable-pbrd \
%endif
%if %{with_nhrpd}
--enable-nhrpd \
%else
--disable-nhrpd \
%endif
%if %{with_eigrpd}
--enable-eigrpd \
%else
--disable-eigrpd \
%endif
%if %{with_babeld}
--enable-babeld \
%else
--disable-babeld \
%endif
%if %{with_vrrpd}
--enable-vrrpd \
%else
--disable-vrrpd \
%endif
%if %{with_pam}
--with-libpam \
%endif
%if 0%{?frr_user:1}
--enable-user=%{frr_user} \
--enable-group=%{frr_user} \
%endif
%if 0%{?vty_group:1}
--enable-vty-group=%{vty_group} \
%endif
%if %{with_fpm}
--enable-fpm \
%else
--disable-fpm \
%endif
%if %{with_watchfrr}
--enable-watchfrr \
%else
--disable-watchfrr \
%endif
%if %{with_cumulus}
--enable-cumulus \
%endif
%if %{with_bgp_vnc}
--enable-bgp-vnc \
%else
--disable-bgp-vnc \
%endif
--enable-isisd \
%if %{with_rpki}
--enable-rpki \
%endif
%if %{with_bfdd}
--enable-bfdd \
%else
--disable-bfdd \
%endif
%if %{with_pathd}
--enable-pathd \
%else
--disable-pathd \
%endif
%if %{with_grpc}
--enable-grpc \
%else
--disable-grpc \
%endif
--enable-snmp \
--enable-pcre2posix \
# end
make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
%if %{use_python2}
# Change frr-reload.py to use python2.7
sed -e '1c #!/usr/bin/python2.7' -i %{zeb_src}/tools/frr-reload.py
sed -e '1c #!/usr/bin/python2.7' -i %{zeb_src}/tools/generate_support_bundle.py
%else
# Change frr-reload.py to use python3
sed -e '1c #!/usr/bin/python3' -i %{zeb_src}/tools/frr-reload.py
sed -e '1c #!/usr/bin/python3' -i %{zeb_src}/tools/generate_support_bundle.py
%endif
%if %{with_docs}
pushd doc
make info
popd
%endif
%install
mkdir -p %{buildroot}%{_sysconfdir}/{frr,sysconfig,logrotate.d,pam.d,default} \
%{buildroot}%{_infodir}
mkdir -m 0755 -p %{buildroot}%{_localstatedir}/log/frr
make DESTDIR=%{buildroot} INSTALL="install -p" CP="cp -p" install
# Remove this file, as it is uninstalled and causes errors when building on RH9
rm -rf %{buildroot}/usr/share/info/dir
# Remove debian init script if it was installed
rm -f %{buildroot}%{_sbindir}/frr
# kill bogus libtool files
rm -vf %{buildroot}%{_libdir}/frr/modules/*.la
rm -vf %{buildroot}%{_libdir}/*.la
rm -vf %{buildroot}%{_libdir}/frr/libyang_plugins/*.la
# install /etc sources
%if "%{initsystem}" == "systemd"
mkdir -p %{buildroot}%{_unitdir}
install -m644 %{zeb_src}/tools/frr.service %{buildroot}%{_unitdir}/frr.service
%else
mkdir -p %{buildroot}%{_initddir}
ln -s %{_sbindir}/frrinit.sh %{buildroot}%{_initddir}/frr
%endif
install %{zeb_src}/tools/etc/frr/daemons %{buildroot}%{_sysconfdir}/frr
install %{zeb_src}/tools/etc/frr/frr.conf %{buildroot}%{_sysconfdir}/frr/frr.conf.template
install -m644 %{zeb_rh_src}/frr.pam %{buildroot}%{_sysconfdir}/pam.d/frr
install -m644 %{zeb_src}/tools/etc/logrotate.d/frr %{buildroot}%{_sysconfdir}/logrotate.d/frr
install -d -m750 %{buildroot}%{_runstatedir}/frr
%if 0%{?rhel} > 7 || 0%{?fedora} > 29
# avoid `ERROR: ambiguous python shebang in` errors
pathfix.py -pni "%{__python3} %{py3_shbang_opts}" %{buildroot}/usr/lib/frr/*.py
%py_byte_compile %{__python3} %{buildroot}/usr/lib/frr/*.py
%else
# remove ospfclient.py (if present) as it requires > python36
rm -f %{buildroot}%{_sbindir}/ospfclient.py
%endif
%pre
# add vty_group
%if 0%{?vty_group:1}
getent group %{vty_group} >/dev/null || groupadd -r -g %{vty_gid} %{vty_group}
%endif
# add frr user and group
%if 0%{?frr_user:1}
# Ensure that frr_gid gets correctly allocated
getent group %{frr_user} >/dev/null || groupadd -g %{frr_gid} %{frr_user}
getent passwd %{frr_user} >/dev/null || \
useradd -r -u %{frr_uid} -g %{frr_user} \
-s /sbin/nologin -c "FRRouting suite" \
-d %{_runstatedir}/frr %{frr_user}
%if 0%{?vty_group:1}
usermod -a -G %{vty_group} %{frr_user}
%endif
%endif
exit 0
%post
# zebra_spec_add_service <service name> <port/proto> <comment>
# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
zebra_spec_add_service ()
{
# Add port /etc/services entry if it isn't already there
if [ -f %{_sysconfdir}/services ] && \
! %__sed -e 's/#.*$//' %{_sysconfdir}/services 2>/dev/null | %__grep -wq $1 ; then
echo "$1 $2 # $3" >> %{_sysconfdir}/services
fi
}
zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
zebra_spec_add_service zebra 2601/tcp "zebra vty"
zebra_spec_add_service staticd 2616/tcp "staticd vty"
zebra_spec_add_service ripd 2602/tcp "RIPd vty"
zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
zebra_spec_add_service isisd 2608/tcp "ISISd vty"
%if %{with_ospfapi}
zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
%endif
%if %{with_babeld}
zebra_spec_add_service babeld 2609/tcp "BABELd vty"
%endif
%if %{with_nhrpd}
zebra_spec_add_service nhrpd 2610/tcp "NHRPd vty"
%endif
%if %{with_pimd}
zebra_spec_add_service pimd 2611/tcp "PIMd vty"
%endif
%if %{with_pbrd}
zebra_spec_add_service pbrd 2615/tcp "PBRd vty"
%endif
%if %{with_ldpd}
zebra_spec_add_service ldpd 2612/tcp "LDPd vty"
%endif
%if %{with_eigrpd}
zebra_spec_add_service eigrpd 2613/tcp "EIGRPd vty"
%endif
%if %{with_bfdd}
zebra_spec_add_service bfdd 2617/tcp "BFDd vty"
%endif
zebra_spec_add_service fabricd 2618/tcp "Fabricd vty"
%if %{with_vrrpd}
zebra_spec_add_service vrrpd 2619/tcp "VRRPd vty"
%endif
%if %{with_pathd}
zebra_spec_add_service pathd 2620/tcp "Pathd vty"
%endif
%if "%{initsystem}" == "systemd"
for daemon in %all_daemons ; do
%systemd_post frr.service
done
%else
/sbin/chkconfig --add frr
%endif
# Fix bad path in previous config files
# Config files won't get replaced by default, so we do this ugly hack to fix it
%__sed -i 's|watchfrr_options=|#watchfrr_options=|g' %{configdir}/daemons 2> /dev/null || true
# With systemd, watchfrr is mandatory. Fix config to make sure it's enabled if
# we install or upgrade to a frr built with systemd
%if "%{initsystem}" == "systemd"
%__sed -i 's|watchfrr_enable=no|watchfrr_enable=yes|g' %{configdir}/daemons 2> /dev/null || true
%endif
%if %{with_docs}
/sbin/install-info %{_infodir}/frr.info.gz %{_infodir}/dir
%endif
# Create dummy config file if they don't exist so basic functions can be used.
if [ ! -e %{configdir}/frr.conf ] && [ ! -e %{configdir}/zebra.conf ]; then
# No frr.conf and per daemon configs exist
mv %{configdir}/frr.conf.template %{configdir}/frr.conf
%if 0%{?frr_user:1}
chown %{frr_user}:%{frr_user} %{configdir}/frr.conf
%endif
chmod 640 %{configdir}/frr.conf
fi
%if 0%{?frr_user:1}
chown %{frr_user}:%{frr_user} %{configdir}/daemons
%endif
%if %{with_watchfrr}
# No config for watchfrr - this is part of /etc/sysconfig/frr
rm -f %{configdir}/watchfrr.*
%endif
if [ ! -e %{configdir}/vtysh.conf ]; then
touch %{configdir}/vtysh.conf
chmod 640 %{configdir}/vtysh.conf
%if 0%{?frr_user:1}
%if 0%{?vty_group:1}
chown %{frr_user}:%{vty_group} %{configdir}/vtysh.conf*
%endif
%endif
fi
%postun
if [ "$1" -ge 1 ]; then
#
# Upgrade from older version
#
%if "%{initsystem}" == "systemd"
##
## Systemd Version
##
%systemd_postun_with_restart frr.service
%else
##
## init.d Version
##
service frr restart >/dev/null 2>&1
%endif
:
fi
%preun
%if "%{initsystem}" == "systemd"
##
## Systemd Version
##
if [ $1 -eq 0 ] ; then
%systemd_preun frr.service
fi
%else
##
## init.d Version
##
if [ $1 -eq 0 ] ; then
service frr stop >/dev/null 2>&1
/sbin/chkconfig --del frr
fi
%endif
%if %{with_docs}
/sbin/install-info --delete %{_infodir}/frr.info.gz %{_infodir}/dir
%endif
%files
%doc COPYING
%doc doc/mpls
%doc README.md
/usr/share/yang/*.yang
%if 0%{?frr_user:1}
%dir %attr(751,%{frr_user},%{frr_user}) %{configdir}
%dir %attr(755,%{frr_user},%{frr_user}) %{_localstatedir}/log/frr
%dir %attr(751,%{frr_user},%{frr_user}) %{_runstatedir}/frr
%else
%dir %attr(750,root,root) %{configdir}
%dir %attr(755,root,root) %{_localstatedir}/log/frr
%dir %attr(750,root,root) %{_runstatedir}/frr
%endif
%if %{with_docs}
%{_infodir}/frr.info.gz
%{_mandir}/man*/*
%endif
%{_sbindir}/zebra
%{_sbindir}/staticd
%{_sbindir}/ospfd
%{_sbindir}/ripd
%{_sbindir}/bgpd
%{_sbindir}/mgmtd
%if %{with_mgmtd_test_be_client}
%{_sbindir}/mgmtd_testc
%endif
%exclude %{_sbindir}/ssd
%exclude %{_sbindir}/fpm_listener
%if %{with_watchfrr}
%{_sbindir}/watchfrr
%endif
%{_sbindir}/ripngd
%{_sbindir}/ospf6d
%if %{with_pimd}
%{_sbindir}/pimd
%endif
%if %{with_pim6d}
%{_sbindir}/pim6d
%endif
%if %{with_pbrd}
%{_sbindir}/pbrd
%endif
%if %{with_vrrpd}
%{_sbindir}/vrrpd
%endif
%{_sbindir}/isisd
%{_sbindir}/fabricd
%if %{with_ldpd}
%{_sbindir}/ldpd
%endif
%if %{with_eigrpd}
%{_sbindir}/eigrpd
%endif
%if %{with_nhrpd}
%{_sbindir}/nhrpd
%endif
%if %{with_babeld}
%{_sbindir}/babeld
%endif
%if %{with_bfdd}
%{_sbindir}/bfdd
%endif
%if %{with_pathd}
%{_sbindir}/pathd
%endif
%{_libdir}/libfrr*.so*
%{_libdir}/frr/modules/*.so
%{_libdir}/libmgmt_be_nb.so*
%{_bindir}/*
%config(noreplace) %{configdir}/[!v]*.conf*
%config(noreplace) %attr(750,%{frr_user},%{frr_user}) %{configdir}/daemons
%if "%{initsystem}" == "systemd"
%{_unitdir}/frr.service
%else
%{_initddir}/frr
%endif
%config(noreplace) %{_sysconfdir}/pam.d/frr
%config(noreplace) %{_sysconfdir}/logrotate.d/frr
%{_sbindir}/frr-reload
%{_sbindir}/frrcommon.sh
%{_sbindir}/frrinit.sh
%{_sbindir}/watchfrr.sh
%files contrib
%doc tools
%files pythontools
%{_sbindir}/generate_support_bundle.py
%{_sbindir}/frr-reload.py
%{_sbindir}/frr_babeltrace.py
%if %{with_ospfclient} && (0%{?rhel} > 7 || 0%{?fedora} > 29)
%{_sbindir}/ospfclient.py
%endif
%if 0%{?rhel} > 7 || 0%{?fedora} > 29
%{_sbindir}/__pycache__/*
%else
%{_sbindir}/generate_support_bundle.pyc
%{_sbindir}/generate_support_bundle.pyo
%{_sbindir}/frr-reload.pyc
%{_sbindir}/frr-reload.pyo
%{_sbindir}/frr_babeltrace.pyc
%{_sbindir}/frr_babeltrace.pyo
%endif
%if %{with_rpki}
%post rpki-rtrlib
# add rpki module to daemons
sed -i -e 's/^\(bgpd_options=\)\(.*\)\(".*\)/\1\2 -M rpki\3/' %{_sysconfdir}/frr/daemons
%postun rpki-rtrlib
# remove rpki module from daemons
sed -i 's/ -M rpki//' %{_sysconfdir}/frr/daemons
%endif
%files devel
%{_libdir}/lib*.so
%dir %{_includedir}/%{name}
%{_includedir}/%{name}/*.h
%dir %{_includedir}/%{name}/ospfd
%{_includedir}/%{name}/ospfd/*.h
%if %{with_bfdd}
%dir %{_includedir}/%{name}/bfdd
%{_includedir}/%{name}/bfdd/bfddp_packet.h
%endif
%if %{with_ospfapi}
%dir %{_includedir}/%{name}/ospfapi
%{_includedir}/%{name}/ospfapi/*.h
%endif
%if %{with_eigrpd}
%dir %{_includedir}/%{name}/eigrpd
%{_includedir}/%{name}/eigrpd/*.h
%endif
%changelog
* Thu Oct 10 2024 Jafar Al-Gharaibeh <jafar@atcorp.com> - %{version}
* Thu Oct 10 2024 Jafar Al-Gharaibeh <jafar@atcorp.com> - 10.3-dev
- FRR 10.3 Development
* Fri Jul 26 2024 Jafar Al-Gharaibeh <jafar@atcorp.com> - 10.1
- Breaking changes
- Enable BGP dynamic capability by default for datacenter profile
- Split BGP `rpki cache` command into separate per SSH/TCP
- Add deprecation cycle for OSPF `router-info X [A.B.C.D]` command
- Major highlights:
- BGP dampening per-neighbor support
- BMP send-experimental stats
- Implement extended link-bandwidth for BGP
- Paths Limit for Multiple Paths in BGP
- New command for OSPFv2 `ip ospf neighbor-filter NAME [A.B.C.D]`
- Implement non-broadcast support for point-to-multipoint networks
* Mon Mar 25 2024 Jafar Al-Gharaibeh <jafar@atcorp.com> - 10.0
- Major highlights:
- Introduce local host routes
- Require libyang 2.1.128
- Add suport to configire a log file per daemon
- BGP BMP Loc-RIB (RFC9069) support
- eBGP-OAD (One Administrative Domain) support
- BGP RPKI VRF support
- BGP SNMP traps for BGP4-MIBV2
- Management (mgmtd) daemon "replace" operation support
- BGP dynamic capabilities for addpath, fqdn, orf capabilities
- SRv6 encapsulation source address feature
- OSPFv3 Point-To-Multipoint mode
* Mon Oct 09 2023 Donatas Abraitis <donatas@opensourcerouting.org> - 9.1
- Major highlights:
- OSPFv2 HMAC-SHA Cryptographic Authentication
- BGP MAC-VRF Site-Of-Origin support
- BGP Dynamic capability support
- IS-IS SRv6 uSID support (RFC 9352)
- Change next-hop resolution via the default route for a traditional profile
- Add support for VLAN, ECN, DSCP mangling/filtering
- Zebra support for route replace semantics in FPM
- New command for BGP `neighbor x addpath-tx-best-selected`
- New command for BGP `mpls bgp l3vpn-multi-domain-switching`
- A couple more new BGP route-map commands for as-path, communities manipulation
* Tue Jun 06 2023 Jafar Al-Gharaibeh <jafar@atcorp.com> - 9.0
- Major highlights:
- Centralized Management Daemon (mgmtd)
- Switched to libyang minimum version 2.1.80
- Memory footprint for BGP reduced drastically
- Add BGP `neighbor path-attribute treat-as-withdraw` command
- Add BGP ASN dot notation support (RFC 5396)
- Add BGP Software Version capability
- Allow BGP peering via 127.0.0.0/8
- Deprecate BGP `internet` community - this is the Cisco-specific community, which is never been RFC-defined and confusing
- Implement `match source-protocol` for BGP route maps
- Implement BGP Node Target extended communities (draft-ietf-idr-node-target-ext-comm)
- Implement Flex-Algo for SR-MPLS (RFC 9350)
- Add support for IS-IS `advertise-passive-only`
- Add IS-IS `affinity-map` support
- Add the `graceful-restart hello-delay` OSPFv2/OSPFv3 command
- Add the `ipv6 mld join` PIMv6 command
- Add `allow-ecmp x` RIP/RIPng command
- Add BFD support for RIP
- For a full list of new features and bug fixes, please refer to:
- https://frrouting.org/release/
* Fri Mar 10 2023 Jafar Al-Gharaibeh <jafar@atcorp.com> - 8.5
- Major Highlights:
- Add support for per-VRF SRv6 SID
- Add BGP labeled-unicast Add-Path functionality
- Implementation of SNMP BGP4v2-MIB (IPv6 support) for better network management and monitoring
- Add BGP new command neighbor path-attribute discard
- Add BGP new command neighbor path-attribute treat-as-withdraw
- Implement L3 route-target auto/wildcard configuration
- Implement BGP ACCEPT_OWN Community Attribute (rfc7611)
- Implement The Accumulated IGP Metric Attribute for BGP (rfc7311)
- Implement graceful-shutdown command per neighbor
- Add BGP new command to configure TCP keepalives for a peer bgp tcp-keepalive
- Traffic control (TC) ZAPI implementation
- SRv6 uSID (microSID) implementation
- Start deprecating start-shell, ssh, and telnet commands due to security reasons
- Add VRRPv3 an ability to disable IPv4 pseudo-header checksum
- BFD integration for static routes
- Allow protocols to configure BFD sessions with automatic source selection
- Allow zero-length opaque LSAs for OSPF (rfc5250)
- Add ISIS new command set-overload-bit on-startup
- PIMv6 BSM support
- For a full list of new features and bug fixes, please refer to:
- https://frrouting.org/release/
* Tue Nov 01 2022 Jafar Al-Gharaibeh <jafar@atcorp.com> - 8.4
- New BGP command (neighbor PEER soo) to configure SoO to prevent routing loops and suboptimal routing on dual-homed sites.
- Command debug bgp allow-martian replaced to bgp allow-martian-nexthop because previously we allowed using martian next-hops when debug is turned on.
- Implement BGP Prefix Origin Validation State Extended Community rfc8097
- Implement Route Leak Prevention and Detection Using Roles in UPDATE and OPEN Messages rfc9234
- BMP L3VPN support
- PIMv6 support
- MLD support
- New command to enable using reserved IPv4 ranges as normal addresses for BGP next-hops, interface addresses, etc.
- For a full list of bug fixes, please refer to https://frrouting.org/release/
* Wed Jul 13 2022 Jafar Al-Gharaibeh <jafar@atcorp.com> - 8.3
- General:
- Add camelcase json keys in addition to pascalcase (Wrong JSON keys will be depracated)
- Fix corruption when route-map delete/add sequence happens (fast re-add)
- Reworked gRPC
- RFC5424 & journald extended syslog target
- bfdd:
- Fix broken FSM in active/passive modes
- bgpd:
- Notification Message Support for BGP Graceful Restart (rfc8538)
- BGP Cease Notification Subcode For BFD
- Send Hold Timer for BGP (own implementation without an additional knob)
- New `set as-path replace` command for BGP route-map
- New `match peer` command for BGP route-map
- New `ead-es-frag evi-limit` command for EVPN
- New `match evpn route-type` command for EVPN route-map to match Type-1/Type-4
- JSON outputs for all RPKI show commands
- Set attributes via route-map for BGP conditional advertisements
- Pass non-transitive extended communities between RS and RS-clients
- Send MED attribute when aggregate prefix is created
- Fix aspath memory leak in aggr_suppress_map_test
- Fix crash for `show ip bgp vrf all all neighbors 192.168.0.1 ...`
- Fix crash for `show ip bgp vrf all all`
- Fix memory leak for BGP Community Alias in CLI
- Fix memory leak when setting BGP community at egress
- Fix memory leak when setting BGP large-community at egress
- Fix SR color nexthop processing in BGP
- Fix setting local-preference in route-map using +/-
- Fix crash using Lua and route-map to set attributes via scripts
- Fix crash when issuing various forms of `bgp no-rib`
- isisd:
- JSON output for show summary command
- Fix crash when MTU mismatch occurs
- Fix crash with xfrm interface type
- Fix infinite loop when parsing LSPs
- Fix router capability TLV parsing issues
- vtysh:
- New `show thread timers` command
- ospfd6:
- Add LSA statistics to LSA database
- Add LSA stats to `show area json` output
- Show time left in hello timer for `show ipv6 ospf6 int`
- Restart SPF when distance is updated
- Support keychain for ospf6 authentication
- ospfd:
- New `show ip ospf reachable-routers` command
- Restart SPF when distance is updated
- Use consistent JSON keys for `show ip ospf neighbor` and detail version
- pimd:
- Add additional IGMP stats
- Add IGMP join sent/failed statistics
- Add IGMP total groups and total source groups to statistics
- New `debug igmp trace detail` command
- New `ip pim passive` command
- JSON support added for command `show ip igmp sources`
- Allow the LPM match work properly with prefix lists and normal RPs
- Do not allow 224.0.0.0/24 range in IGMP join
- Fix IGMP packet/query check
- Handle PIM join/prune receive flow for IPv6