]> git.proxmox.com Git - mirror_frr.git/blame - redhat/frr.spec.in
Merge pull request #4731 from mjstapp/fix_redist_update
[mirror_frr.git] / redhat / frr.spec.in
CommitLineData
edd7c245 1# configure options
b64d92a8 2#
f79f7a7b 3# Some can be overridden on rpmbuild commandline with:
b64d92a8 4# rpmbuild --define 'variable value'
f755bf6d 5# (use any value, ie 1 for flag "with_XXXX" definitions)
b64d92a8 6#
30da4585
PJ
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.
b64d92a8 10
b387c334 11#################### FRRouting (FRR) configure options #####################
1189075b 12# with-feature options
e763afa5 13%{!?with_babeld: %global with_babeld 1 }
7134904b 14%{!?with_bfdd: %global with_bfdd 1 }
5a76db68 15%{!?with_bgp_vnc: %global with_bgp_vnc 0 }
0e3daa4d 16%{!?with_cumulus: %global with_cumulus 0 }
ff00e18d
RK
17%{!?with_eigrpd: %global with_eigrpd 1 }
18%{!?with_fpm: %global with_fpm 1 }
19%{!?with_ldpd: %global with_ldpd 1 }
20%{!?with_multipath: %global with_multipath 256 }
21%{!?with_nhrpd: %global with_nhrpd 1 }
22%{!?with_ospfapi: %global with_ospfapi 1 }
23%{!?with_ospfclient: %global with_ospfclient 1 }
24%{!?with_pam: %global with_pam 0 }
25%{!?with_pbrd: %global with_pbrd 1 }
5a76db68 26%{!?with_pimd: %global with_pimd 1 }
97b5f22b 27%{!?with_vrrpd: %global with_vrrpd 1 }
aaf38c94 28%{!?with_rpki: %global with_rpki 0 }
ff00e18d
RK
29%{!?with_rtadv: %global with_rtadv 1 }
30%{!?with_watchfrr: %global with_watchfrr 1 }
31
32# user and group
33%{!?frr_user: %global frr_user frr }
34%{!?vty_group: %global vty_group frrvty }
30b9d89b 35
36# path defines
ff00e18d
RK
37%define configdir %{_sysconfdir}/%{name}
38%define _sbindir /usr/lib/frr
39%define zeb_src %{_builddir}/%{name}-%{frrversion}
40%define zeb_rh_src %{zeb_src}/redhat
41%define zeb_docs %{zeb_src}/doc
42%define frr_tools %{zeb_src}/tools
788cdc6d 43
e0626854 44# defines for configure
0bb68611 45%define rundir %{_localstatedir}/run/%{name}
ccd40dee 46
1189075b 47############################################################################
48
f755bf6d
MW
49#### Version String tweak
50# Remove invalid characters form version string and replace with _
d4fbc1de 51%{expand: %%global rpmversion %(echo '@VERSION@' | tr [:blank:]- _ )}
c115e4a4 52%define frrversion @VERSION@
1189075b 53
f755bf6d
MW
54#### Check for systemd or init.d (upstart)
55# Check for init.d (upstart) as used in CentOS 6 or systemd (ie CentOS 7)
a999f98c 56%if 0%{?fedora} || 0%{?rhel} >= 7 || 0%{?suse_version} >= 1210
a1cfe675
TR
57 %global initsystem systemd
58%else
a999f98c 59%if 0%{?rhel} && 0%{?rhel} < 7
a1cfe675
TR
60 %global initsystem upstart
61%else
62 %{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)}
63%endif
64%endif
54c059f1
RK
65
66# If init system is systemd, then always enable watchfrr
f755bf6d 67%if "%{initsystem}" == "systemd"
9a581ae4 68 %global with_watchfrr 1
f755bf6d 69%endif
7c08d77f 70
150e7c7e 71#### Check for RedHat 6.x or CentOS 6.x - they are too old to support PIM.
41b86ba4 72#### Always disable it on these old systems unconditionally
41b86ba4 73#
9e631cc4
MW
74# if CentOS / RedHat and version < 7, then disable PIMd (too old, won't work)
75%if 0%{?rhel} && 0%{?rhel} < 7
41b86ba4
MW
76 %global with_pimd 0
77%endif
78
15d74e93 79# misc internal defines
9a581ae4
MW
80%{!?frr_uid: %global frr_uid 92 }
81%{!?frr_gid: %global frr_gid 92 }
82%{!?vty_gid: %global vty_gid 85 }
f755bf6d 83
13d9aad8 84%define daemon_list zebra ripd ospfd bgpd isisd ripngd ospf6d pbrd staticd bfdd fabricd
0df63b52 85
b021388f 86%if %{with_ldpd}
5f371d0b 87 %define daemon_ldpd ldpd
b021388f 88%else
5f371d0b 89 %define daemon_ldpd ""
b021388f
RW
90%endif
91
41b86ba4 92%if %{with_pimd}
5f371d0b 93 %define daemon_pimd pimd
41b86ba4 94%else
5f371d0b 95 %define daemon_pimd ""
b021388f
RW
96%endif
97
1abe1280 98%if %{with_pbrd}
5f371d0b 99 %define daemon_pbrd pbrd
1abe1280 100%else
5f371d0b 101 %define daemon_pbrd ""
1abe1280
DS
102%endif
103
729f041c 104%if %{with_nhrpd}
5f371d0b 105 %define daemon_nhrpd nhrpd
729f041c 106%else
5f371d0b 107 %define daemon_nhrpd ""
729f041c
TT
108%endif
109
5a76db68 110%if %{with_eigrpd}
5f371d0b 111 %define daemon_eigrpd eigrpd
5a76db68 112%else
5f371d0b 113 %define daemon_eigrpd ""
5a76db68
MW
114%endif
115
e763afa5 116%if %{with_babeld}
5f371d0b 117 %define daemon_babeld babeld
e763afa5 118%else
5f371d0b 119 %define daemon_babeld ""
e763afa5
DL
120%endif
121
97b5f22b
QY
122%if %{with_vrrpd}
123 %define daemon_vrrpd vrrpd
124%else
125 %define daemon_vrrpd ""
126%endif
127
9473e340 128%if %{with_watchfrr}
5f371d0b 129 %define daemon_watchfrr watchfrr
f755bf6d 130%else
5f371d0b 131 %define daemon_watchfrr ""
f755bf6d
MW
132%endif
133
7134904b
RZ
134%if %{with_bfdd}
135 %define daemon_bfdd bfdd
136%else
137 %define daemon_bfdd ""
138%endif
139
97b5f22b 140%define all_daemons %{daemon_list} %{daemon_ldpd} %{daemon_pimd} %{daemon_nhrpd} %{daemon_eigrpd} %{daemon_babeld} %{daemon_watchfrr} %{daemon_pbrd} %{daemon_bfdd} %{daemon_vrrpd}
b3324e27 141
4859e20c 142#release sub-revision (the two digits after the CONFDATE)
9a581ae4 143%{!?release_rev: %global release_rev 01 }
4859e20c 144
788cdc6d 145Summary: Routing daemon
9a581ae4
MW
146Name: frr
147Version: %{rpmversion}
7ba01507 148Release: %{release_rev}%{?dist}
9a581ae4
MW
149License: GPLv2+
150Group: System Environment/Daemons
c410a861 151Source0: https://github.com/FRRouting/frr/archive/%{name}-%{frrversion}.tar.gz
e1ff8246 152URL: https://www.frrouting.org
1a629db7 153Requires(pre): shadow-utils
501c1362
RK
154Requires(preun): info
155Requires(post): info
5ebf9672
RK
156BuildRequires: bison >= 2.7
157BuildRequires: c-ares-devel
158BuildRequires: flex
159BuildRequires: gcc
160BuildRequires: json-c-devel
161BuildRequires: libcap-devel
162BuildRequires: make
163BuildRequires: ncurses-devel
164BuildRequires: readline-devel
165BuildRequires: texinfo
831dd62a 166BuildRequires: libyang-devel >= 0.16.74
01aff72e
MW
167%if 0%{?rhel} && 0%{?rhel} < 7
168#python27-devel is available from ius community repo for RedHat/CentOS 6
5ebf9672
RK
169BuildRequires: python27-devel
170BuildRequires: python27-sphinx
01aff72e 171%else
5ebf9672
RK
172BuildRequires: python-devel >= 2.7
173BuildRequires: python-sphinx
01aff72e 174%endif
b4e993b2 175Requires: initscripts
f755bf6d 176%if %{with_pam}
9a581ae4 177BuildRequires: pam-devel
f755bf6d 178%endif
aaf38c94
MW
179%if %{with_rpki}
180BuildRequires: librtr-devel >= 0.5
aaf38c94 181%endif
f755bf6d 182%if "%{initsystem}" == "systemd"
5ebf9672
RK
183BuildRequires: systemd
184BuildRequires: systemd-devel
9a581ae4
MW
185Requires(post): systemd
186Requires(preun): systemd
187Requires(postun): systemd
f755bf6d 188%else
95624f7b
RK
189Requires(post): chkconfig
190Requires(preun): chkconfig
788cdc6d 191# Initscripts > 5.60 is required for IPv6 support
9a581ae4 192Requires(pre): initscripts >= 5.60
f755bf6d 193%endif
9a581ae4 194Provides: routingdaemon = %{version}-%{release}
5d82c57b
BR
195Obsoletes: gated mrt zebra frr-sysvinit
196Conflicts: bird
788cdc6d 197
95c16f4c 198
788cdc6d 199%description
447a8fe9 200FRRouting is a free software that manages TCP/IP based routing
788cdc6d 201protocol. It takes multi-server and multi-thread approach to resolve
202the current complexity of the Internet.
203
3e7c8d04 204FRRouting supports BGP4, OSPFv2, OSPFv3, ISIS, RIP, RIPng, PIM, LDP
7134904b 205NHRP, Babel, PBR, EIGRP and BFD.
788cdc6d 206
447a8fe9 207FRRouting is a fork of Quagga.
788cdc6d 208
95c16f4c 209
448ed4a2 210%package contrib
c115e4a4 211Summary: contrib tools for frr
448ed4a2 212Group: System Environment/Daemons
213
214%description contrib
c115e4a4 215Contributed/3rd party tools which may be of use with frr.
448ed4a2 216
95c16f4c 217
386fcd12
MW
218%package pythontools
219Summary: python tools for frr
c2953ac5 220BuildRequires: python
1c64265f 221Requires: python-ipaddress
386fcd12
MW
222Group: System Environment/Daemons
223
224%description pythontools
225Contributed python 2.7 tools which may be of use with frr.
226
95c16f4c 227
e0626854 228%package devel
c115e4a4 229Summary: Header and object files for frr development
e0626854 230Group: System Environment/Daemons
f755bf6d 231Requires: %{name} = %{version}-%{release}
e0626854 232
233%description devel
c115e4a4
MW
234The frr-devel package contains the header and object files neccessary for
235developing OSPF-API and frr applications.
e0626854 236
95c16f4c 237
788cdc6d 238%prep
5f371d0b 239%setup -q -n frr-%{frrversion}
788cdc6d 240
95c16f4c 241
788cdc6d 242%build
7966b97c 243
244# For standard gcc verbosity, uncomment these lines:
245#CFLAGS="%{optflags} -Wall -Wsign-compare -Wpointer-arith"
246#CFLAGS="${CFLAGS} -Wbad-function-cast -Wwrite-strings"
247
248# For ultra gcc verbosity, uncomment these lines also:
249#CFLAGS="${CFLAGS} -W -Wcast-qual -Wstrict-prototypes"
250#CFLAGS="${CFLAGS} -Wmissing-declarations -Wmissing-noreturn"
251#CFLAGS="${CFLAGS} -Wmissing-format-attribute -Wunreachable-code"
252#CFLAGS="${CFLAGS} -Wpacked -Wpadded"
253
788cdc6d 254%configure \
c63f5f2c 255 --sbindir=%{_sbindir} \
931e1d68 256 --sysconfdir=%{configdir} \
0bb68611 257 --localstatedir=%{rundir} \
5c3ad1d4 258 --disable-static \
9a581ae4 259 --disable-werror \
0ed9196b 260 --enable-irdp \
54b25dca 261%if %{with_multipath}
9a581ae4 262 --enable-multipath=%{with_multipath} \
788cdc6d 263%endif
9a581ae4 264 --enable-vtysh \
54b25dca 265%if %{with_ospfclient}
19ced9a4 266 --enable-ospfclient \
68980084 267%else
19ced9a4 268 --disable-ospfclient\
68980084 269%endif
54b25dca 270%if %{with_ospfapi}
c9cad876 271 --enable-ospfapi \
68980084 272%else
0cff191d 273 --disable-ospfapi \
68980084 274%endif
e7cd37bf 275%if %{with_rtadv}
c9cad876 276 --enable-rtadv \
e7cd37bf 277%else
0cff191d 278 --disable-rtadv \
e7cd37bf 279%endif
b021388f 280%if %{with_ldpd}
9a581ae4 281 --enable-ldpd \
b021388f 282%else
9a581ae4 283 --disable-ldpd \
b021388f 284%endif
41b86ba4
MW
285%if %{with_pimd}
286 --enable-pimd \
b021388f 287%else
41b86ba4 288 --disable-pimd \
b021388f 289%endif
1abe1280
DS
290%if %{with_pbrd}
291 --enable-pbrd \
292%else
293 --disable-pbrd \
294%endif
729f041c 295%if %{with_nhrpd}
fe99b015 296 --enable-nhrpd \
729f041c 297%else
fe99b015 298 --disable-nhrpd \
729f041c 299%endif
5a76db68 300%if %{with_eigrpd}
fe99b015 301 --enable-eigrpd \
5a76db68 302%else
fe99b015 303 --disable-eigrpd \
5a76db68 304%endif
e763afa5 305%if %{with_babeld}
fe99b015 306 --enable-babeld \
e763afa5 307%else
fe99b015 308 --disable-babeld \
e763afa5 309%endif
97b5f22b
QY
310%if %{with_vrrpd}
311 --enable-vrrpd \
312%else
313 --disable-vrrpd \
314%endif
54b25dca 315%if %{with_pam}
9a581ae4 316 --with-libpam \
788cdc6d 317%endif
c115e4a4 318%if 0%{?frr_user:1}
1dc5a0dc
RK
319 --enable-user=%{frr_user} \
320 --enable-group=%{frr_user} \
edd7c245 321%endif
f755bf6d 322%if 0%{?vty_group:1}
1dc5a0dc 323 --enable-vty-group=%{vty_group} \
edd7c245 324%endif
f755bf6d 325%if %{with_fpm}
9a581ae4 326 --enable-fpm \
f755bf6d 327%else
9a581ae4 328 --disable-fpm \
f755bf6d 329%endif
9473e340 330%if %{with_watchfrr}
9a581ae4 331 --enable-watchfrr \
f755bf6d 332%else
9a581ae4 333 --disable-watchfrr \
65efcfce 334%endif
0e3daa4d
RK
335%if %{with_cumulus}
336 --enable-cumulus \
337%endif
65efcfce 338%if %{with_bgp_vnc}
9a581ae4 339 --enable-bgp-vnc \
65efcfce 340%else
9a581ae4 341 --disable-bgp-vnc \
f755bf6d 342%endif
c9cad876 343 --enable-isisd \
58f20b90 344%if "%{initsystem}" == "systemd"
c9cad876 345 --enable-systemd \
f755bf6d 346%endif
aaf38c94 347%if %{with_rpki}
7134904b
RZ
348 --enable-rpki \
349%else
350 --disable-rpki \
351%endif
352%if %{with_bfdd}
a214288c 353 --enable-bfdd \
9f892cc5 354%else
a214288c 355 --disable-bfdd \
aaf38c94 356%endif
45da32d7 357 # end
788cdc6d 358
a214288c 359make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
788cdc6d 360
361pushd doc
a214288c 362make info
788cdc6d 363popd
364
95c16f4c 365
788cdc6d 366%install
9b979646 367mkdir -p %{buildroot}%{_sysconfdir}/{frr,sysconfig,logrotate.d,pam.d,default} \
4f20eab1 368 %{buildroot}%{_localstatedir}/log/frr %{buildroot}%{_infodir}
a214288c 369make DESTDIR=%{buildroot} INSTALL="install -p" CP="cp -p" install
788cdc6d 370
9a344b74 371# Remove this file, as it is uninstalled and causes errors when building on RH9
f755bf6d 372rm -rf %{buildroot}/usr/share/info/dir
9a344b74 373
2cdd3d94
MW
374# Remove debian init script if it was installed
375rm -f %{buildroot}%{_sbindir}/frr
c63f5f2c 376
5c3ad1d4
RK
377# kill bogus libtool files
378rm -vf %{buildroot}%{_libdir}/frr/modules/*.la
379rm -vf %{buildroot}%{_libdir}/*.la
7cad61cb 380rm -vf %{buildroot}%{_libdir}/frr/libyang_plugins/*.la
0ed9196b 381
f755bf6d
MW
382# install /etc sources
383%if "%{initsystem}" == "systemd"
384mkdir -p %{buildroot}%{_unitdir}
81b834a5 385install -m644 %{zeb_src}/tools/frr.service %{buildroot}%{_unitdir}/frr.service
f755bf6d 386%else
9b979646 387mkdir -p %{buildroot}%{_initddir}
81b834a5 388ln -s %{_sbindir}/frrinit.sh %{buildroot}%{_initddir}/frr
f755bf6d
MW
389%endif
390
81b834a5 391install %{zeb_src}/tools/etc/frr/daemons %{buildroot}%{_sysconfdir}/frr
0817301a 392# add rpki module to daemon
393%if %{with_rpki}
394 sed -i -e 's/^\(bgpd_options=\)\(.*\)\(".*\)/\1\2 -M rpki\3/' %{buildroot}%{_sysconfdir}/frr/daemons
395%endif
5f371d0b
RK
396install -m644 %{zeb_rh_src}/frr.pam %{buildroot}%{_sysconfdir}/pam.d/frr
397install -m644 %{zeb_rh_src}/frr.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/frr
398install -d -m750 %{buildroot}%{rundir}
edd7c245 399
95c16f4c 400
edd7c245 401%pre
402# add vty_group
f755bf6d 403%if 0%{?vty_group:1}
1a629db7 404 getent group %{vty_group} >/dev/null || groupadd -r -g %{vty_gid} %{vty_group}
edd7c245 405%endif
e7cd37bf 406
c115e4a4
MW
407# add frr user and group
408%if 0%{?frr_user:1}
1a629db7
RK
409 # Ensure that frr_gid gets correctly allocated
410 getent group %{frr_user} >/dev/null || groupadd -g %{frr_gid} %{frr_user}
411 getent passwd %{frr_user} >/dev/null || \
412 useradd -r -u %{frr_uid} -g %{frr_user} \
413 -s /sbin/nologin -c "FRRouting suite" \
414 -d %{rundir} %{frr_user}
415
416 %if 0%{?vty_group:1}
417 usermod -a -G %{vty_group} %{frr_user}
418 %endif
419%endif
420exit 0
f676b06e 421
788cdc6d 422
788cdc6d 423%post
30b9d89b 424# zebra_spec_add_service <service name> <port/proto> <comment>
788cdc6d 425# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
426
427zebra_spec_add_service ()
428{
150e7c7e 429 # Add port /etc/services entry if it isn't already there
9b979646
RK
430 if [ -f %{_sysconfdir}/services ] && \
431 ! %__sed -e 's/#.*$//' %{_sysconfdir}/services | %__grep -wq $1 ; then
432 echo "$1 $2 # $3" >> %{_sysconfdir}/services
9a581ae4 433 fi
788cdc6d 434}
435
436zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
437zebra_spec_add_service zebra 2601/tcp "zebra vty"
7ac1de8e 438zebra_spec_add_service staticd 2616/tcp "staticd vty"
788cdc6d 439zebra_spec_add_service ripd 2602/tcp "RIPd vty"
440zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
441zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
442zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
443zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
5f371d0b 444zebra_spec_add_service isisd 2608/tcp "ISISd vty"
54b25dca 445%if %{with_ospfapi}
5f371d0b 446 zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
7021c425 447%endif
e763afa5 448%if %{with_babeld}
5f371d0b 449 zebra_spec_add_service babeld 2609/tcp "BABELd vty"
5a76db68 450%endif
729f041c 451%if %{with_nhrpd}
5f371d0b 452 zebra_spec_add_service nhrpd 2610/tcp "NHRPd vty"
729f041c 453%endif
41b86ba4 454%if %{with_pimd}
5f371d0b 455 zebra_spec_add_service pimd 2611/tcp "PIMd vty"
41b86ba4 456%endif
1abe1280 457%if %{with_pbrd}
5f371d0b 458 zebra_spec_add_service pbrd 2615/tcp "PBRd vty"
1abe1280 459%endif
b021388f 460%if %{with_ldpd}
5f371d0b 461 zebra_spec_add_service ldpd 2612/tcp "LDPd vty"
b021388f 462%endif
e763afa5 463%if %{with_eigrpd}
5f371d0b 464 zebra_spec_add_service eigrpd 2613/tcp "EIGRPd vty"
e763afa5 465%endif
7134904b
RZ
466%if %{with_bfdd}
467 zebra_spec_add_service bfdd 2617/tcp "BFDd vty"
468%endif
13d9aad8 469zebra_spec_add_service fabricd 2618/tcp "Fabricd vty"
97b5f22b
QY
470%if %{with_vrrpd}
471 zebra_spec_add_service vrrpd 2619/tcp "VRRPd vty"
472%endif
788cdc6d 473
f755bf6d 474%if "%{initsystem}" == "systemd"
5f371d0b
RK
475 for daemon in %all_daemons ; do
476 %systemd_post frr.service
477 done
f755bf6d 478%else
5f371d0b 479 /sbin/chkconfig --add frr
f755bf6d 480%endif
788cdc6d 481
75429e11
MW
482# Fix bad path in previous config files
483# Config files won't get replaced by default, so we do this ugly hack to fix it
81b834a5 484%__sed -i 's|watchfrr_options=|#watchfrr_options=|g' %{configdir}/daemons 2> /dev/null || true
75429e11 485
5b7077e8
DS
486# With systemd, watchfrr is mandatory. Fix config to make sure it's enabled if
487# we install or upgrade to a frr built with systemd
488%if "%{initsystem}" == "systemd"
931e1d68 489 %__sed -i 's|watchfrr_enable=no|watchfrr_enable=yes|g' %{configdir}/daemons 2> /dev/null || true
5b7077e8
DS
490%endif
491
c115e4a4 492/sbin/install-info %{_infodir}/frr.info.gz %{_infodir}/dir
788cdc6d 493
494# Create dummy files if they don't exist so basic functions can be used.
931e1d68
RK
495if [ ! -e %{configdir}/zebra.conf ]; then
496 echo "hostname `hostname`" > %{configdir}/zebra.conf
c115e4a4 497%if 0%{?frr_user:1}
1dc5a0dc 498 chown %{frr_user}:%{frr_user} %{configdir}/zebra.conf*
e7cd37bf 499%endif
931e1d68 500 chmod 640 %{configdir}/zebra.conf*
788cdc6d 501fi
f755bf6d 502for daemon in %{all_daemons} ; do
33fdbd5e 503 if [ x"${daemon}" != x"" ] ; then
931e1d68
RK
504 if [ ! -e %{configdir}/${daemon}.conf ]; then
505 touch %{configdir}/${daemon}.conf
33fdbd5e 506 %if 0%{?frr_user:1}
1dc5a0dc 507 chown %{frr_user}:%{frr_user} %{configdir}/${daemon}.conf*
33fdbd5e
MW
508 %endif
509 fi
9a581ae4 510 fi
f755bf6d 511done
2cdd3d94 512%if 0%{?frr_user:1}
1dc5a0dc 513 chown %{frr_user}:%{frr_user} %{configdir}/daemons
2cdd3d94
MW
514%endif
515
9473e340 516%if %{with_watchfrr}
9a581ae4 517 # No config for watchfrr - this is part of /etc/sysconfig/frr
931e1d68 518 rm -f %{configdir}/watchfrr.*
f755bf6d
MW
519%endif
520
931e1d68
RK
521if [ ! -e %{configdir}/vtysh.conf ]; then
522 touch %{configdir}/vtysh.conf
523 chmod 640 %{configdir}/vtysh.conf
2cdd3d94 524%if 0%{?frr_user:1}
5f371d0b
RK
525 %if 0%{?vty_group:1}
526 chown %{frr_user}:%{vty_group} %{configdir}/vtysh.conf*
527 %endif
f755bf6d 528%endif
788cdc6d 529fi
530
95c16f4c 531
788cdc6d 532%postun
fc43ecc7 533if [ "$1" -ge 1 ]; then
19ced9a4
MW
534 #
535 # Upgrade from older version
536 #
9a581ae4
MW
537 %if "%{initsystem}" == "systemd"
538 ##
539 ## Systemd Version
540 ##
c88ca85d 541 %systemd_postun_with_restart frr.service
9a581ae4
MW
542 %else
543 ##
544 ## init.d Version
545 ##
515a8ee8 546 service frr restart >/dev/null 2>&1
9a581ae4 547 %endif
e321aed1 548 :
788cdc6d 549fi
788cdc6d 550
95c16f4c 551
788cdc6d 552%preun
f755bf6d 553%if "%{initsystem}" == "systemd"
9a581ae4
MW
554 ##
555 ## Systemd Version
556 ##
c88ca85d
MW
557 if [ $1 -eq 0 ] ; then
558 %systemd_preun frr.service
9a581ae4 559 fi
f755bf6d 560%else
9a581ae4
MW
561 ##
562 ## init.d Version
563 ##
c88ca85d 564 if [ $1 -eq 0 ] ; then
515a8ee8 565 service frr stop >/dev/null 2>&1
c2953ac5 566 /sbin/chkconfig --del frr
9a581ae4 567 fi
f755bf6d 568%endif
c115e4a4 569/sbin/install-info --delete %{_infodir}/frr.info.gz %{_infodir}/dir
788cdc6d 570
95c16f4c 571
788cdc6d 572%files
d88f1144 573%doc */*.sample* COPYING
30b9d89b 574%doc doc/mpls
f20aafee 575%doc README.md
7cad61cb 576/usr/share/yang/*.yang
c115e4a4 577%if 0%{?frr_user:1}
1dc5a0dc 578 %dir %attr(751,%{frr_user},%{frr_user}) %{configdir}
4f20eab1 579 %dir %attr(750,%{frr_user},%{frr_user}) %{_localstatedir}/log/frr
1dc5a0dc 580 %dir %attr(751,%{frr_user},%{frr_user}) %{rundir}
edd7c245 581%else
5f371d0b 582 %dir %attr(750,root,root) %{configdir}
4f20eab1 583 %dir %attr(750,root,root) %{_localstatedir}/log/frr
5f371d0b 584 %dir %attr(750,root,root) %{rundir}
edd7c245 585%endif
f755bf6d 586%if 0%{?vty_group:1}
1dc5a0dc 587 %attr(750,%{frr_user},%{vty_group}) %{configdir}/vtysh.conf.sample
edd7c245 588%endif
c115e4a4 589%{_infodir}/frr.info.gz
788cdc6d 590%{_mandir}/man*/*
54b25dca 591%{_sbindir}/zebra
7ac1de8e 592%{_sbindir}/staticd
54b25dca 593%{_sbindir}/ospfd
594%{_sbindir}/ripd
595%{_sbindir}/bgpd
2cdd3d94 596%exclude %{_sbindir}/ssd
9473e340 597%if %{with_watchfrr}
9a581ae4 598 %{_sbindir}/watchfrr
f755bf6d 599%endif
54b25dca 600%{_sbindir}/ripngd
601%{_sbindir}/ospf6d
41b86ba4
MW
602%if %{with_pimd}
603 %{_sbindir}/pimd
604%endif
1abe1280
DS
605%if %{with_pbrd}
606 %{_sbindir}/pbrd
607%endif
97b5f22b
QY
608%if %{with_vrrpd}
609 %{_sbindir}/vrrpd
610%endif
54b25dca 611%{_sbindir}/isisd
13d9aad8 612%{_sbindir}/fabricd
b021388f 613%if %{with_ldpd}
c2953ac5 614 %{_sbindir}/ldpd
b021388f 615%endif
5a76db68
MW
616%if %{with_eigrpd}
617 %{_sbindir}/eigrpd
618%endif
729f041c 619%if %{with_nhrpd}
5a76db68 620 %{_sbindir}/nhrpd
729f041c 621%endif
e763afa5
DL
622%if %{with_babeld}
623 %{_sbindir}/babeld
624%endif
7134904b
RZ
625%if %{with_bfdd}
626 %{_sbindir}/bfdd
627%endif
5c3ad1d4 628%{_libdir}/lib*.so.0
4aa7422e 629%{_libdir}/lib*.so.0.*
84b05ca1 630%if %{with_fpm}
4aa7422e 631 %{_libdir}/frr/modules/zebra_fpm.so
84b05ca1 632%endif
b4c554e2 633%if %{with_rpki}
4aa7422e 634 %{_libdir}/frr/modules/bgpd_rpki.so
b4c554e2 635%endif
4aa7422e 636%{_libdir}/frr/modules/zebra_irdp.so
ed18356f 637%{_libdir}/frr/modules/bgpd_bmp.so
788cdc6d 638%{_bindir}/*
9b979646 639%config(noreplace) %{configdir}/[!v]*.conf*
1dc5a0dc 640%config(noreplace) %attr(750,%{frr_user},%{frr_user}) %{configdir}/daemons
f755bf6d 641%if "%{initsystem}" == "systemd"
07a138ec 642 %{_unitdir}/frr.service
f755bf6d 643%else
9b979646 644 %{_initddir}/frr
f755bf6d 645%endif
9b979646
RK
646%config(noreplace) %{_sysconfdir}/pam.d/frr
647%config(noreplace) %{_sysconfdir}/logrotate.d/frr
32398f01 648%{_sbindir}/frr-reload
ea4d91bf
DL
649%{_sbindir}/frrcommon.sh
650%{_sbindir}/frrinit.sh
651%{_sbindir}/watchfrr.sh
788cdc6d 652
95c16f4c 653
448ed4a2 654%files contrib
448ed4a2 655%doc tools
656
95c16f4c 657
386fcd12 658%files pythontools
11c83aa4
SMS
659%{_sbindir}/generate_support_bundle.py
660%{_sbindir}/generate_support_bundle.pyc
661%{_sbindir}/generate_support_bundle.pyo
386fcd12
MW
662%{_sbindir}/frr-reload.py
663%{_sbindir}/frr-reload.pyc
664%{_sbindir}/frr-reload.pyo
665
95c16f4c 666
e0626854 667%files devel
d1ef2aaf 668%{_libdir}/lib*.so
4aa7422e 669%dir %{_includedir}/%{name}
b8b18c06 670%{_includedir}/%{name}/*.h
4aa7422e 671%dir %{_includedir}/%{name}/ospfd
b8b18c06 672%{_includedir}/%{name}/ospfd/*.h
54b25dca 673%if %{with_ospfapi}
4aa7422e 674 %dir %{_includedir}/%{name}/ospfapi
b8b18c06 675 %{_includedir}/%{name}/ospfapi/*.h
68980084 676%endif
5a76db68 677%if %{with_eigrpd}
4aa7422e 678 %dir %{_includedir}/%{name}/eigrpd
b8b18c06 679 %{_includedir}/%{name}/eigrpd/*.h
5a76db68 680%endif
e0626854 681
95c16f4c 682
788cdc6d 683%changelog
7134904b
RZ
684* Sun May 28 2018 Rafael Zalamena <rzalamena@opensourcerouting.org> - %{version}
685- Add BFDd support
686
bc1dc4fe 687* Sun May 20 2018 Martin Winter <mwinter@opensourcerouting.org>
b4c554e2
MW
688- Fixed RPKI RPM build
689
690* Sun Mar 4 2018 Martin Winter <mwinter@opensourcerouting.org>
aaf38c94
MW
691- Add option to build with RPKI (default: disabled)
692
693* Tue Feb 20 2018 Martin Winter <mwinter@opensourcerouting.org>
609dee9d
MW
694- Adapt to new documentation structure based on Sphinx
695
696* Fri Oct 20 2017 Martin Winter <mwinter@opensourcerouting.org>
75429e11 697- Fix script location for watchfrr restart functions in daemon config
c88ca85d 698- Fix postun script to restart frr during upgrade
75429e11
MW
699
700* Mon Jun 5 2017 Martin Winter <mwinter@opensourcerouting.org>
5a76db68
MW
701- added NHRP and EIGRP daemon
702
703* Mon Apr 17 2017 Martin Winter <mwinter@opensourcerouting.org>
41b86ba4
MW
704- new subpackage frr-pythontools with python 2.7 restart script
705- remove PIMd from CentOS/RedHat 6 RPM packages (won't work - too old)
2cdd3d94 706- converted to single frr init script (not per daemon) based on debian init script
150e7c7e 707- created systemd service file for systemd based systems (which uses init script)
41b86ba4
MW
708- Various other RPM package fixes for FRR 2.0
709
710* Fri Jan 6 2017 Martin Winter <mwinter@opensourcerouting.org>
447a8fe9 711- Renamed to frr for FRRouting fork of Quagga
c115e4a4 712
150e7c7e 713* Thu Feb 11 2016 Paul Jakma <paul@jakma.org>
30da4585
PJ
714- remove with_ipv6 conditionals, always build v6
715- Fix UTF-8 char in spec changelog
716- remove quagga.pam.stack, long deprecated.
717
f755bf6d
MW
718* Thu Oct 22 2015 Martin Winter <mwinter@opensourcerouting.org>
719- Cleanup configure: remove --enable-ipv6 (default now), --enable-nssa,
720 --enable-netlink
721- Remove support for old fedora 4/5
722- Fix for package nameing
723- Fix Weekdays of previous changelogs (bogus dates)
150e7c7e 724- Add conditional logic to only build tex footnotes with supported texi2html
f755bf6d
MW
725- Added pimd to files section and fix double listing of /var/lib*/quagga
726- Numerous fixes to unify upstart/systemd startup into same spec file
9473e340 727- Only allow use of watchfrr for non-systemd systems. no need with systemd
f755bf6d
MW
728
729* Fri Sep 4 2015 Paul Jakma <paul@jakma.org>
7c08d77f
PJ
730- buildreq updates
731- add a default define for with_pimd
732
f755bf6d 733* Mon Sep 12 2005 Paul Jakma <paul@dishone.st>
e7cd37bf 734- Steal some changes from Fedora spec file:
735- Add with_rtadv variable
736- Test for groups/users with getent before group/user adding
737- Readline need not be an explicit prerequisite
738- install-info delete should be postun, not preun
739
fc43ecc7 740* Wed Jan 12 2005 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
741- on package upgrade, implement careful, phased restart logic
742- use gcc -rdynamic flag when linking for better backtraces
743
f3931751 744* Wed Dec 22 2004 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
745- daemonv6_list should contain only IPv6 daemons
746
b3324e27 747* Wed Dec 22 2004 Andrew J. Schorr <ajschorr@alumni.princeton.edu>
9473e340 748- watchfrr added
b3324e27 749- on upgrade, all daemons should be condrestart'ed
750- on removal, all daemons should be stopped
751
36002ae5 752* Mon Nov 08 2004 Paul Jakma <paul@dishone.st>
753- Use makeinfo --html to generate quagga.html
754
0df63b52 755* Sun Nov 07 2004 Paul Jakma <paul@dishone.st>
756- Fix with_ipv6 set to 0 build
757
cfc1842b 758* Sat Oct 23 2004 Paul Jakma <paul@dishone.st>
759- Update to 0.97.2
760
761* Sat Oct 23 2004 Andrew J. Schorr <aschorr@telemetry-investments.com>
762- Make directories be owned by the packages concerned
763- Update logrotate scripts to use correct path to killall and use pid files
764
da29c6b0 765* Fri Oct 08 2004 Paul Jakma <paul@dishone.st>
766- Update to 0.97.0
767
54b25dca 768* Wed Sep 15 2004 Paul Jakma <paul@dishone.st>
769- build snmp support by default
770- build irdp support
771- build with shared libs
772- devel subpackage for archives and headers
773
00bc5603 774* Thu Jan 08 2004 Paul Jakma <paul@dishone.st>
775- updated sysconfig files to specify local dir
776- added ospf_dump.c crash quick fix patch
777- added ospfd persistent interface configuration patch
778
15d74e93 779* Tue Dec 30 2003 Paul Jakma <paul@dishone.st>
780- sync to CVS
781- integrate RH sysconfig patch to specify daemon options (RH)
782- default to have vty listen only to 127.1 (RH)
783- add user with fixed UID/GID (RH)
784- create user with shell /sbin/nologin rather than /bin/false (RH)
785- stop daemons on uninstall (RH)
f755bf6d 786- delete info file on preun, not postun to avoid deletion on upgrade. (RH)
15d74e93 787- isisd added
788- cleanup tasks carried out for every daemon
789
406f7000 790* Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
791- Fix -devel package to include all files
792- Sync to 0.96.4
793
6bd8fd3b 794* Tue Aug 12 2003 Paul Jakma <paul@dishone.st>
795- Renamed to Quagga
796- Sync to Quagga release 0.96
797
f755bf6d 798* Thu Mar 20 2003 Paul Jakma <paul@dishone.st>
edd7c245 799- zebra privileges support
800
f755bf6d 801* Tue Mar 18 2003 Paul Jakma <paul@dishone.st>
e0626854 802- Fix mem leak in 'show thread cpu'
803- Ralph Keller's OSPF-API
804- Amir: Fix configure.ac for net-snmp
805
448ed4a2 806* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
807- ospfd IOS prefix to interface matching for 'network' statement
808- temporary fix for PtP and IPv6
809- sync to zebra.org CVS
810
8f754983 811* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
812- update to latest cvs
813- Yon's "show thread cpu" patch - 17217
814- walk up tree - 17218
815- ospfd NSSA fixes - 16681
816- ospfd nsm fixes - 16824
150e7c7e 817- ospfd OLSA fixes and new feature - 16823
8f754983 818- KAME and ifindex fixes - 16525
819- spec file changes to allow redhat files to be in tree
820
d7ccae28 821* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
822- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
823- Fixed up some build requirements (patch)
824- Added conditional build requirements for vtysh / snmp
f755bf6d 825- Added conditional to files for _bindir depending on vtysh
d7ccae28 826
788cdc6d 827* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
828- update to latest CVS
829- add Greg Troxel's md5 buffer copy/dup fix
830- add RIPv1 fix
831- add Frank's multicast flag fix
832
833* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
834- update to latest CVS
835- timestamped crypt_seqnum patch
836- oi->on_write_q fix
837
838* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
839- update to latest CVS
840- add vtysh 'write-config (integrated|daemon)' patch
841- always 'make rebuild' in vtysh/ to catch new commands
842
843* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
844- update to 0.93b
845
846* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
847- update to latest CVS
848- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
849
850* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
851- update to current CVS
852- add OSPF point to multipoint patch
853- add OSPF bugfixes
854- add BGP hash optimisation patch
855
856* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
857- update to 0.93-pre1 / CVS
858- add link state detection support
859- add generic PtP and RFC3021 support
860- various bug fixes
861
862* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
863- Fix bug #51336
864
f755bf6d 865* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
788cdc6d 866- Use generic initscript strings instead of initscript specific
867 ( "Starting foo: " -> "Starting $prog:" )
868
869* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
870- Bump the release when rebuilding into the dist.
871
872* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
873- built for Powertools
874
150e7c7e 875* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
788cdc6d 876- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
877- Update to 0.91a
878- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
879- Should be quite Red Hat'isque now.