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