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