blob: fd45cdfe6ee51f4991bcb40600981acdf6a24784 [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
45URL: http://www.quagga.net
paul788cdc62003-01-18 00:22:08 +000046%if %with_snmp
paul15d74e92003-12-30 11:16:21 +000047BuildRequires: ucd-snmp-devel
paul788cdc62003-01-18 00:22:08 +000048Prereq: ucd-snmp
49%endif
pauld7ccae22003-01-18 00:24:00 +000050%if %with_vtysh
paul30b9d892003-01-18 22:57:15 +000051BuildRequires: readline readline-devel ncurses ncurses-devel
pauld7ccae22003-01-18 00:24:00 +000052Prereq: readline ncurses
53%endif
paul15d74e92003-12-30 11:16:21 +000054BuildRequires: texinfo tetex autoconf pam-devel patch libcap-devel
paul788cdc62003-01-18 00:22:08 +000055# Initscripts > 5.60 is required for IPv6 support
paul30b9d892003-01-18 22:57:15 +000056Prereq: initscripts >= 5.60
paul45315b52003-08-14 05:23:50 +000057Prereq: ncurses readline pam
paul788cdc62003-01-18 00:22:08 +000058Prereq: /sbin/install-info
59Provides: routingdaemon
60BuildRoot: %{_tmppath}/%{name}-%{version}-root
paul6bd8fd32003-08-12 12:54:13 +000061Obsoletes: bird gated mrt zebra
paul788cdc62003-01-18 00:22:08 +000062
63%description
paul6bd8fd32003-08-12 12:54:13 +000064Quagga is a free software that manages TCP/IP based routing
paul788cdc62003-01-18 00:22:08 +000065protocol. It takes multi-server and multi-thread approach to resolve
66the current complexity of the Internet.
67
paul6bd8fd32003-08-12 12:54:13 +000068Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
paul788cdc62003-01-18 00:22:08 +000069
paul6bd8fd32003-08-12 12:54:13 +000070Quagga is intended to be used as a Route Server and a Route Reflector. It is
71not a toolkit, it provides full routing power under a new architecture.
72Quagga by design has a process for each protocol.
73
74Quagga is a fork of GNU Zebra.
paul788cdc62003-01-18 00:22:08 +000075
paul448ed4a2003-03-01 15:43:28 +000076%package contrib
paul6bd8fd32003-08-12 12:54:13 +000077Summary: contrib tools for quagga
paul448ed4a2003-03-01 15:43:28 +000078Group: System Environment/Daemons
79
80%description contrib
paul6bd8fd32003-08-12 12:54:13 +000081Contributed/3rd party tools which may be of use with quagga.
paul448ed4a2003-03-01 15:43:28 +000082
paule0626852003-03-18 14:11:36 +000083%package devel
paul6bd8fd32003-08-12 12:54:13 +000084Summary: Header and object files for quagga development
paule0626852003-03-18 14:11:36 +000085Group: System Environment/Daemons
86
87%description devel
paul6bd8fd32003-08-12 12:54:13 +000088The quagga-devel package contains the header and object files neccessary for
89developing OSPF-API and quagga applications.
paule0626852003-03-18 14:11:36 +000090
paul788cdc62003-01-18 00:22:08 +000091%prep
92%setup -q
paul788cdc62003-01-18 00:22:08 +000093
94%build
95%configure \
paul788cdc62003-01-18 00:22:08 +000096%if %with_ipv6
97 --enable-ipv6 \
98%endif
99%if %with_snmp
100 --enable-snmp \
101%endif
102%if %with_multipath
103 --enable-multipath=%with_multipath \
104%endif
105%if %with_tcp_zebra
106 --enable-tcp-zebra \
107%endif
108%if %with_nssa
109 --enable-nssa \
110%endif
111%if %with_opaque_lsa
112 --enable-opaque-lsa \
113%endif
114%if %with_ospf_te
115 --enable-ospf-te \
116%endif
117%if %with_vtysh
118 --enable-vtysh \
119%endif
paul68980082003-03-25 05:07:42 +0000120%if %with_ospfclient
121 --enable-ospfclient=yes \
122%else
123 --enable-ospfclient=no\
124%endif
125%if %with_ospfapi
126 --enable-ospfapi=yes \
127%else
128 --enable-ospfapi=no \
129%endif
paul788cdc62003-01-18 00:22:08 +0000130%if %with_pam
pauledd7c242003-06-04 13:59:38 +0000131 --with-libpam \
paul788cdc62003-01-18 00:22:08 +0000132%endif
paul6bd8fd32003-08-12 12:54:13 +0000133%if %quagga_user
134 --enable-user=%quagga_user \
135 --enable-group=%quagga_user \
pauledd7c242003-06-04 13:59:38 +0000136%endif
137%if %vty_group
138 --enable-vty-group=%vty_group \
139%endif
pauledd7c242003-06-04 13:59:38 +0000140--enable-netlink
paul788cdc62003-01-18 00:22:08 +0000141
142make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
143
144pushd doc
paul6bd8fd32003-08-12 12:54:13 +0000145texi2html quagga.texi
paul788cdc62003-01-18 00:22:08 +0000146popd
147
148%install
149rm -rf $RPM_BUILD_ROOT
150
151install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
paul6bd8fd32003-08-12 12:54:13 +0000152 $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
paul788cdc62003-01-18 00:22:08 +0000153
154make install \
155 DESTDIR=$RPM_BUILD_ROOT
156
paul9a344b72003-08-05 23:24:58 +0000157# Remove this file, as it is uninstalled and causes errors when building on RH9
158rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
159
paul15d74e92003-12-30 11:16:21 +0000160# install etc sources
161for daemon in %daemon_list ; do
162 install %{zeb_rh_src}/${daemon}.init \
163 $RPM_BUILD_ROOT/etc/rc.d/init.d/${daemon}
164done
165install -m644 %{zeb_rh_src}/quagga.pam \
166 $RPM_BUILD_ROOT/etc/pam.d/quagga
167install -m644 %{zeb_rh_src}/quagga.logrotate \
168 $RPM_BUILD_ROOT/etc/logrotate.d/quagga
169install -m644 %{zeb_rh_src}/quagga.sysconfig \
170 $RPM_BUILD_ROOT/etc/sysconfig/quagga
paul6bd8fd32003-08-12 12:54:13 +0000171install -d -m750 $RPM_BUILD_ROOT/var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000172
173%pre
174# add vty_group
175%if %vty_group
176groupadd -r %vty_group 2> /dev/null || :
177%endif
paul6bd8fd32003-08-12 12:54:13 +0000178# add quagga user and group
179%if %quagga_user
paul15d74e92003-12-30 11:16:21 +0000180/usr/sbin/groupadd -g %quagga_gid quagga 2> /dev/null || :
181/usr/sbin/useradd -u %quagga_uid -g %quagga_gid \
182 -M -r -s /sbin/nologin -c "Quagga routing suite" \
paul6bd8fd32003-08-12 12:54:13 +0000183 -d %_localstatedir %quagga_user 2> /dev/null || :
pauledd7c242003-06-04 13:59:38 +0000184%endif
paul788cdc62003-01-18 00:22:08 +0000185
paul788cdc62003-01-18 00:22:08 +0000186%post
paul30b9d892003-01-18 22:57:15 +0000187# zebra_spec_add_service <service name> <port/proto> <comment>
paul788cdc62003-01-18 00:22:08 +0000188# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
189
190zebra_spec_add_service ()
191{
192 # Add port /etc/services entry if it isn't already there
193 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
194 echo "$1 $2 # $3" >> /etc/services
195 fi
196}
197
198zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
199zebra_spec_add_service zebra 2601/tcp "zebra vty"
200zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000201%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000202zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000203%endif
paul788cdc62003-01-18 00:22:08 +0000204zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
205zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000206%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000207zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000208%endif
paul7021c422003-07-15 12:52:22 +0000209%if %with_ospfapi
210zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
211%endif
jardin5a514b12003-12-23 10:50:21 +0000212zebra_spec_add_service isisd 2608/tcp "ISISd vty"
paul788cdc62003-01-18 00:22:08 +0000213
paul15d74e92003-12-30 11:16:21 +0000214for daemon in %daemon_list ; do
215 /sbin/chkconfig --add ${daemon}
216done
paul788cdc62003-01-18 00:22:08 +0000217
paul6bd8fd32003-08-12 12:54:13 +0000218/sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
paul788cdc62003-01-18 00:22:08 +0000219
220# Create dummy files if they don't exist so basic functions can be used.
221if [ ! -e %{_sysconfdir}/zebra.conf ]; then
222 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
223 chmod 640 %{_sysconfdir}/zebra.conf
224fi
225if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
226 touch %{_sysconfdir}/vtysh.conf
227 chmod 640 %{_sysconfdir}/vtysh.conf
228fi
229
230%postun
231if [ "$1" -ge "1" ]; then
paul15d74e92003-12-30 11:16:21 +0000232 for daemon in %daemon_list ; do
233 /etc/rc.d/init.d/${daemon} condrestart >/dev/null 2>&1
234 done
paul788cdc62003-01-18 00:22:08 +0000235fi
paul788cdc62003-01-18 00:22:08 +0000236
237%preun
238if [ "$1" = "0" ]; then
paul15d74e92003-12-30 11:16:21 +0000239 for daemon in %daemon_list ; do
240 /etc/rc.d/init.d/${daemon} stop >/dev/null 2>&1
241 /sbin/chkconfig --del ${daemon}
242 done
243 /sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
paul788cdc62003-01-18 00:22:08 +0000244fi
245
246%clean
247#rm -rf $RPM_BUILD_ROOT
248
249%files
250%defattr(-,root,root)
paul448ed4a2003-03-01 15:43:28 +0000251%doc */*.sample* AUTHORS COPYING
paul6bd8fd32003-08-12 12:54:13 +0000252%doc doc/quagga.html
paul30b9d892003-01-18 22:57:15 +0000253%doc doc/mpls
paul8f754982003-01-20 04:55:51 +0000254%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
paul6bd8fd32003-08-12 12:54:13 +0000255%if %quagga_user
256%dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
257%dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga
258%dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000259%else
paul788cdc62003-01-18 00:22:08 +0000260%dir %attr(750,root,root) %{_sysconfdir}
paul6bd8fd32003-08-12 12:54:13 +0000261%dir %attr(750,root,root) /var/log/quagga
paul788cdc62003-01-18 00:22:08 +0000262%dir %attr(755,root,root) /usr/share/info
paul6bd8fd32003-08-12 12:54:13 +0000263%dir %attr(750,root,root) /var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000264%endif
265%if %vty_group
paul6bd8fd32003-08-12 12:54:13 +0000266%attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
pauledd7c242003-06-04 13:59:38 +0000267%endif
paul788cdc62003-01-18 00:22:08 +0000268%{_infodir}/*info*
269%{_mandir}/man*/*
270%{_sbindir}/*
pauld7ccae22003-01-18 00:24:00 +0000271%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000272%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000273%endif
paul6bd8fd32003-08-12 12:54:13 +0000274%config /etc/quagga/[!v]*
paul788cdc62003-01-18 00:22:08 +0000275%config /etc/rc.d/init.d/*
paul15d74e92003-12-30 11:16:21 +0000276%config(noreplace) /etc/sysconfig/quagga
paul6bd8fd32003-08-12 12:54:13 +0000277%config(noreplace) /etc/pam.d/quagga
paul788cdc62003-01-18 00:22:08 +0000278%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
279
paul448ed4a2003-03-01 15:43:28 +0000280%files contrib
281%defattr(-,root,root)
282%doc tools
283
paule0626852003-03-18 14:11:36 +0000284%files devel
285%defattr(-,root,root)
286%dir %{_libdir}/*
paul15d74e92003-12-30 11:16:21 +0000287%dir %{_includedir}/%name/*.h
288%dir %{_includedir}/%name/ospfd/*.h
paul68980082003-03-25 05:07:42 +0000289%if %with_ospfapi
paul15d74e92003-12-30 11:16:21 +0000290%dir %{_includedir}/%name/ospfapi/*.h
paul68980082003-03-25 05:07:42 +0000291%endif
paule0626852003-03-18 14:11:36 +0000292
paul788cdc62003-01-18 00:22:08 +0000293%changelog
paul15d74e92003-12-30 11:16:21 +0000294%changelog
paul00bc5602004-01-09 16:30:52 +0000295* Thu Jan 08 2004 Paul Jakma <paul@dishone.st>
296- updated sysconfig files to specify local dir
297- added ospf_dump.c crash quick fix patch
298- added ospfd persistent interface configuration patch
299
paul15d74e92003-12-30 11:16:21 +0000300* Tue Dec 30 2003 Paul Jakma <paul@dishone.st>
301- sync to CVS
302- integrate RH sysconfig patch to specify daemon options (RH)
303- default to have vty listen only to 127.1 (RH)
304- add user with fixed UID/GID (RH)
305- create user with shell /sbin/nologin rather than /bin/false (RH)
306- stop daemons on uninstall (RH)
307- delete info file on %preun, not %postun to avoid deletion on upgrade. (RH)
308- isisd added
309- cleanup tasks carried out for every daemon
310
paul406f7002003-11-02 07:30:52 +0000311* Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
312- Fix -devel package to include all files
313- Sync to 0.96.4
314
paul6bd8fd32003-08-12 12:54:13 +0000315* Tue Aug 12 2003 Paul Jakma <paul@dishone.st>
316- Renamed to Quagga
317- Sync to Quagga release 0.96
318
pauledd7c242003-06-04 13:59:38 +0000319* Tue Mar 20 2003 Paul Jakma <paul@dishone.st>
320- zebra privileges support
321
paule0626852003-03-18 14:11:36 +0000322* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
323- Fix mem leak in 'show thread cpu'
324- Ralph Keller's OSPF-API
325- Amir: Fix configure.ac for net-snmp
326
paul448ed4a2003-03-01 15:43:28 +0000327* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
328- ospfd IOS prefix to interface matching for 'network' statement
329- temporary fix for PtP and IPv6
330- sync to zebra.org CVS
331
paul8f754982003-01-20 04:55:51 +0000332* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
333- update to latest cvs
334- Yon's "show thread cpu" patch - 17217
335- walk up tree - 17218
336- ospfd NSSA fixes - 16681
337- ospfd nsm fixes - 16824
338- ospfd OLSA fixes and new feature - 16823
339- KAME and ifindex fixes - 16525
340- spec file changes to allow redhat files to be in tree
341
pauld7ccae22003-01-18 00:24:00 +0000342* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
343- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
344- Fixed up some build requirements (patch)
345- Added conditional build requirements for vtysh / snmp
346- Added conditional to %files for %_bindir depending on vtysh
347
paul788cdc62003-01-18 00:22:08 +0000348* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
349- update to latest CVS
350- add Greg Troxel's md5 buffer copy/dup fix
351- add RIPv1 fix
352- add Frank's multicast flag fix
353
354* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
355- update to latest CVS
356- timestamped crypt_seqnum patch
357- oi->on_write_q fix
358
359* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
360- update to latest CVS
361- add vtysh 'write-config (integrated|daemon)' patch
362- always 'make rebuild' in vtysh/ to catch new commands
363
364* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
365- update to 0.93b
366
367* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
368- update to latest CVS
369- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
370
371* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
372- update to current CVS
373- add OSPF point to multipoint patch
374- add OSPF bugfixes
375- add BGP hash optimisation patch
376
377* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
378- update to 0.93-pre1 / CVS
379- add link state detection support
380- add generic PtP and RFC3021 support
381- various bug fixes
382
383* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
384- Fix bug #51336
385
386* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
387- Use generic initscript strings instead of initscript specific
388 ( "Starting foo: " -> "Starting $prog:" )
389
390* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
391- Bump the release when rebuilding into the dist.
392
393* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
394- built for Powertools
395
396* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
397- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
398- Update to 0.91a
399- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
400- Should be quite Red Hat'isque now.