blob: fcfc7589b60d163e55a2ad2492e02d28533fbd57 [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
paul788cdc62003-01-18 00:22:08 +000039Summary: Routing daemon
paul6bd8fd32003-08-12 12:54:13 +000040Name: quagga
paul6382b6f2003-05-20 00:17:45 +000041Version: @VERSION@
pauledd7c242003-06-04 13:59:38 +000042Release: @CONFDATE@01
paul788cdc62003-01-18 00:22:08 +000043License: GPL
44Group: System Environment/Daemons
paul6bd8fd32003-08-12 12:54:13 +000045Source0: http://www.quagga.net/snapshots/cvs/%{name}-%{version}.tar.gz
46URL: http://www.quagga.net
paul788cdc62003-01-18 00:22:08 +000047%if %with_snmp
paulb63cef72004-08-19 03:36:13 +000048BuildRequires: net-snmp-devel
49Prereq: net-snmp
paul788cdc62003-01-18 00:22:08 +000050%endif
pauld7ccae22003-01-18 00:24:00 +000051%if %with_vtysh
paul30b9d892003-01-18 22:57:15 +000052BuildRequires: readline readline-devel ncurses ncurses-devel
pauld7ccae22003-01-18 00:24:00 +000053Prereq: readline ncurses
54%endif
paul15d74e92003-12-30 11:16:21 +000055BuildRequires: texinfo tetex autoconf pam-devel patch libcap-devel
paul788cdc62003-01-18 00:22:08 +000056# Initscripts > 5.60 is required for IPv6 support
paul30b9d892003-01-18 22:57:15 +000057Prereq: initscripts >= 5.60
paul45315b52003-08-14 05:23:50 +000058Prereq: ncurses readline pam
paul788cdc62003-01-18 00:22:08 +000059Prereq: /sbin/install-info
60Provides: routingdaemon
61BuildRoot: %{_tmppath}/%{name}-%{version}-root
paul6bd8fd32003-08-12 12:54:13 +000062Obsoletes: bird gated mrt zebra
paul788cdc62003-01-18 00:22:08 +000063
64%description
paul6bd8fd32003-08-12 12:54:13 +000065Quagga is a free software that manages TCP/IP based routing
paul788cdc62003-01-18 00:22:08 +000066protocol. It takes multi-server and multi-thread approach to resolve
67the current complexity of the Internet.
68
paul6bd8fd32003-08-12 12:54:13 +000069Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
paul788cdc62003-01-18 00:22:08 +000070
paul6bd8fd32003-08-12 12:54:13 +000071Quagga is intended to be used as a Route Server and a Route Reflector. It is
72not a toolkit, it provides full routing power under a new architecture.
73Quagga by design has a process for each protocol.
74
75Quagga is a fork of GNU Zebra.
paul788cdc62003-01-18 00:22:08 +000076
paul448ed4a2003-03-01 15:43:28 +000077%package contrib
paul6bd8fd32003-08-12 12:54:13 +000078Summary: contrib tools for quagga
paul448ed4a2003-03-01 15:43:28 +000079Group: System Environment/Daemons
80
81%description contrib
paul6bd8fd32003-08-12 12:54:13 +000082Contributed/3rd party tools which may be of use with quagga.
paul448ed4a2003-03-01 15:43:28 +000083
paule0626852003-03-18 14:11:36 +000084%package devel
paul6bd8fd32003-08-12 12:54:13 +000085Summary: Header and object files for quagga development
paule0626852003-03-18 14:11:36 +000086Group: System Environment/Daemons
87
88%description devel
paul6bd8fd32003-08-12 12:54:13 +000089The quagga-devel package contains the header and object files neccessary for
90developing OSPF-API and quagga applications.
paule0626852003-03-18 14:11:36 +000091
paul788cdc62003-01-18 00:22:08 +000092%prep
93%setup -q
paul788cdc62003-01-18 00:22:08 +000094
95%build
96%configure \
paul788cdc62003-01-18 00:22:08 +000097%if %with_ipv6
98 --enable-ipv6 \
99%endif
100%if %with_snmp
101 --enable-snmp \
102%endif
103%if %with_multipath
104 --enable-multipath=%with_multipath \
105%endif
106%if %with_tcp_zebra
107 --enable-tcp-zebra \
108%endif
109%if %with_nssa
110 --enable-nssa \
111%endif
112%if %with_opaque_lsa
113 --enable-opaque-lsa \
114%endif
115%if %with_ospf_te
116 --enable-ospf-te \
117%endif
118%if %with_vtysh
119 --enable-vtysh \
120%endif
paul68980082003-03-25 05:07:42 +0000121%if %with_ospfclient
122 --enable-ospfclient=yes \
123%else
124 --enable-ospfclient=no\
125%endif
126%if %with_ospfapi
127 --enable-ospfapi=yes \
128%else
129 --enable-ospfapi=no \
130%endif
paul5b819262004-07-28 14:11:55 +0000131%if %with_irdp
132 --enable-irdp=yes \
133%else
134 --enable-irdp=no \
135%endif
paul788cdc62003-01-18 00:22:08 +0000136%if %with_pam
pauledd7c242003-06-04 13:59:38 +0000137 --with-libpam \
paul788cdc62003-01-18 00:22:08 +0000138%endif
paul6bd8fd32003-08-12 12:54:13 +0000139%if %quagga_user
140 --enable-user=%quagga_user \
141 --enable-group=%quagga_user \
pauledd7c242003-06-04 13:59:38 +0000142%endif
143%if %vty_group
144 --enable-vty-group=%vty_group \
145%endif
pauledd7c242003-06-04 13:59:38 +0000146--enable-netlink
paul788cdc62003-01-18 00:22:08 +0000147
148make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
149
150pushd doc
paul6bd8fd32003-08-12 12:54:13 +0000151texi2html quagga.texi
paul788cdc62003-01-18 00:22:08 +0000152popd
153
154%install
155rm -rf $RPM_BUILD_ROOT
156
157install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
paul6bd8fd32003-08-12 12:54:13 +0000158 $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
paul788cdc62003-01-18 00:22:08 +0000159
160make install \
161 DESTDIR=$RPM_BUILD_ROOT
162
paul9a344b72003-08-05 23:24:58 +0000163# Remove this file, as it is uninstalled and causes errors when building on RH9
164rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
165
paul15d74e92003-12-30 11:16:21 +0000166# install etc sources
167for daemon in %daemon_list ; do
168 install %{zeb_rh_src}/${daemon}.init \
169 $RPM_BUILD_ROOT/etc/rc.d/init.d/${daemon}
170done
171install -m644 %{zeb_rh_src}/quagga.pam \
172 $RPM_BUILD_ROOT/etc/pam.d/quagga
173install -m644 %{zeb_rh_src}/quagga.logrotate \
174 $RPM_BUILD_ROOT/etc/logrotate.d/quagga
175install -m644 %{zeb_rh_src}/quagga.sysconfig \
176 $RPM_BUILD_ROOT/etc/sysconfig/quagga
paul6bd8fd32003-08-12 12:54:13 +0000177install -d -m750 $RPM_BUILD_ROOT/var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000178
179%pre
180# add vty_group
181%if %vty_group
182groupadd -r %vty_group 2> /dev/null || :
183%endif
paul6bd8fd32003-08-12 12:54:13 +0000184# add quagga user and group
185%if %quagga_user
paul15d74e92003-12-30 11:16:21 +0000186/usr/sbin/groupadd -g %quagga_gid quagga 2> /dev/null || :
187/usr/sbin/useradd -u %quagga_uid -g %quagga_gid \
188 -M -r -s /sbin/nologin -c "Quagga routing suite" \
paul6bd8fd32003-08-12 12:54:13 +0000189 -d %_localstatedir %quagga_user 2> /dev/null || :
pauledd7c242003-06-04 13:59:38 +0000190%endif
paul788cdc62003-01-18 00:22:08 +0000191
paul788cdc62003-01-18 00:22:08 +0000192%post
paul30b9d892003-01-18 22:57:15 +0000193# zebra_spec_add_service <service name> <port/proto> <comment>
paul788cdc62003-01-18 00:22:08 +0000194# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
195
196zebra_spec_add_service ()
197{
198 # Add port /etc/services entry if it isn't already there
199 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
200 echo "$1 $2 # $3" >> /etc/services
201 fi
202}
203
204zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
205zebra_spec_add_service zebra 2601/tcp "zebra vty"
206zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000207%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000208zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000209%endif
paul788cdc62003-01-18 00:22:08 +0000210zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
211zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000212%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000213zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000214%endif
paul7021c422003-07-15 12:52:22 +0000215%if %with_ospfapi
216zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
217%endif
jardin5a514b12003-12-23 10:50:21 +0000218zebra_spec_add_service isisd 2608/tcp "ISISd vty"
paul788cdc62003-01-18 00:22:08 +0000219
paul15d74e92003-12-30 11:16:21 +0000220for daemon in %daemon_list ; do
221 /sbin/chkconfig --add ${daemon}
222done
paul788cdc62003-01-18 00:22:08 +0000223
paul6bd8fd32003-08-12 12:54:13 +0000224/sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
paul788cdc62003-01-18 00:22:08 +0000225
226# Create dummy files if they don't exist so basic functions can be used.
227if [ ! -e %{_sysconfdir}/zebra.conf ]; then
228 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
229 chmod 640 %{_sysconfdir}/zebra.conf
230fi
231if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
232 touch %{_sysconfdir}/vtysh.conf
233 chmod 640 %{_sysconfdir}/vtysh.conf
234fi
235
236%postun
237if [ "$1" -ge "1" ]; then
paul15d74e92003-12-30 11:16:21 +0000238 for daemon in %daemon_list ; do
239 /etc/rc.d/init.d/${daemon} condrestart >/dev/null 2>&1
240 done
paul788cdc62003-01-18 00:22:08 +0000241fi
paul788cdc62003-01-18 00:22:08 +0000242
243%preun
244if [ "$1" = "0" ]; then
paul15d74e92003-12-30 11:16:21 +0000245 for daemon in %daemon_list ; do
246 /etc/rc.d/init.d/${daemon} stop >/dev/null 2>&1
247 /sbin/chkconfig --del ${daemon}
248 done
249 /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
paul788cdc62003-01-18 00:22:08 +0000250fi
251
252%clean
253#rm -rf $RPM_BUILD_ROOT
254
255%files
256%defattr(-,root,root)
paul448ed4a2003-03-01 15:43:28 +0000257%doc */*.sample* AUTHORS COPYING
paul6bd8fd32003-08-12 12:54:13 +0000258%doc doc/quagga.html
paul30b9d892003-01-18 22:57:15 +0000259%doc doc/mpls
paul8f754982003-01-20 04:55:51 +0000260%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
paul6bd8fd32003-08-12 12:54:13 +0000261%if %quagga_user
262%dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
263%dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga
264%dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000265%else
paul788cdc62003-01-18 00:22:08 +0000266%dir %attr(750,root,root) %{_sysconfdir}
paul6bd8fd32003-08-12 12:54:13 +0000267%dir %attr(750,root,root) /var/log/quagga
paul788cdc62003-01-18 00:22:08 +0000268%dir %attr(755,root,root) /usr/share/info
paul6bd8fd32003-08-12 12:54:13 +0000269%dir %attr(750,root,root) /var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000270%endif
271%if %vty_group
paul6bd8fd32003-08-12 12:54:13 +0000272%attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
pauledd7c242003-06-04 13:59:38 +0000273%endif
paul788cdc62003-01-18 00:22:08 +0000274%{_infodir}/*info*
275%{_mandir}/man*/*
276%{_sbindir}/*
paul2ff9e822004-07-20 11:19:47 +0000277%{_libdir}/lib*.so
278%{_libdir}/lib*.so.*
pauld7ccae22003-01-18 00:24:00 +0000279%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000280%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000281%endif
paul6bd8fd32003-08-12 12:54:13 +0000282%config /etc/quagga/[!v]*
paul788cdc62003-01-18 00:22:08 +0000283%config /etc/rc.d/init.d/*
paul15d74e92003-12-30 11:16:21 +0000284%config(noreplace) /etc/sysconfig/quagga
paul6bd8fd32003-08-12 12:54:13 +0000285%config(noreplace) /etc/pam.d/quagga
paul788cdc62003-01-18 00:22:08 +0000286%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
287
paul448ed4a2003-03-01 15:43:28 +0000288%files contrib
289%defattr(-,root,root)
290%doc tools
291
paule0626852003-03-18 14:11:36 +0000292%files devel
293%defattr(-,root,root)
paul2ff9e822004-07-20 11:19:47 +0000294%dir %{_libdir}/*.a
295%dir %{_libdir}/*.la
paul15d74e92003-12-30 11:16:21 +0000296%dir %{_includedir}/%name/*.h
297%dir %{_includedir}/%name/ospfd/*.h
paul68980082003-03-25 05:07:42 +0000298%if %with_ospfapi
paul15d74e92003-12-30 11:16:21 +0000299%dir %{_includedir}/%name/ospfapi/*.h
paul68980082003-03-25 05:07:42 +0000300%endif
paule0626852003-03-18 14:11:36 +0000301
paul788cdc62003-01-18 00:22:08 +0000302%changelog
paul15d74e92003-12-30 11:16:21 +0000303%changelog
paul00bc5602004-01-09 16:30:52 +0000304* Thu Jan 08 2004 Paul Jakma <paul@dishone.st>
305- updated sysconfig files to specify local dir
306- added ospf_dump.c crash quick fix patch
307- added ospfd persistent interface configuration patch
308
paul15d74e92003-12-30 11:16:21 +0000309* Tue Dec 30 2003 Paul Jakma <paul@dishone.st>
310- sync to CVS
311- integrate RH sysconfig patch to specify daemon options (RH)
312- default to have vty listen only to 127.1 (RH)
313- add user with fixed UID/GID (RH)
314- create user with shell /sbin/nologin rather than /bin/false (RH)
315- stop daemons on uninstall (RH)
316- delete info file on %preun, not %postun to avoid deletion on upgrade. (RH)
317- isisd added
318- cleanup tasks carried out for every daemon
319
paul406f7002003-11-02 07:30:52 +0000320* Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
321- Fix -devel package to include all files
322- Sync to 0.96.4
323
paul6bd8fd32003-08-12 12:54:13 +0000324* Tue Aug 12 2003 Paul Jakma <paul@dishone.st>
325- Renamed to Quagga
326- Sync to Quagga release 0.96
327
pauledd7c242003-06-04 13:59:38 +0000328* Tue Mar 20 2003 Paul Jakma <paul@dishone.st>
329- zebra privileges support
330
paule0626852003-03-18 14:11:36 +0000331* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
332- Fix mem leak in 'show thread cpu'
333- Ralph Keller's OSPF-API
334- Amir: Fix configure.ac for net-snmp
335
paul448ed4a2003-03-01 15:43:28 +0000336* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
337- ospfd IOS prefix to interface matching for 'network' statement
338- temporary fix for PtP and IPv6
339- sync to zebra.org CVS
340
paul8f754982003-01-20 04:55:51 +0000341* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
342- update to latest cvs
343- Yon's "show thread cpu" patch - 17217
344- walk up tree - 17218
345- ospfd NSSA fixes - 16681
346- ospfd nsm fixes - 16824
347- ospfd OLSA fixes and new feature - 16823
348- KAME and ifindex fixes - 16525
349- spec file changes to allow redhat files to be in tree
350
pauld7ccae22003-01-18 00:24:00 +0000351* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
352- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
353- Fixed up some build requirements (patch)
354- Added conditional build requirements for vtysh / snmp
355- Added conditional to %files for %_bindir depending on vtysh
356
paul788cdc62003-01-18 00:22:08 +0000357* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
358- update to latest CVS
359- add Greg Troxel's md5 buffer copy/dup fix
360- add RIPv1 fix
361- add Frank's multicast flag fix
362
363* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
364- update to latest CVS
365- timestamped crypt_seqnum patch
366- oi->on_write_q fix
367
368* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
369- update to latest CVS
370- add vtysh 'write-config (integrated|daemon)' patch
371- always 'make rebuild' in vtysh/ to catch new commands
372
373* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
374- update to 0.93b
375
376* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
377- update to latest CVS
378- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
379
380* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
381- update to current CVS
382- add OSPF point to multipoint patch
383- add OSPF bugfixes
384- add BGP hash optimisation patch
385
386* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
387- update to 0.93-pre1 / CVS
388- add link state detection support
389- add generic PtP and RFC3021 support
390- various bug fixes
391
392* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
393- Fix bug #51336
394
395* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
396- Use generic initscript strings instead of initscript specific
397 ( "Starting foo: " -> "Starting $prog:" )
398
399* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
400- Bump the release when rebuilding into the dist.
401
402* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
403- built for Powertools
404
405* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
406- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
407- Update to 0.91a
408- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
409- Should be quite Red Hat'isque now.