blob: 319e507c856d2d77d166f46e7e21e24a5044e1ae [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
25%define _includedir %{_prefix}/include/quagga
26%define _libdir %{_exec_prefix}/%{_lib}/quagga
27%define _localstatedir /var/run/quagga
paule0626852003-03-18 14:11:36 +000028
paul788cdc62003-01-18 00:22:08 +000029Summary: Routing daemon
paul6bd8fd32003-08-12 12:54:13 +000030Name: quagga
paul6382b6f2003-05-20 00:17:45 +000031Version: @VERSION@
pauledd7c242003-06-04 13:59:38 +000032Release: @CONFDATE@01
paul788cdc62003-01-18 00:22:08 +000033License: GPL
34Group: System Environment/Daemons
paul6bd8fd32003-08-12 12:54:13 +000035Source0: http://www.quagga.net/snapshots/cvs/%{name}-%{version}.tar.gz
36URL: http://www.quagga.net
paul788cdc62003-01-18 00:22:08 +000037%if %with_snmp
paule0626852003-03-18 14:11:36 +000038#BuildRequires: ucd-snmp-devel
paul788cdc62003-01-18 00:22:08 +000039Prereq: ucd-snmp
40%endif
pauld7ccae22003-01-18 00:24:00 +000041%if %with_vtysh
paul30b9d892003-01-18 22:57:15 +000042BuildRequires: readline readline-devel ncurses ncurses-devel
pauld7ccae22003-01-18 00:24:00 +000043Prereq: readline ncurses
44%endif
paul6bd8fd32003-08-12 12:54:13 +000045BuildRequires: texinfo tetex autoconf pam-devel patch
paul788cdc62003-01-18 00:22:08 +000046# Initscripts > 5.60 is required for IPv6 support
paul30b9d892003-01-18 22:57:15 +000047Prereq: initscripts >= 5.60
paul45315b52003-08-14 05:23:50 +000048Prereq: ncurses readline pam
paul788cdc62003-01-18 00:22:08 +000049Prereq: /sbin/install-info
50Provides: routingdaemon
51BuildRoot: %{_tmppath}/%{name}-%{version}-root
paul6bd8fd32003-08-12 12:54:13 +000052Obsoletes: bird gated mrt zebra
paul788cdc62003-01-18 00:22:08 +000053
54%description
paul6bd8fd32003-08-12 12:54:13 +000055Quagga is a free software that manages TCP/IP based routing
paul788cdc62003-01-18 00:22:08 +000056protocol. It takes multi-server and multi-thread approach to resolve
57the current complexity of the Internet.
58
paul6bd8fd32003-08-12 12:54:13 +000059Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
paul788cdc62003-01-18 00:22:08 +000060
paul6bd8fd32003-08-12 12:54:13 +000061Quagga is intended to be used as a Route Server and a Route Reflector. It is
62not a toolkit, it provides full routing power under a new architecture.
63Quagga by design has a process for each protocol.
64
65Quagga is a fork of GNU Zebra.
paul788cdc62003-01-18 00:22:08 +000066
paul448ed4a2003-03-01 15:43:28 +000067%package contrib
paul6bd8fd32003-08-12 12:54:13 +000068Summary: contrib tools for quagga
paul448ed4a2003-03-01 15:43:28 +000069Group: System Environment/Daemons
70
71%description contrib
paul6bd8fd32003-08-12 12:54:13 +000072Contributed/3rd party tools which may be of use with quagga.
paul448ed4a2003-03-01 15:43:28 +000073
paule0626852003-03-18 14:11:36 +000074%package devel
paul6bd8fd32003-08-12 12:54:13 +000075Summary: Header and object files for quagga development
paule0626852003-03-18 14:11:36 +000076Group: System Environment/Daemons
77
78%description devel
paul6bd8fd32003-08-12 12:54:13 +000079The quagga-devel package contains the header and object files neccessary for
80developing OSPF-API and quagga applications.
paule0626852003-03-18 14:11:36 +000081
paul788cdc62003-01-18 00:22:08 +000082%prep
83%setup -q
paul788cdc62003-01-18 00:22:08 +000084
85%build
86%configure \
paul788cdc62003-01-18 00:22:08 +000087%if %with_ipv6
88 --enable-ipv6 \
89%endif
90%if %with_snmp
91 --enable-snmp \
92%endif
93%if %with_multipath
94 --enable-multipath=%with_multipath \
95%endif
96%if %with_tcp_zebra
97 --enable-tcp-zebra \
98%endif
99%if %with_nssa
100 --enable-nssa \
101%endif
102%if %with_opaque_lsa
103 --enable-opaque-lsa \
104%endif
105%if %with_ospf_te
106 --enable-ospf-te \
107%endif
108%if %with_vtysh
109 --enable-vtysh \
110%endif
paul68980082003-03-25 05:07:42 +0000111%if %with_ospfclient
112 --enable-ospfclient=yes \
113%else
114 --enable-ospfclient=no\
115%endif
116%if %with_ospfapi
117 --enable-ospfapi=yes \
118%else
119 --enable-ospfapi=no \
120%endif
paul788cdc62003-01-18 00:22:08 +0000121%if %with_pam
pauledd7c242003-06-04 13:59:38 +0000122 --with-libpam \
paul788cdc62003-01-18 00:22:08 +0000123%endif
paul6bd8fd32003-08-12 12:54:13 +0000124%if %quagga_user
125 --enable-user=%quagga_user \
126 --enable-group=%quagga_user \
pauledd7c242003-06-04 13:59:38 +0000127%endif
128%if %vty_group
129 --enable-vty-group=%vty_group \
130%endif
pauledd7c242003-06-04 13:59:38 +0000131--enable-netlink
paul788cdc62003-01-18 00:22:08 +0000132
133make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
134
135pushd doc
paul6bd8fd32003-08-12 12:54:13 +0000136texi2html quagga.texi
paul788cdc62003-01-18 00:22:08 +0000137popd
138
139%install
140rm -rf $RPM_BUILD_ROOT
141
142install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
paul6bd8fd32003-08-12 12:54:13 +0000143 $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
paul788cdc62003-01-18 00:22:08 +0000144
145make install \
146 DESTDIR=$RPM_BUILD_ROOT
147
paul9a344b72003-08-05 23:24:58 +0000148# Remove this file, as it is uninstalled and causes errors when building on RH9
149rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
150
paul8f754982003-01-20 04:55:51 +0000151install %{zeb_rh_src}/zebra.init $RPM_BUILD_ROOT/etc/rc.d/init.d/zebra
152install %{zeb_rh_src}/bgpd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/bgpd
pauld7ccae22003-01-18 00:24:00 +0000153%if %with_ipv6
paul8f754982003-01-20 04:55:51 +0000154install %{zeb_rh_src}/ospf6d.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospf6d
155install %{zeb_rh_src}/ripngd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripngd
pauld7ccae22003-01-18 00:24:00 +0000156%endif
paul8f754982003-01-20 04:55:51 +0000157install %{zeb_rh_src}/ospfd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ospfd
158install %{zeb_rh_src}/ripd.init $RPM_BUILD_ROOT/etc/rc.d/init.d/ripd
paul6bd8fd32003-08-12 12:54:13 +0000159install -m644 %{zeb_rh_src}/quagga.pam $RPM_BUILD_ROOT/etc/pam.d/quagga
160install -m644 %{zeb_rh_src}/quagga.logrotate $RPM_BUILD_ROOT/etc/logrotate.d/quagga
161install -d -m750 $RPM_BUILD_ROOT/var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000162
163%pre
164# add vty_group
165%if %vty_group
166groupadd -r %vty_group 2> /dev/null || :
167%endif
paul6bd8fd32003-08-12 12:54:13 +0000168# add quagga user and group
169%if %quagga_user
170/usr/sbin/useradd -M -r -s /bin/false -c "Quagga routing suite" \
171 -d %_localstatedir %quagga_user 2> /dev/null || :
pauledd7c242003-06-04 13:59:38 +0000172%endif
paul788cdc62003-01-18 00:22:08 +0000173
paul788cdc62003-01-18 00:22:08 +0000174%post
paul30b9d892003-01-18 22:57:15 +0000175# zebra_spec_add_service <service name> <port/proto> <comment>
paul788cdc62003-01-18 00:22:08 +0000176# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
177
178zebra_spec_add_service ()
179{
180 # Add port /etc/services entry if it isn't already there
181 if [ -f /etc/services ] && ! grep -q "^$1[^a-zA-Z0-9]" /etc/services ; then
182 echo "$1 $2 # $3" >> /etc/services
183 fi
184}
185
186zebra_spec_add_service zebrasrv 2600/tcp "zebra service"
187zebra_spec_add_service zebra 2601/tcp "zebra vty"
188zebra_spec_add_service ripd 2602/tcp "RIPd vty"
pauld7ccae22003-01-18 00:24:00 +0000189%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000190zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
pauld7ccae22003-01-18 00:24:00 +0000191%endif
paul788cdc62003-01-18 00:22:08 +0000192zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
193zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
pauld7ccae22003-01-18 00:24:00 +0000194%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000195zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
pauld7ccae22003-01-18 00:24:00 +0000196%endif
paul7021c422003-07-15 12:52:22 +0000197%if %with_ospfapi
198zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
199%endif
paul788cdc62003-01-18 00:22:08 +0000200
201/sbin/chkconfig --add zebra
202/sbin/chkconfig --add ripd
pauld7ccae22003-01-18 00:24:00 +0000203%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000204/sbin/chkconfig --add ripngd
paul788cdc62003-01-18 00:22:08 +0000205/sbin/chkconfig --add ospf6d
pauld7ccae22003-01-18 00:24:00 +0000206%endif
paul30b9d892003-01-18 22:57:15 +0000207/sbin/chkconfig --add ospfd
paul788cdc62003-01-18 00:22:08 +0000208/sbin/chkconfig --add bgpd
209
paul6bd8fd32003-08-12 12:54:13 +0000210/sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
paul788cdc62003-01-18 00:22:08 +0000211
212# Create dummy files if they don't exist so basic functions can be used.
213if [ ! -e %{_sysconfdir}/zebra.conf ]; then
214 echo "hostname `hostname`" > %{_sysconfdir}/zebra.conf
215 chmod 640 %{_sysconfdir}/zebra.conf
216fi
217if [ ! -e %{_sysconfdir}/vtysh.conf ]; then
218 touch %{_sysconfdir}/vtysh.conf
219 chmod 640 %{_sysconfdir}/vtysh.conf
220fi
221
222%postun
223if [ "$1" -ge "1" ]; then
224 /etc/rc.d/init.d/zebra condrestart >/dev/null 2>&1
225 /etc/rc.d/init.d/ripd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000226%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000227 /etc/rc.d/init.d/ripngd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000228%endif
paul788cdc62003-01-18 00:22:08 +0000229 /etc/rc.d/init.d/ospfd condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000230%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000231 /etc/rc.d/init.d/ospf6d condrestart >/dev/null 2>&1
pauld7ccae22003-01-18 00:24:00 +0000232%endif
paul788cdc62003-01-18 00:22:08 +0000233 /etc/rc.d/init.d/bgpd condrestart >/dev/null 2>&1
234fi
paul6bd8fd32003-08-12 12:54:13 +0000235/sbin/install-info --delete %{_infodir}/quagga.info.gz %{_infodir}/dir
paul788cdc62003-01-18 00:22:08 +0000236
237%preun
238if [ "$1" = "0" ]; then
239 /sbin/chkconfig --del zebra
240 /sbin/chkconfig --del ripd
pauld7ccae22003-01-18 00:24:00 +0000241%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000242 /sbin/chkconfig --del ripngd
pauld7ccae22003-01-18 00:24:00 +0000243%endif
paul788cdc62003-01-18 00:22:08 +0000244 /sbin/chkconfig --del ospfd
pauld7ccae22003-01-18 00:24:00 +0000245%if %with_ipv6
paul788cdc62003-01-18 00:22:08 +0000246 /sbin/chkconfig --del ospf6d
pauld7ccae22003-01-18 00:24:00 +0000247%endif
paul788cdc62003-01-18 00:22:08 +0000248 /sbin/chkconfig --del bgpd
249fi
250
251%clean
252#rm -rf $RPM_BUILD_ROOT
253
254%files
255%defattr(-,root,root)
paul448ed4a2003-03-01 15:43:28 +0000256%doc */*.sample* AUTHORS COPYING
paul6bd8fd32003-08-12 12:54:13 +0000257%doc doc/quagga.html
paul30b9d892003-01-18 22:57:15 +0000258%doc doc/mpls
paul8f754982003-01-20 04:55:51 +0000259%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
paul6bd8fd32003-08-12 12:54:13 +0000260%if %quagga_user
261%dir %attr(751,%quagga_user,%quagga_user) %{_sysconfdir}
262%dir %attr(750,%quagga_user,%quagga_user) /var/log/quagga
263%dir %attr(751,%quagga_user,%quagga_user) /var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000264%else
paul788cdc62003-01-18 00:22:08 +0000265%dir %attr(750,root,root) %{_sysconfdir}
paul6bd8fd32003-08-12 12:54:13 +0000266%dir %attr(750,root,root) /var/log/quagga
paul788cdc62003-01-18 00:22:08 +0000267%dir %attr(755,root,root) /usr/share/info
paul6bd8fd32003-08-12 12:54:13 +0000268%dir %attr(750,root,root) /var/run/quagga
pauledd7c242003-06-04 13:59:38 +0000269%endif
270%if %vty_group
paul6bd8fd32003-08-12 12:54:13 +0000271%attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
pauledd7c242003-06-04 13:59:38 +0000272%endif
paul788cdc62003-01-18 00:22:08 +0000273%{_infodir}/*info*
274%{_mandir}/man*/*
275%{_sbindir}/*
pauld7ccae22003-01-18 00:24:00 +0000276%if %with_vtysh
paul788cdc62003-01-18 00:22:08 +0000277%{_bindir}/*
pauld7ccae22003-01-18 00:24:00 +0000278%endif
paul6bd8fd32003-08-12 12:54:13 +0000279%config /etc/quagga/[!v]*
paul788cdc62003-01-18 00:22:08 +0000280%config /etc/rc.d/init.d/*
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}/*
paul406f7002003-11-02 07:30:52 +0000291%dir %{_includedir}/*.h
paul68980082003-03-25 05:07:42 +0000292%dir %{_includedir}/ospfd/*
293%if %with_ospfapi
paule0626852003-03-18 14:11:36 +0000294%dir %{_includedir}/ospfapi/*
paul68980082003-03-25 05:07:42 +0000295%endif
paule0626852003-03-18 14:11:36 +0000296
paul788cdc62003-01-18 00:22:08 +0000297%changelog
paul406f7002003-11-02 07:30:52 +0000298* Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
299- Fix -devel package to include all files
300- Sync to 0.96.4
301
paul6bd8fd32003-08-12 12:54:13 +0000302* Tue Aug 12 2003 Paul Jakma <paul@dishone.st>
303- Renamed to Quagga
304- Sync to Quagga release 0.96
305
pauledd7c242003-06-04 13:59:38 +0000306* Tue Mar 20 2003 Paul Jakma <paul@dishone.st>
307- zebra privileges support
308
paule0626852003-03-18 14:11:36 +0000309* Mon Mar 18 2003 Paul Jakma <paul@dishone.st>
310- Fix mem leak in 'show thread cpu'
311- Ralph Keller's OSPF-API
312- Amir: Fix configure.ac for net-snmp
313
paul448ed4a2003-03-01 15:43:28 +0000314* Sat Mar 1 2003 Paul Jakma <paul@dishone.st>
315- ospfd IOS prefix to interface matching for 'network' statement
316- temporary fix for PtP and IPv6
317- sync to zebra.org CVS
318
paul8f754982003-01-20 04:55:51 +0000319* Mon Jan 20 2003 Paul Jakma <paul@dishone.st>
320- update to latest cvs
321- Yon's "show thread cpu" patch - 17217
322- walk up tree - 17218
323- ospfd NSSA fixes - 16681
324- ospfd nsm fixes - 16824
325- ospfd OLSA fixes and new feature - 16823
326- KAME and ifindex fixes - 16525
327- spec file changes to allow redhat files to be in tree
328
pauld7ccae22003-01-18 00:24:00 +0000329* Sat Dec 28 2002 Alexander Hoogerhuis <alexh@ihatent.com>
330- Added conditionals for building with(out) IPv6, vtysh, RIP, BGP
331- Fixed up some build requirements (patch)
332- Added conditional build requirements for vtysh / snmp
333- Added conditional to %files for %_bindir depending on vtysh
334
paul788cdc62003-01-18 00:22:08 +0000335* Mon Nov 11 2002 Paul Jakma <paulj@alphyra.ie>
336- update to latest CVS
337- add Greg Troxel's md5 buffer copy/dup fix
338- add RIPv1 fix
339- add Frank's multicast flag fix
340
341* Wed Oct 09 2002 Paul Jakma <paulj@alphyra.ie>
342- update to latest CVS
343- timestamped crypt_seqnum patch
344- oi->on_write_q fix
345
346* Mon Sep 30 2002 Paul Jakma <paulj@alphyra.ie>
347- update to latest CVS
348- add vtysh 'write-config (integrated|daemon)' patch
349- always 'make rebuild' in vtysh/ to catch new commands
350
351* Fri Sep 13 2002 Paul Jakma <paulj@alphyra.ie>
352- update to 0.93b
353
354* Wed Sep 11 2002 Paul Jakma <paulj@alphyra.ie>
355- update to latest CVS
356- add "/sbin/ip route flush proto zebra" to zebra RH init on startup
357
358* Sat Aug 24 2002 Paul Jakma <paulj@alphyra.ie>
359- update to current CVS
360- add OSPF point to multipoint patch
361- add OSPF bugfixes
362- add BGP hash optimisation patch
363
364* Fri Jun 14 2002 Paul Jakma <paulj@alphyra.ie>
365- update to 0.93-pre1 / CVS
366- add link state detection support
367- add generic PtP and RFC3021 support
368- various bug fixes
369
370* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
371- Fix bug #51336
372
373* Wed Aug 1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
374- Use generic initscript strings instead of initscript specific
375 ( "Starting foo: " -> "Starting $prog:" )
376
377* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
378- Bump the release when rebuilding into the dist.
379
380* Tue Feb 6 2001 Tim Powers <timp@redhat.com>
381- built for Powertools
382
383* Sun Feb 4 2001 Pekka Savola <pekkas@netcore.fi>
384- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
385- Update to 0.91a
386- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
387- Should be quite Red Hat'isque now.