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