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