blob: 738464f8a424ee93f274f7e3d63b8cd7ff85bd20 [file] [log] [blame]
pauledd7c242003-06-04 13:59:38 +00001# configure options
paulb63cef72004-08-19 03:36:13 +00002%define with_snmp 1
paul788cdc62003-01-18 00:22:08 +00003%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
paul55ea3812003-04-07 08:14:11 +000011%define with_ospfclient 1
12%define with_ospfapi 1
paul5b819262004-07-28 14:11:55 +000013%define with_irdp 1
paul8f754982003-01-20 04:55:51 +000014%define with_multipath 64
paul6bd8fd32003-08-12 12:54:13 +000015%define quagga_user quagga
paul45315b52003-08-14 05:23:50 +000016%define vty_group quaggavty
paul30b9d892003-01-18 22:57:15 +000017
18# path defines
paul6bd8fd32003-08-12 12:54:13 +000019%define _sysconfdir /etc/quagga
paul8f754982003-01-20 04:55:51 +000020%define zeb_src %{_builddir}/%{name}-%{version}
21%define zeb_rh_src %{zeb_src}/redhat
22%define zeb_docs %{zeb_src}/doc
paul788cdc62003-01-18 00:22:08 +000023
paule0626852003-03-18 14:11:36 +000024# defines for configure
paul6bd8fd32003-08-12 12:54:13 +000025%define _libexecdir %{_exec_prefix}/libexec/quagga
paul6bd8fd32003-08-12 12:54:13 +000026%define _libdir %{_exec_prefix}/%{_lib}/quagga
paul15d74e92003-12-30 11:16:21 +000027%define _includedir %{_prefix}/include
paul6bd8fd32003-08-12 12:54:13 +000028%define _localstatedir /var/run/quagga
paule0626852003-03-18 14:11:36 +000029
paul15d74e92003-12-30 11:16:21 +000030# misc internal defines
31%define quagga_uid 92
32%define quagga_gid 92
33%if %with_ipv6
34%define daemon_list zebra ripd isisd ospfd ripngd ospf6d bgpd
35%else
36%define daemon_list zebra ripd isisd ospfd bgpd
37%endif
38
paulb5f310c2004-09-13 13:15:25 +000039# allow build dir to be kept
40%define keep_build 0
41
paul788cdc62003-01-18 00:22:08 +000042Summary: Routing daemon
paul6bd8fd32003-08-12 12:54:13 +000043Name: quagga
paul6382b6f2003-05-20 00:17:45 +000044Version: @VERSION@
pauledd7c242003-06-04 13:59:38 +000045Release: @CONFDATE@01
paul788cdc62003-01-18 00:22:08 +000046License: GPL
47Group: System Environment/Daemons
paul6bd8fd32003-08-12 12:54:13 +000048Source0: http://www.quagga.net/snapshots/cvs/%{name}-%{version}.tar.gz
49URL: http://www.quagga.net
paul788cdc62003-01-18 00:22:08 +000050%if %with_snmp
paulb63cef72004-08-19 03:36:13 +000051BuildRequires: net-snmp-devel
52Prereq: net-snmp
paul788cdc62003-01-18 00:22:08 +000053%endif
pauld7ccae22003-01-18 00:24:00 +000054%if %with_vtysh
paul30b9d892003-01-18 22:57:15 +000055BuildRequires: readline readline-devel ncurses ncurses-devel
pauld7ccae22003-01-18 00:24:00 +000056Prereq: readline ncurses
57%endif
paul15d74e92003-12-30 11:16:21 +000058BuildRequires: texinfo tetex autoconf pam-devel patch libcap-devel
paul788cdc62003-01-18 00:22:08 +000059# Initscripts > 5.60 is required for IPv6 support
paul30b9d892003-01-18 22:57:15 +000060Prereq: initscripts >= 5.60
paul45315b52003-08-14 05:23:50 +000061Prereq: ncurses readline pam
paul788cdc62003-01-18 00:22:08 +000062Prereq: /sbin/install-info
63Provides: routingdaemon
64BuildRoot: %{_tmppath}/%{name}-%{version}-root
paul6bd8fd32003-08-12 12:54:13 +000065Obsoletes: bird gated mrt zebra
paul788cdc62003-01-18 00:22:08 +000066
67%description
paul6bd8fd32003-08-12 12:54:13 +000068Quagga is a free software that manages TCP/IP based routing
paul788cdc62003-01-18 00:22:08 +000069protocol. It takes multi-server and multi-thread approach to resolve
70the current complexity of the Internet.
71
paul6bd8fd32003-08-12 12:54:13 +000072Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
paul788cdc62003-01-18 00:22:08 +000073
paul6bd8fd32003-08-12 12:54:13 +000074Quagga is intended to be used as a Route Server and a Route Reflector. It is
75not a toolkit, it provides full routing power under a new architecture.
76Quagga by design has a process for each protocol.
77
78Quagga is a fork of GNU Zebra.
paul788cdc62003-01-18 00:22:08 +000079
paul448ed4a2003-03-01 15:43:28 +000080%package contrib
paul6bd8fd32003-08-12 12:54:13 +000081Summary: contrib tools for quagga
paul448ed4a2003-03-01 15:43:28 +000082Group: System Environment/Daemons
83
84%description contrib
paul6bd8fd32003-08-12 12:54:13 +000085Contributed/3rd party tools which may be of use with quagga.
paul448ed4a2003-03-01 15:43:28 +000086
paule0626852003-03-18 14:11:36 +000087%package devel
paul6bd8fd32003-08-12 12:54:13 +000088Summary: Header and object files for quagga development
paule0626852003-03-18 14:11:36 +000089Group: System Environment/Daemons
90
91%description devel
paul6bd8fd32003-08-12 12:54:13 +000092The quagga-devel package contains the header and object files neccessary for
93developing OSPF-API and quagga applications.
paule0626852003-03-18 14:11:36 +000094
paul788cdc62003-01-18 00:22:08 +000095%prep
96%setup -q
paul788cdc62003-01-18 00:22:08 +000097
98%build
99%configure \
paul788cdc62003-01-18 00:22:08 +0000100%if %with_ipv6
101 --enable-ipv6 \
102%endif
103%if %with_snmp
104 --enable-snmp \
105%endif
106%if %with_multipath
107 --enable-multipath=%with_multipath \
108%endif
109%if %with_tcp_zebra
110 --enable-tcp-zebra \
111%endif
112%if %with_nssa
113 --enable-nssa \
114%endif
115%if %with_opaque_lsa
116 --enable-opaque-lsa \
117%endif
118%if %with_ospf_te
119 --enable-ospf-te \
120%endif
121%if %with_vtysh
122 --enable-vtysh \
123%endif
paul68980082003-03-25 05:07:42 +0000124%if %with_ospfclient
125 --enable-ospfclient=yes \
126%else
127 --enable-ospfclient=no\
128%endif
129%if %with_ospfapi
130 --enable-ospfapi=yes \
131%else
132 --enable-ospfapi=no \
133%endif
paul5b819262004-07-28 14:11:55 +0000134%if %with_irdp
135 --enable-irdp=yes \
136%else
137 --enable-irdp=no \
138%endif
paul788cdc62003-01-18 00:22:08 +0000139%if %with_pam
pauledd7c242003-06-04 13:59:38 +0000140 --with-libpam \
paul788cdc62003-01-18 00:22:08 +0000141%endif
paul6bd8fd32003-08-12 12:54:13 +0000142%if %quagga_user
143 --enable-user=%quagga_user \
144 --enable-group=%quagga_user \
pauledd7c242003-06-04 13:59:38 +0000145%endif
146%if %vty_group
147 --enable-vty-group=%vty_group \
148%endif
pauledd7c242003-06-04 13:59:38 +0000149--enable-netlink
paul788cdc62003-01-18 00:22:08 +0000150
151make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
152
153pushd doc
paul6bd8fd32003-08-12 12:54:13 +0000154texi2html quagga.texi
paul788cdc62003-01-18 00:22:08 +0000155popd
156
157%install
158rm -rf $RPM_BUILD_ROOT
159
160install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
paul6bd8fd32003-08-12 12:54:13 +0000161 $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
paul788cdc62003-01-18 00:22:08 +0000162
163make install \
164 DESTDIR=$RPM_BUILD_ROOT
165
paul9a344b72003-08-05 23:24:58 +0000166# Remove this file, as it is uninstalled and causes errors when building on RH9
167rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
168
paul15d74e92003-12-30 11:16:21 +0000169# install etc sources
170for daemon in %daemon_list ; do
171 install %{zeb_rh_src}/${daemon}.init \
172 $RPM_BUILD_ROOT/etc/rc.d/init.d/${daemon}
173done
174install -m644 %{zeb_rh_src}/quagga.pam \
175 $RPM_BUILD_ROOT/etc/pam.d/quagga
176install -m644 %{zeb_rh_src}/quagga.logrotate \
177 $RPM_BUILD_ROOT/etc/logrotate.d/quagga
178install -m644 %{zeb_rh_src}/quagga.sysconfig \
179 $RPM_BUILD_ROOT/etc/sysconfig/quagga
paul6bd8fd32003-08-12 12:54:13 +0000180install -d -m750 $RPM_BUILD_ROOT/var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000181
182%pre
183# add vty_group
184%if %vty_group
185groupadd -r %vty_group 2> /dev/null || :
186%endif
paul6bd8fd32003-08-12 12:54:13 +0000187# add quagga user and group
188%if %quagga_user
paul15d74e92003-12-30 11:16:21 +0000189/usr/sbin/groupadd -g %quagga_gid quagga 2> /dev/null || :
190/usr/sbin/useradd -u %quagga_uid -g %quagga_gid \
191 -M -r -s /sbin/nologin -c "Quagga routing suite" \
paul6bd8fd32003-08-12 12:54:13 +0000192 -d %_localstatedir %quagga_user 2> /dev/null || :
pauledd7c242003-06-04 13:59:38 +0000193%endif
paul788cdc62003-01-18 00:22:08 +0000194
paul788cdc62003-01-18 00:22:08 +0000195%post
paul30b9d892003-01-18 22:57:15 +0000196# zebra_spec_add_service <service name> <port/proto> <comment>
paul788cdc62003-01-18 00:22:08 +0000197# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
198
199zebra_spec_add_service ()
200{
201 # Add port /etc/services entry if it isn't already there
202 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
203 echo "$1 $2 # $3" >> /etc/services
204 fi
205}
206
207zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
208zebra_spec_add_service zebra 2601/tcp "zebra vty"
209zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000210%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000211zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000212%endif
paul788cdc62003-01-18 00:22:08 +0000213zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
214zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000215%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000216zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000217%endif
paul7021c422003-07-15 12:52:22 +0000218%if %with_ospfapi
219zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
220%endif
jardin5a514b12003-12-23 10:50:21 +0000221zebra_spec_add_service isisd 2608/tcp "ISISd vty"
paul788cdc62003-01-18 00:22:08 +0000222
paul15d74e92003-12-30 11:16:21 +0000223for daemon in %daemon_list ; do
224 /sbin/chkconfig --add ${daemon}
225done
paul788cdc62003-01-18 00:22:08 +0000226
paul6bd8fd32003-08-12 12:54:13 +0000227/sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
paul788cdc62003-01-18 00:22:08 +0000228
229# Create dummy files if they don't exist so basic functions can be used.
230if [ ! -e %{_sysconfdir}/zebra.conf ]; then
231 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
232 chmod 640 %{_sysconfdir}/zebra.conf
233fi
234if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
235 touch %{_sysconfdir}/vtysh.conf
236 chmod 640 %{_sysconfdir}/vtysh.conf
237fi
238
239%postun
240if [ "$1" -ge "1" ]; then
paul15d74e92003-12-30 11:16:21 +0000241 for daemon in %daemon_list ; do
242 /etc/rc.d/init.d/${daemon} condrestart >/dev/null 2>&1
243 done
paul788cdc62003-01-18 00:22:08 +0000244fi
paul788cdc62003-01-18 00:22:08 +0000245
246%preun
247if [ "$1" = "0" ]; then
paul15d74e92003-12-30 11:16:21 +0000248 for daemon in %daemon_list ; do
249 /etc/rc.d/init.d/${daemon} stop >/dev/null 2>&1
250 /sbin/chkconfig --del ${daemon}
251 done
252 /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
paul788cdc62003-01-18 00:22:08 +0000253fi
254
255%clean
paulb5f310c2004-09-13 13:15:25 +0000256%if !%{keep_build}
257rm -rf $RPM_BUILD_ROOT
258%endif
paul788cdc62003-01-18 00:22:08 +0000259
260%files
261%defattr(-,root,root)
paul448ed4a2003-03-01 15:43:28 +0000262%doc */*.sample* AUTHORS COPYING
paul6bd8fd32003-08-12 12:54:13 +0000263%doc doc/quagga.html
paul30b9d892003-01-18 22:57:15 +0000264%doc doc/mpls
paul8f754982003-01-20 04:55:51 +0000265%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
paul6bd8fd32003-08-12 12:54:13 +0000266%if %quagga_user
267%dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
268%dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga
269%dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000270%else
paul788cdc62003-01-18 00:22:08 +0000271%dir %attr(750,root,root) %{_sysconfdir}
paul6bd8fd32003-08-12 12:54:13 +0000272%dir %attr(750,root,root) /var/log/quagga
paul788cdc62003-01-18 00:22:08 +0000273%dir %attr(755,root,root) /usr/share/info
paul6bd8fd32003-08-12 12:54:13 +0000274%dir %attr(750,root,root) /var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000275%endif
276%if %vty_group
paul6bd8fd32003-08-12 12:54:13 +0000277%attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
pauledd7c242003-06-04 13:59:38 +0000278%endif
paul788cdc62003-01-18 00:22:08 +0000279%{_infodir}/*info*
280%{_mandir}/man*/*
281%{_sbindir}/*
paul2ff9e822004-07-20 11:19:47 +0000282%{_libdir}/lib*.so
283%{_libdir}/lib*.so.*
pauld7ccae22003-01-18 00:24:00 +0000284%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000285%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000286%endif
paul6bd8fd32003-08-12 12:54:13 +0000287%config /etc/quagga/[!v]*
paul788cdc62003-01-18 00:22:08 +0000288%config /etc/rc.d/init.d/*
paul15d74e92003-12-30 11:16:21 +0000289%config(noreplace) /etc/sysconfig/quagga
paul6bd8fd32003-08-12 12:54:13 +0000290%config(noreplace) /etc/pam.d/quagga
paul788cdc62003-01-18 00:22:08 +0000291%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
292
paul448ed4a2003-03-01 15:43:28 +0000293%files contrib
294%defattr(-,root,root)
295%doc tools
296
paule0626852003-03-18 14:11:36 +0000297%files devel
298%defattr(-,root,root)
paul2ff9e822004-07-20 11:19:47 +0000299%dir %{_libdir}/*.a
300%dir %{_libdir}/*.la
paul15d74e92003-12-30 11:16:21 +0000301%dir %{_includedir}/%name/*.h
302%dir %{_includedir}/%name/ospfd/*.h
paul68980082003-03-25 05:07:42 +0000303%if %with_ospfapi
paul15d74e92003-12-30 11:16:21 +0000304%dir %{_includedir}/%name/ospfapi/*.h
paul68980082003-03-25 05:07:42 +0000305%endif
paule0626852003-03-18 14:11:36 +0000306
paul788cdc62003-01-18 00:22:08 +0000307%changelog
paul15d74e92003-12-30 11:16:21 +0000308%changelog
paul00bc5602004-01-09 16:30:52 +0000309* Thu Jan 08 2004 Paul Jakma <paul@dishone.st>
310- updated sysconfig files to specify local dir
311- added ospf_dump.c crash quick fix patch
312- added ospfd persistent interface configuration patch
313
paul15d74e92003-12-30 11:16:21 +0000314* Tue Dec 30 2003 Paul Jakma <paul@dishone.st>
315- sync to CVS
316- integrate RH sysconfig patch to specify daemon options (RH)
317- default to have vty listen only to 127.1 (RH)
318- add user with fixed UID/GID (RH)
319- create user with shell /sbin/nologin rather than /bin/false (RH)
320- stop daemons on uninstall (RH)
321- delete info file on %preun, not %postun to avoid deletion on upgrade. (RH)
322- isisd added
323- cleanup tasks carried out for every daemon
324
paul406f7002003-11-02 07:30:52 +0000325* Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
326- Fix -devel package to include all files
327- Sync to 0.96.4
328
paul6bd8fd32003-08-12 12:54:13 +0000329* Tue Aug 12 2003 Paul Jakma <paul@dishone.st>
330- Renamed to Quagga
331- Sync to Quagga release 0.96
332
pauledd7c242003-06-04 13:59:38 +0000333* Tue Mar 20 2003 Paul Jakma <paul@dishone.st>
334- zebra privileges support
335
paule0626852003-03-18 14:11:36 +0000336* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
337- Fix mem leak in 'show thread cpu'
338- Ralph Keller's OSPF-API
339- Amir: Fix configure.ac for net-snmp
340
paul448ed4a2003-03-01 15:43:28 +0000341* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
342- ospfd IOS prefix to interface matching for 'network' statement
343- temporary fix for PtP and IPv6
344- sync to zebra.org CVS
345
paul8f754982003-01-20 04:55:51 +0000346* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
347- update to latest cvs
348- Yon's "show thread cpu" patch - 17217
349- walk up tree - 17218
350- ospfd NSSA fixes - 16681
351- ospfd nsm fixes - 16824
352- ospfd OLSA fixes and new feature - 16823
353- KAME and ifindex fixes - 16525
354- spec file changes to allow redhat files to be in tree
355
pauld7ccae22003-01-18 00:24:00 +0000356* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
357- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
358- Fixed up some build requirements (patch)
359- Added conditional build requirements for vtysh / snmp
360- Added conditional to %files for %_bindir depending on vtysh
361
paul788cdc62003-01-18 00:22:08 +0000362* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
363- update to latest CVS
364- add Greg Troxel's md5 buffer copy/dup fix
365- add RIPv1 fix
366- add Frank's multicast flag fix
367
368* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
369- update to latest CVS
370- timestamped crypt_seqnum patch
371- oi->on_write_q fix
372
373* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
374- update to latest CVS
375- add vtysh 'write-config (integrated|daemon)' patch
376- always 'make rebuild' in vtysh/ to catch new commands
377
378* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
379- update to 0.93b
380
381* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
382- update to latest CVS
383- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
384
385* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
386- update to current CVS
387- add OSPF point to multipoint patch
388- add OSPF bugfixes
389- add BGP hash optimisation patch
390
391* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
392- update to 0.93-pre1 / CVS
393- add link state detection support
394- add generic PtP and RFC3021 support
395- various bug fixes
396
397* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
398- Fix bug #51336
399
400* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
401- Use generic initscript strings instead of initscript specific
402 ( "Starting foo: " -> "Starting $prog:" )
403
404* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
405- Bump the release when rebuilding into the dist.
406
407* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
408- built for Powertools
409
410* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
411- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
412- Update to 0.91a
413- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
414- Should be quite Red Hat'isque now.