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