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