]>
Commit | Line | Data |
---|---|---|
edd7c245 | 1 | # configure options |
b63cef7c | 2 | %define with_snmp 1 |
788cdc6d | 3 | %define with_vtysh 1 |
4 | %define with_ospf_te 1 | |
5 | %define with_nssa 1 | |
6 | %define with_opaque_lsa 1 | |
7 | %define with_tcp_zebra 0 | |
8 | %define with_vtysh 1 | |
9 | %define with_pam 1 | |
10 | %define with_ipv6 1 | |
55ea381f | 11 | %define with_ospfclient 1 |
12 | %define with_ospfapi 1 | |
cfc1842b | 13 | %define with_irdp 1 |
54b25dca | 14 | %define with_isisd 0 |
15 | %define with_shared 1 | |
8f754983 | 16 | %define with_multipath 64 |
6bd8fd3b | 17 | %define quagga_user quagga |
45315b5d | 18 | %define vty_group quaggavty |
30b9d89b | 19 | |
20 | # path defines | |
6bd8fd3b | 21 | %define _sysconfdir /etc/quagga |
8f754983 | 22 | %define zeb_src %{_builddir}/%{name}-%{version} |
23 | %define zeb_rh_src %{zeb_src}/redhat | |
24 | %define zeb_docs %{zeb_src}/doc | |
788cdc6d | 25 | |
e0626854 | 26 | # defines for configure |
6bd8fd3b | 27 | %define _libexecdir %{_exec_prefix}/libexec/quagga |
6bd8fd3b | 28 | %define _libdir %{_exec_prefix}/%{_lib}/quagga |
15d74e93 | 29 | %define _includedir %{_prefix}/include |
6bd8fd3b | 30 | %define _localstatedir /var/run/quagga |
e0626854 | 31 | |
15d74e93 | 32 | # misc internal defines |
33 | %define quagga_uid 92 | |
34 | %define quagga_gid 92 | |
54b25dca | 35 | %define daemon_list zebra ripd ospfd bgpd |
36 | %if %{with_ipv6} | |
69f5d260 | 37 | %define daemonv6_list %{daemon_list} ripngd ospf6d |
54b25dca | 38 | %endif |
39 | %if %{with_isisd} | |
69f5d260 | 40 | %define daemon_other isisd |
41 | %else | |
42 | %define daemon_other "" | |
15d74e93 | 43 | %endif |
44 | ||
b5f310cb | 45 | # allow build dir to be kept |
46 | %define keep_build 0 | |
47 | ||
788cdc6d | 48 | Summary: Routing daemon |
6bd8fd3b | 49 | Name: quagga |
6382b6f8 | 50 | Version: @VERSION@ |
edd7c245 | 51 | Release: @CONFDATE@01 |
788cdc6d | 52 | License: GPL |
53 | Group: System Environment/Daemons | |
6bd8fd3b | 54 | Source0: http://www.quagga.net/snapshots/cvs/%{name}-%{version}.tar.gz |
55 | URL: http://www.quagga.net | |
54b25dca | 56 | %if %{with_snmp} |
b63cef7c | 57 | BuildRequires: net-snmp-devel |
58 | Prereq: net-snmp | |
788cdc6d | 59 | %endif |
54b25dca | 60 | %if %{with_vtysh} |
30b9d89b | 61 | BuildRequires: readline readline-devel ncurses ncurses-devel |
d7ccae28 | 62 | Prereq: readline ncurses |
63 | %endif | |
15d74e93 | 64 | BuildRequires: texinfo tetex autoconf pam-devel patch libcap-devel |
788cdc6d | 65 | # Initscripts > 5.60 is required for IPv6 support |
30b9d89b | 66 | Prereq: initscripts >= 5.60 |
45315b5d | 67 | Prereq: ncurses readline pam |
788cdc6d | 68 | Prereq: /sbin/install-info |
69 | Provides: routingdaemon | |
70 | BuildRoot: %{_tmppath}/%{name}-%{version}-root | |
6bd8fd3b | 71 | Obsoletes: bird gated mrt zebra |
788cdc6d | 72 | |
73 | %description | |
6bd8fd3b | 74 | Quagga is a free software that manages TCP/IP based routing |
788cdc6d | 75 | protocol. It takes multi-server and multi-thread approach to resolve |
76 | the current complexity of the Internet. | |
77 | ||
6bd8fd3b | 78 | Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng. |
788cdc6d | 79 | |
6bd8fd3b | 80 | Quagga is intended to be used as a Route Server and a Route Reflector. It is |
81 | not a toolkit, it provides full routing power under a new architecture. | |
82 | Quagga by design has a process for each protocol. | |
83 | ||
84 | Quagga is a fork of GNU Zebra. | |
788cdc6d | 85 | |
448ed4a2 | 86 | %package contrib |
6bd8fd3b | 87 | Summary: contrib tools for quagga |
448ed4a2 | 88 | Group: System Environment/Daemons |
89 | ||
90 | %description contrib | |
6bd8fd3b | 91 | Contributed/3rd party tools which may be of use with quagga. |
448ed4a2 | 92 | |
e0626854 | 93 | %package devel |
6bd8fd3b | 94 | Summary: Header and object files for quagga development |
e0626854 | 95 | Group: System Environment/Daemons |
96 | ||
97 | %description devel | |
6bd8fd3b | 98 | The quagga-devel package contains the header and object files neccessary for |
99 | developing OSPF-API and quagga applications. | |
e0626854 | 100 | |
788cdc6d | 101 | %prep |
102 | %setup -q | |
788cdc6d | 103 | |
104 | %build | |
105 | %configure \ | |
54b25dca | 106 | %if !%{with_shared} |
107 | --disable-shared \ | |
108 | %endif | |
109 | %if %{with_ipv6} | |
788cdc6d | 110 | --enable-ipv6 \ |
111 | %endif | |
54b25dca | 112 | %if %{with_snmp} |
788cdc6d | 113 | --enable-snmp \ |
114 | %endif | |
54b25dca | 115 | %if %{with_multipath} |
116 | --enable-multipath=%{with_multipath} \ | |
788cdc6d | 117 | %endif |
54b25dca | 118 | %if %{with_tcp_zebra} |
788cdc6d | 119 | --enable-tcp-zebra \ |
120 | %endif | |
54b25dca | 121 | %if %{with_nssa} |
788cdc6d | 122 | --enable-nssa \ |
123 | %endif | |
54b25dca | 124 | %if %{with_opaque_lsa} |
788cdc6d | 125 | --enable-opaque-lsa \ |
126 | %endif | |
54b25dca | 127 | %if %{with_ospf_te} |
788cdc6d | 128 | --enable-ospf-te \ |
129 | %endif | |
54b25dca | 130 | %if %{with_vtysh} |
788cdc6d | 131 | --enable-vtysh \ |
132 | %endif | |
54b25dca | 133 | %if %{with_ospfclient} |
68980084 | 134 | --enable-ospfclient=yes \ |
135 | %else | |
136 | --enable-ospfclient=no\ | |
137 | %endif | |
54b25dca | 138 | %if %{with_ospfapi} |
68980084 | 139 | --enable-ospfapi=yes \ |
140 | %else | |
141 | --enable-ospfapi=no \ | |
142 | %endif | |
54b25dca | 143 | %if %{with_irdp} |
5b819262 | 144 | --enable-irdp=yes \ |
145 | %else | |
146 | --enable-irdp=no \ | |
147 | %endif | |
54b25dca | 148 | %if %{with_isisd} |
149 | --enable-isisd \ | |
150 | %else | |
69f5d260 | 151 | --disable-isisd \ |
54b25dca | 152 | %endif |
153 | %if %{with_pam} | |
edd7c245 | 154 | --with-libpam \ |
788cdc6d | 155 | %endif |
6bd8fd3b | 156 | %if %quagga_user |
157 | --enable-user=%quagga_user \ | |
158 | --enable-group=%quagga_user \ | |
edd7c245 | 159 | %endif |
160 | %if %vty_group | |
161 | --enable-vty-group=%vty_group \ | |
162 | %endif | |
edd7c245 | 163 | --enable-netlink |
788cdc6d | 164 | |
165 | make %{?_smp_mflags} MAKEINFO="makeinfo --no-split" | |
166 | ||
167 | pushd doc | |
6bd8fd3b | 168 | texi2html quagga.texi |
788cdc6d | 169 | popd |
170 | ||
171 | %install | |
172 | rm -rf $RPM_BUILD_ROOT | |
173 | ||
174 | install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \ | |
6bd8fd3b | 175 | $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir} |
788cdc6d | 176 | |
177 | make install \ | |
178 | DESTDIR=$RPM_BUILD_ROOT | |
179 | ||
9a344b74 | 180 | # Remove this file, as it is uninstalled and causes errors when building on RH9 |
181 | rm -rf $RPM_BUILD_ROOT/usr/share/info/dir | |
182 | ||
15d74e93 | 183 | # install etc sources |
69f5d260 | 184 | for daemon in %{daemon_list} %{daemonv6_list} %{daemon_other} ; do |
da29c6b0 | 185 | if [ x"${daemon}" != x"" ] ; then |
186 | install %{zeb_rh_src}/${daemon}.init \ | |
187 | $RPM_BUILD_ROOT/etc/rc.d/init.d/${daemon} | |
188 | fi | |
15d74e93 | 189 | done |
190 | install -m644 %{zeb_rh_src}/quagga.pam \ | |
191 | $RPM_BUILD_ROOT/etc/pam.d/quagga | |
192 | install -m644 %{zeb_rh_src}/quagga.logrotate \ | |
193 | $RPM_BUILD_ROOT/etc/logrotate.d/quagga | |
194 | install -m644 %{zeb_rh_src}/quagga.sysconfig \ | |
195 | $RPM_BUILD_ROOT/etc/sysconfig/quagga | |
6bd8fd3b | 196 | install -d -m750 $RPM_BUILD_ROOT/var/run/quagga |
edd7c245 | 197 | |
198 | %pre | |
199 | # add vty_group | |
200 | %if %vty_group | |
201 | groupadd -r %vty_group 2> /dev/null || : | |
202 | %endif | |
6bd8fd3b | 203 | # add quagga user and group |
204 | %if %quagga_user | |
15d74e93 | 205 | /usr/sbin/groupadd -g %quagga_gid quagga 2> /dev/null || : |
206 | /usr/sbin/useradd -u %quagga_uid -g %quagga_gid \ | |
207 | -M -r -s /sbin/nologin -c "Quagga routing suite" \ | |
6bd8fd3b | 208 | -d %_localstatedir %quagga_user 2> /dev/null || : |
edd7c245 | 209 | %endif |
788cdc6d | 210 | |
788cdc6d | 211 | %post |
30b9d89b | 212 | # zebra_spec_add_service <service name> <port/proto> <comment> |
788cdc6d | 213 | # e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service" |
214 | ||
215 | zebra_spec_add_service () | |
216 | { | |
217 | # Add port /etc/services entry if it isn't already there | |
6b637e96 | 218 | if [ -f /etc/services ] && \ |
219 | ! %__sed -e 's/#.*$//' /etc/services | %__grep -wq $1 ; then | |
788cdc6d | 220 | echo "$1 $2 # $3" >> /etc/services |
221 | fi | |
222 | } | |
223 | ||
224 | zebra_spec_add_service zebrasrv 2600/tcp "zebra service" | |
225 | zebra_spec_add_service zebra 2601/tcp "zebra vty" | |
226 | zebra_spec_add_service ripd 2602/tcp "RIPd vty" | |
54b25dca | 227 | %if %{with_ipv6} |
788cdc6d | 228 | zebra_spec_add_service ripngd 2603/tcp "RIPngd vty" |
d7ccae28 | 229 | %endif |
788cdc6d | 230 | zebra_spec_add_service ospfd 2604/tcp "OSPFd vty" |
231 | zebra_spec_add_service bgpd 2605/tcp "BGPd vty" | |
54b25dca | 232 | %if %{with_ipv6} |
788cdc6d | 233 | zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty" |
d7ccae28 | 234 | %endif |
54b25dca | 235 | %if %{with_ospfapi} |
7021c425 | 236 | zebra_spec_add_service ospfapi 2607/tcp "OSPF-API" |
237 | %endif | |
54b25dca | 238 | %if %{with_isisd} |
5a514b14 | 239 | zebra_spec_add_service isisd 2608/tcp "ISISd vty" |
54b25dca | 240 | %endif |
788cdc6d | 241 | |
15d74e93 | 242 | for daemon in %daemon_list ; do |
243 | /sbin/chkconfig --add ${daemon} | |
244 | done | |
788cdc6d | 245 | |
6bd8fd3b | 246 | /sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir |
788cdc6d | 247 | |
248 | # Create dummy files if they don't exist so basic functions can be used. | |
249 | if [ ! -e %{_sysconfdir}/zebra.conf ]; then | |
250 | echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf | |
251 | chmod 640 %{_sysconfdir}/zebra.conf | |
252 | fi | |
253 | if [ ! -e %{_sysconfdir}/vtysh.conf ]; then | |
254 | touch %{_sysconfdir}/vtysh.conf | |
255 | chmod 640 %{_sysconfdir}/vtysh.conf | |
256 | fi | |
257 | ||
258 | %postun | |
259 | if [ "$1" -ge "1" ]; then | |
15d74e93 | 260 | for daemon in %daemon_list ; do |
261 | /etc/rc.d/init.d/${daemon} condrestart >/dev/null 2>&1 | |
262 | done | |
788cdc6d | 263 | fi |
788cdc6d | 264 | |
265 | %preun | |
266 | if [ "$1" = "0" ]; then | |
15d74e93 | 267 | for daemon in %daemon_list ; do |
268 | /etc/rc.d/init.d/${daemon} stop >/dev/null 2>&1 | |
269 | /sbin/chkconfig --del ${daemon} | |
270 | done | |
271 | /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir | |
788cdc6d | 272 | fi |
273 | ||
274 | %clean | |
b5f310cb | 275 | %if !%{keep_build} |
276 | rm -rf $RPM_BUILD_ROOT | |
277 | %endif | |
788cdc6d | 278 | |
279 | %files | |
280 | %defattr(-,root,root) | |
448ed4a2 | 281 | %doc */*.sample* AUTHORS COPYING |
6bd8fd3b | 282 | %doc doc/quagga.html |
30b9d89b | 283 | %doc doc/mpls |
8f754983 | 284 | %doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO |
54b25dca | 285 | %if %{quagga_user} |
6bd8fd3b | 286 | %dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir} |
287 | %dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga | |
288 | %dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga | |
edd7c245 | 289 | %else |
788cdc6d | 290 | %dir %attr(750,root,root) %{_sysconfdir} |
6bd8fd3b | 291 | %dir %attr(750,root,root) /var/log/quagga |
788cdc6d | 292 | %dir %attr(755,root,root) /usr/share/info |
6bd8fd3b | 293 | %dir %attr(750,root,root) /var/run/quagga |
edd7c245 | 294 | %endif |
54b25dca | 295 | %if %{vty_group} |
6bd8fd3b | 296 | %attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample |
edd7c245 | 297 | %endif |
788cdc6d | 298 | %{_infodir}/*info* |
299 | %{_mandir}/man*/* | |
54b25dca | 300 | %{_sbindir}/zebra |
301 | %{_sbindir}/ospfd | |
302 | %{_sbindir}/ripd | |
303 | %{_sbindir}/bgpd | |
304 | %if %{with_ipv6} | |
305 | %{_sbindir}/ripngd | |
306 | %{_sbindir}/ospf6d | |
307 | %endif | |
308 | %if %{with_isisd} | |
309 | %{_sbindir}/isisd | |
310 | %endif | |
cfc1842b | 311 | %dir %attr(755,root,root) %{_libdir} |
28f79728 | 312 | %if %{with_shared} |
2ff9e826 | 313 | %{_libdir}/lib*.so |
314 | %{_libdir}/lib*.so.* | |
54b25dca | 315 | %endif |
316 | %if %{with_vtysh} | |
788cdc6d | 317 | %{_bindir}/* |
d7ccae28 | 318 | %endif |
6bd8fd3b | 319 | %config /etc/quagga/[!v]* |
788cdc6d | 320 | %config /etc/rc.d/init.d/* |
15d74e93 | 321 | %config(noreplace) /etc/sysconfig/quagga |
6bd8fd3b | 322 | %config(noreplace) /etc/pam.d/quagga |
788cdc6d | 323 | %config(noreplace) %attr(640,root,root) /etc/logrotate.d/* |
324 | ||
448ed4a2 | 325 | %files contrib |
326 | %defattr(-,root,root) | |
327 | %doc tools | |
328 | ||
e0626854 | 329 | %files devel |
330 | %defattr(-,root,root) | |
da29c6b0 | 331 | %if %{with_ospfclient} |
332 | %{_sbindir}/ospfclient | |
333 | %endif | |
28f79728 | 334 | %{_libdir}/*.a |
335 | %{_libdir}/*.la | |
cfc1842b | 336 | %dir %attr(755,root,root) %{_includedir}/%{name} |
28f79728 | 337 | %{_includedir}/%name/*.h |
cfc1842b | 338 | %dir %attr(755,root,root) %{_includedir}/%{name}/ospfd |
28f79728 | 339 | %{_includedir}/%name/ospfd/*.h |
54b25dca | 340 | %if %{with_ospfapi} |
cfc1842b | 341 | %dir %attr(755,root,root) %{_includedir}/%{name}/ospfapi |
28f79728 | 342 | %{_includedir}/%name/ospfapi/*.h |
68980084 | 343 | %endif |
e0626854 | 344 | |
788cdc6d | 345 | %changelog |
15d74e93 | 346 | %changelog |
cfc1842b | 347 | * Sat Oct 23 2004 Paul Jakma <paul@dishone.st> |
348 | - Update to 0.97.2 | |
349 | ||
350 | * Sat Oct 23 2004 Andrew J. Schorr <aschorr@telemetry-investments.com> | |
351 | - Make directories be owned by the packages concerned | |
352 | - Update logrotate scripts to use correct path to killall and use pid files | |
353 | ||
da29c6b0 | 354 | * Fri Oct 08 2004 Paul Jakma <paul@dishone.st> |
355 | - Update to 0.97.0 | |
356 | ||
54b25dca | 357 | * Wed Sep 15 2004 Paul Jakma <paul@dishone.st> |
358 | - build snmp support by default | |
359 | - build irdp support | |
360 | - build with shared libs | |
361 | - devel subpackage for archives and headers | |
362 | ||
00bc5603 | 363 | * Thu Jan 08 2004 Paul Jakma <paul@dishone.st> |
364 | - updated sysconfig files to specify local dir | |
365 | - added ospf_dump.c crash quick fix patch | |
366 | - added ospfd persistent interface configuration patch | |
367 | ||
15d74e93 | 368 | * Tue Dec 30 2003 Paul Jakma <paul@dishone.st> |
369 | - sync to CVS | |
370 | - integrate RH sysconfig patch to specify daemon options (RH) | |
371 | - default to have vty listen only to 127.1 (RH) | |
372 | - add user with fixed UID/GID (RH) | |
373 | - create user with shell /sbin/nologin rather than /bin/false (RH) | |
374 | - stop daemons on uninstall (RH) | |
375 | - delete info file on %preun, not %postun to avoid deletion on upgrade. (RH) | |
376 | - isisd added | |
377 | - cleanup tasks carried out for every daemon | |
378 | ||
406f7000 | 379 | * Sun Nov 2 2003 Paul Jakma <paul@dishone.st> |
380 | - Fix -devel package to include all files | |
381 | - Sync to 0.96.4 | |
382 | ||
6bd8fd3b | 383 | * Tue Aug 12 2003 Paul Jakma <paul@dishone.st> |
384 | - Renamed to Quagga | |
385 | - Sync to Quagga release 0.96 | |
386 | ||
edd7c245 | 387 | * Tue Mar 20 2003 Paul Jakma <paul@dishone.st> |
388 | - zebra privileges support | |
389 | ||
e0626854 | 390 | * Mon Mar 18 2003 Paul Jakma <paul@dishone.st> |
391 | - Fix mem leak in 'show thread cpu' | |
392 | - Ralph Keller's OSPF-API | |
393 | - Amir: Fix configure.ac for net-snmp | |
394 | ||
448ed4a2 | 395 | * Sat Mar 1 2003 Paul Jakma <paul@dishone.st> |
396 | - ospfd IOS prefix to interface matching for 'network' statement | |
397 | - temporary fix for PtP and IPv6 | |
398 | - sync to zebra.org CVS | |
399 | ||
8f754983 | 400 | * Mon Jan 20 2003 Paul Jakma <paul@dishone.st> |
401 | - update to latest cvs | |
402 | - Yon's "show thread cpu" patch - 17217 | |
403 | - walk up tree - 17218 | |
404 | - ospfd NSSA fixes - 16681 | |
405 | - ospfd nsm fixes - 16824 | |
406 | - ospfd OLSA fixes and new feature - 16823 | |
407 | - KAME and ifindex fixes - 16525 | |
408 | - spec file changes to allow redhat files to be in tree | |
409 | ||
d7ccae28 | 410 | * Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com> |
411 | - Added conditionals for building with(out) IPv6, vtysh, RIP, BGP | |
412 | - Fixed up some build requirements (patch) | |
413 | - Added conditional build requirements for vtysh / snmp | |
414 | - Added conditional to %files for %_bindir depending on vtysh | |
415 | ||
788cdc6d | 416 | * Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie> |
417 | - update to latest CVS | |
418 | - add Greg Troxel's md5 buffer copy/dup fix | |
419 | - add RIPv1 fix | |
420 | - add Frank's multicast flag fix | |
421 | ||
422 | * Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie> | |
423 | - update to latest CVS | |
424 | - timestamped crypt_seqnum patch | |
425 | - oi->on_write_q fix | |
426 | ||
427 | * Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie> | |
428 | - update to latest CVS | |
429 | - add vtysh 'write-config (integrated|daemon)' patch | |
430 | - always 'make rebuild' in vtysh/ to catch new commands | |
431 | ||
432 | * Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie> | |
433 | - update to 0.93b | |
434 | ||
435 | * Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie> | |
436 | - update to latest CVS | |
437 | - add "/sbin/ip route flush proto zebra" to zebra RH init on startup | |
438 | ||
439 | * Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie> | |
440 | - update to current CVS | |
441 | - add OSPF point to multipoint patch | |
442 | - add OSPF bugfixes | |
443 | - add BGP hash optimisation patch | |
444 | ||
445 | * Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie> | |
446 | - update to 0.93-pre1 / CVS | |
447 | - add link state detection support | |
448 | - add generic PtP and RFC3021 support | |
449 | - various bug fixes | |
450 | ||
451 | * Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6 | |
452 | - Fix bug #51336 | |
453 | ||
454 |