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