blob: 241e26c7dd68746d2378ed49606ac134bca38215 [file] [log] [blame]
pauledd7c242003-06-04 13:59:38 +00001# configure options
paul68980082003-03-25 05:07:42 +00002%define with_snmp 0
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
paul8f754982003-01-20 04:55:51 +000013%define with_multipath 64
paul6bd8fd32003-08-12 12:54:13 +000014%define quagga_user quagga
paul45315b52003-08-14 05:23:50 +000015%define vty_group quaggavty
paul30b9d892003-01-18 22:57:15 +000016
17# path defines
paul6bd8fd32003-08-12 12:54:13 +000018%define _sysconfdir /etc/quagga
paul8f754982003-01-20 04:55:51 +000019%define zeb_src %{_builddir}/%{name}-%{version}
20%define zeb_rh_src %{zeb_src}/redhat
21%define zeb_docs %{zeb_src}/doc
paul788cdc62003-01-18 00:22:08 +000022
paule0626852003-03-18 14:11:36 +000023# defines for configure
paul6bd8fd32003-08-12 12:54:13 +000024%define _libexecdir %{_exec_prefix}/libexec/quagga
paul6bd8fd32003-08-12 12:54:13 +000025%define _libdir %{_exec_prefix}/%{_lib}/quagga
paul15d74e92003-12-30 11:16:21 +000026%define _includedir %{_prefix}/include
paul6bd8fd32003-08-12 12:54:13 +000027%define _localstatedir /var/run/quagga
paule0626852003-03-18 14:11:36 +000028
paul15d74e92003-12-30 11:16:21 +000029# misc internal defines
30%define quagga_uid 92
31%define quagga_gid 92
32%if %with_ipv6
33%define daemon_list zebra ripd isisd ospfd ripngd ospf6d bgpd
34%else
35%define daemon_list zebra ripd isisd ospfd bgpd
36%endif
37
paul788cdc62003-01-18 00:22:08 +000038Summary: Routing daemon
paul6bd8fd32003-08-12 12:54:13 +000039Name: quagga
paul6382b6f2003-05-20 00:17:45 +000040Version: @VERSION@
pauledd7c242003-06-04 13:59:38 +000041Release: @CONFDATE@01
paul788cdc62003-01-18 00:22:08 +000042License: GPL
43Group: System Environment/Daemons
paul6bd8fd32003-08-12 12:54:13 +000044Source0: http://www.quagga.net/snapshots/cvs/%{name}-%{version}.tar.gz
paul00bc5602004-01-09 16:30:52 +000045Patch0: quagga-ospfd-dump-nsm-ignore.diff
46Patch1: quagga-ospfd-iface-config-persist.diff
paul6bd8fd32003-08-12 12:54:13 +000047URL: http://www.quagga.net
paul788cdc62003-01-18 00:22:08 +000048%if %with_snmp
paul15d74e92003-12-30 11:16:21 +000049BuildRequires: ucd-snmp-devel
paul788cdc62003-01-18 00:22:08 +000050Prereq: ucd-snmp
51%endif
pauld7ccae22003-01-18 00:24:00 +000052%if %with_vtysh
paul30b9d892003-01-18 22:57:15 +000053BuildRequires: readline readline-devel ncurses ncurses-devel
pauld7ccae22003-01-18 00:24:00 +000054Prereq: readline ncurses
55%endif
paul15d74e92003-12-30 11:16:21 +000056BuildRequires: texinfo tetex autoconf pam-devel patch libcap-devel
paul788cdc62003-01-18 00:22:08 +000057# Initscripts > 5.60 is required for IPv6 support
paul30b9d892003-01-18 22:57:15 +000058Prereq: initscripts >= 5.60
paul45315b52003-08-14 05:23:50 +000059Prereq: ncurses readline pam
paul788cdc62003-01-18 00:22:08 +000060Prereq: /sbin/install-info
61Provides: routingdaemon
62BuildRoot: %{_tmppath}/%{name}-%{version}-root
paul6bd8fd32003-08-12 12:54:13 +000063Obsoletes: bird gated mrt zebra
paul788cdc62003-01-18 00:22:08 +000064
65%description
paul6bd8fd32003-08-12 12:54:13 +000066Quagga is a free software that manages TCP/IP based routing
paul788cdc62003-01-18 00:22:08 +000067protocol. It takes multi-server and multi-thread approach to resolve
68the current complexity of the Internet.
69
paul6bd8fd32003-08-12 12:54:13 +000070Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
paul788cdc62003-01-18 00:22:08 +000071
paul6bd8fd32003-08-12 12:54:13 +000072Quagga is intended to be used as a Route Server and a Route Reflector. It is
73not a toolkit, it provides full routing power under a new architecture.
74Quagga by design has a process for each protocol.
75
76Quagga is a fork of GNU Zebra.
paul788cdc62003-01-18 00:22:08 +000077
paul448ed4a2003-03-01 15:43:28 +000078%package contrib
paul6bd8fd32003-08-12 12:54:13 +000079Summary: contrib tools for quagga
paul448ed4a2003-03-01 15:43:28 +000080Group: System Environment/Daemons
81
82%description contrib
paul6bd8fd32003-08-12 12:54:13 +000083Contributed/3rd party tools which may be of use with quagga.
paul448ed4a2003-03-01 15:43:28 +000084
paule0626852003-03-18 14:11:36 +000085%package devel
paul6bd8fd32003-08-12 12:54:13 +000086Summary: Header and object files for quagga development
paule0626852003-03-18 14:11:36 +000087Group: System Environment/Daemons
88
89%description devel
paul6bd8fd32003-08-12 12:54:13 +000090The quagga-devel package contains the header and object files neccessary for
91developing OSPF-API and quagga applications.
paule0626852003-03-18 14:11:36 +000092
paul788cdc62003-01-18 00:22:08 +000093%prep
94%setup -q
paul00bc5602004-01-09 16:30:52 +000095%patch0 -p0 -b .dump_nsm
96%patch0 -p1 -b .iface_persist
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
paul788cdc62003-01-18 00:22:08 +0000134%if %with_pam
pauledd7c242003-06-04 13:59:38 +0000135 --with-libpam \
paul788cdc62003-01-18 00:22:08 +0000136%endif
paul6bd8fd32003-08-12 12:54:13 +0000137%if %quagga_user
138 --enable-user=%quagga_user \
139 --enable-group=%quagga_user \
pauledd7c242003-06-04 13:59:38 +0000140%endif
141%if %vty_group
142 --enable-vty-group=%vty_group \
143%endif
pauledd7c242003-06-04 13:59:38 +0000144--enable-netlink
paul788cdc62003-01-18 00:22:08 +0000145
146make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
147
148pushd doc
paul6bd8fd32003-08-12 12:54:13 +0000149texi2html quagga.texi
paul788cdc62003-01-18 00:22:08 +0000150popd
151
152%install
153rm -rf $RPM_BUILD_ROOT
154
155install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
paul6bd8fd32003-08-12 12:54:13 +0000156 $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
paul788cdc62003-01-18 00:22:08 +0000157
158make install \
159 DESTDIR=$RPM_BUILD_ROOT
160
paul9a344b72003-08-05 23:24:58 +0000161# Remove this file, as it is uninstalled and causes errors when building on RH9
162rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
163
paul15d74e92003-12-30 11:16:21 +0000164# install etc sources
165for daemon in %daemon_list ; do
166 install %{zeb_rh_src}/${daemon}.init \
167 $RPM_BUILD_ROOT/etc/rc.d/init.d/${daemon}
168done
169install -m644 %{zeb_rh_src}/quagga.pam \
170 $RPM_BUILD_ROOT/etc/pam.d/quagga
171install -m644 %{zeb_rh_src}/quagga.logrotate \
172 $RPM_BUILD_ROOT/etc/logrotate.d/quagga
173install -m644 %{zeb_rh_src}/quagga.sysconfig \
174 $RPM_BUILD_ROOT/etc/sysconfig/quagga
paul6bd8fd32003-08-12 12:54:13 +0000175install -d -m750 $RPM_BUILD_ROOT/var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000176
177%pre
178# add vty_group
179%if %vty_group
180groupadd -r %vty_group 2> /dev/null || :
181%endif
paul6bd8fd32003-08-12 12:54:13 +0000182# add quagga user and group
183%if %quagga_user
paul15d74e92003-12-30 11:16:21 +0000184/usr/sbin/groupadd -g %quagga_gid quagga 2> /dev/null || :
185/usr/sbin/useradd -u %quagga_uid -g %quagga_gid \
186 -M -r -s /sbin/nologin -c "Quagga routing suite" \
paul6bd8fd32003-08-12 12:54:13 +0000187 -d %_localstatedir %quagga_user 2> /dev/null || :
pauledd7c242003-06-04 13:59:38 +0000188%endif
paul788cdc62003-01-18 00:22:08 +0000189
paul788cdc62003-01-18 00:22:08 +0000190%post
paul30b9d892003-01-18 22:57:15 +0000191# zebra_spec_add_service <service name> <port/proto> <comment>
paul788cdc62003-01-18 00:22:08 +0000192# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
193
194zebra_spec_add_service ()
195{
196 # Add port /etc/services entry if it isn't already there
197 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
198 echo "$1 $2 # $3" >> /etc/services
199 fi
200}
201
202zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
203zebra_spec_add_service zebra 2601/tcp "zebra vty"
204zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000205%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000206zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000207%endif
paul788cdc62003-01-18 00:22:08 +0000208zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
209zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000210%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000211zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000212%endif
paul7021c422003-07-15 12:52:22 +0000213%if %with_ospfapi
214zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
215%endif
jardin5a514b12003-12-23 10:50:21 +0000216zebra_spec_add_service isisd 2608/tcp "ISISd vty"
paul788cdc62003-01-18 00:22:08 +0000217
paul15d74e92003-12-30 11:16:21 +0000218for daemon in %daemon_list ; do
219 /sbin/chkconfig --add ${daemon}
220done
paul788cdc62003-01-18 00:22:08 +0000221
paul6bd8fd32003-08-12 12:54:13 +0000222/sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
paul788cdc62003-01-18 00:22:08 +0000223
224# Create dummy files if they don't exist so basic functions can be used.
225if [ ! -e %{_sysconfdir}/zebra.conf ]; then
226 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
227 chmod 640 %{_sysconfdir}/zebra.conf
228fi
229if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
230 touch %{_sysconfdir}/vtysh.conf
231 chmod 640 %{_sysconfdir}/vtysh.conf
232fi
233
234%postun
235if [ "$1" -ge "1" ]; then
paul15d74e92003-12-30 11:16:21 +0000236 for daemon in %daemon_list ; do
237 /etc/rc.d/init.d/${daemon} condrestart >/dev/null 2>&1
238 done
paul788cdc62003-01-18 00:22:08 +0000239fi
paul788cdc62003-01-18 00:22:08 +0000240
241%preun
242if [ "$1" = "0" ]; then
paul15d74e92003-12-30 11:16:21 +0000243 for daemon in %daemon_list ; do
244 /etc/rc.d/init.d/${daemon} stop >/dev/null 2>&1
245 /sbin/chkconfig --del ${daemon}
246 done
247 /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
paul788cdc62003-01-18 00:22:08 +0000248fi
249
250%clean
251#rm -rf $RPM_BUILD_ROOT
252
253%files
254%defattr(-,root,root)
paul448ed4a2003-03-01 15:43:28 +0000255%doc */*.sample* AUTHORS COPYING
paul6bd8fd32003-08-12 12:54:13 +0000256%doc doc/quagga.html
paul30b9d892003-01-18 22:57:15 +0000257%doc doc/mpls
paul8f754982003-01-20 04:55:51 +0000258%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
paul6bd8fd32003-08-12 12:54:13 +0000259%if %quagga_user
260%dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
261%dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga
262%dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000263%else
paul788cdc62003-01-18 00:22:08 +0000264%dir %attr(750,root,root) %{_sysconfdir}
paul6bd8fd32003-08-12 12:54:13 +0000265%dir %attr(750,root,root) /var/log/quagga
paul788cdc62003-01-18 00:22:08 +0000266%dir %attr(755,root,root) /usr/share/info
paul6bd8fd32003-08-12 12:54:13 +0000267%dir %attr(750,root,root) /var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000268%endif
269%if %vty_group
paul6bd8fd32003-08-12 12:54:13 +0000270%attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
pauledd7c242003-06-04 13:59:38 +0000271%endif
paul788cdc62003-01-18 00:22:08 +0000272%{_infodir}/*info*
273%{_mandir}/man*/*
274%{_sbindir}/*
pauld7ccae22003-01-18 00:24:00 +0000275%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000276%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000277%endif
paul6bd8fd32003-08-12 12:54:13 +0000278%config /etc/quagga/[!v]*
paul788cdc62003-01-18 00:22:08 +0000279%config /etc/rc.d/init.d/*
paul15d74e92003-12-30 11:16:21 +0000280%config(noreplace) /etc/sysconfig/quagga
paul6bd8fd32003-08-12 12:54:13 +0000281%config(noreplace) /etc/pam.d/quagga
paul788cdc62003-01-18 00:22:08 +0000282%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
283
paul448ed4a2003-03-01 15:43:28 +0000284%files contrib
285%defattr(-,root,root)
286%doc tools
287
paule0626852003-03-18 14:11:36 +0000288%files devel
289%defattr(-,root,root)
290%dir %{_libdir}/*
paul15d74e92003-12-30 11:16:21 +0000291%dir %{_includedir}/%name/*.h
292%dir %{_includedir}/%name/ospfd/*.h
paul68980082003-03-25 05:07:42 +0000293%if %with_ospfapi
paul15d74e92003-12-30 11:16:21 +0000294%dir %{_includedir}/%name/ospfapi/*.h
paul68980082003-03-25 05:07:42 +0000295%endif
paule0626852003-03-18 14:11:36 +0000296
paul788cdc62003-01-18 00:22:08 +0000297%changelog
paul15d74e92003-12-30 11:16:21 +0000298%changelog
paul00bc5602004-01-09 16:30:52 +0000299* Thu Jan 08 2004 Paul Jakma <paul@dishone.st>
300- updated sysconfig files to specify local dir
301- added ospf_dump.c crash quick fix patch
302- added ospfd persistent interface configuration patch
303
paul15d74e92003-12-30 11:16:21 +0000304* Tue Dec 30 2003 Paul Jakma <paul@dishone.st>
305- sync to CVS
306- integrate RH sysconfig patch to specify daemon options (RH)
307- default to have vty listen only to 127.1 (RH)
308- add user with fixed UID/GID (RH)
309- create user with shell /sbin/nologin rather than /bin/false (RH)
310- stop daemons on uninstall (RH)
311- delete info file on %preun, not %postun to avoid deletion on upgrade. (RH)
312- isisd added
313- cleanup tasks carried out for every daemon
314
paul406f7002003-11-02 07:30:52 +0000315* Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
316- Fix -devel package to include all files
317- Sync to 0.96.4
318
paul6bd8fd32003-08-12 12:54:13 +0000319* Tue Aug 12 2003 Paul Jakma <paul@dishone.st>
320- Renamed to Quagga
321- Sync to Quagga release 0.96
322
pauledd7c242003-06-04 13:59:38 +0000323* Tue Mar 20 2003 Paul Jakma <paul@dishone.st>
324- zebra privileges support
325
paule0626852003-03-18 14:11:36 +0000326* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
327- Fix mem leak in 'show thread cpu'
328- Ralph Keller's OSPF-API
329- Amir: Fix configure.ac for net-snmp
330
paul448ed4a2003-03-01 15:43:28 +0000331* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
332- ospfd IOS prefix to interface matching for 'network' statement
333- temporary fix for PtP and IPv6
334- sync to zebra.org CVS
335
paul8f754982003-01-20 04:55:51 +0000336* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
337- update to latest cvs
338- Yon's "show thread cpu" patch - 17217
339- walk up tree - 17218
340- ospfd NSSA fixes - 16681
341- ospfd nsm fixes - 16824
342- ospfd OLSA fixes and new feature - 16823
343- KAME and ifindex fixes - 16525
344- spec file changes to allow redhat files to be in tree
345
pauld7ccae22003-01-18 00:24:00 +0000346* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
347- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
348- Fixed up some build requirements (patch)
349- Added conditional build requirements for vtysh / snmp
350- Added conditional to %files for %_bindir depending on vtysh
351
paul788cdc62003-01-18 00:22:08 +0000352* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
353- update to latest CVS
354- add Greg Troxel's md5 buffer copy/dup fix
355- add RIPv1 fix
356- add Frank's multicast flag fix
357
358* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
359- update to latest CVS
360- timestamped crypt_seqnum patch
361- oi->on_write_q fix
362
363* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
364- update to latest CVS
365- add vtysh 'write-config (integrated|daemon)' patch
366- always 'make rebuild' in vtysh/ to catch new commands
367
368* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
369- update to 0.93b
370
371* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
372- update to latest CVS
373- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
374
375* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
376- update to current CVS
377- add OSPF point to multipoint patch
378- add OSPF bugfixes
379- add BGP hash optimisation patch
380
381* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
382- update to 0.93-pre1 / CVS
383- add link state detection support
384- add generic PtP and RFC3021 support
385- various bug fixes
386
387* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
388- Fix bug #51336
389
390* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
391- Use generic initscript strings instead of initscript specific
392 ( "Starting foo: " -> "Starting $prog:" )
393
394* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
395- Bump the release when rebuilding into the dist.
396
397* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
398- built for Powertools
399
400* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
401- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
402- Update to 0.91a
403- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
404- Should be quite Red Hat'isque now.