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