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