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