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