]> git.proxmox.com Git - mirror_frr.git/blame - redhat/quagga.spec.in
Merge svn revision 1048 from Zebra cvs. Also add missing sokopt.h include
[mirror_frr.git] / redhat / quagga.spec.in
CommitLineData
edd7c245 1# configure options
b63cef7c 2%define with_snmp 1
788cdc6d 3%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
55ea381f 11%define with_ospfclient 1
12%define with_ospfapi 1
5b819262 13%define with_irdp 1
8f754983 14%define with_multipath 64
6bd8fd3b 15%define quagga_user quagga
45315b5d 16%define vty_group quaggavty
30b9d89b 17
18# path defines
6bd8fd3b 19%define _sysconfdir /etc/quagga
8f754983 20%define zeb_src %{_builddir}/%{name}-%{version}
21%define zeb_rh_src %{zeb_src}/redhat
22%define zeb_docs %{zeb_src}/doc
788cdc6d 23
e0626854 24# defines for configure
6bd8fd3b 25%define _libexecdir %{_exec_prefix}/libexec/quagga
6bd8fd3b 26%define _libdir %{_exec_prefix}/%{_lib}/quagga
15d74e93 27%define _includedir %{_prefix}/include
6bd8fd3b 28%define _localstatedir /var/run/quagga
e0626854 29
15d74e93 30# 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
b5f310cb 39# allow build dir to be kept
40%define keep_build 0
41
788cdc6d 42Summary: Routing daemon
6bd8fd3b 43Name: quagga
6382b6f8 44Version: @VERSION@
edd7c245 45Release: @CONFDATE@01
788cdc6d 46License: GPL
47Group: System Environment/Daemons
6bd8fd3b 48Source0: http://www.quagga.net/snapshots/cvs/%{name}-%{version}.tar.gz
49URL: http://www.quagga.net
788cdc6d 50%if %with_snmp
b63cef7c 51BuildRequires: net-snmp-devel
52Prereq: net-snmp
788cdc6d 53%endif
d7ccae28 54%if %with_vtysh
30b9d89b 55BuildRequires: readline readline-devel ncurses ncurses-devel
d7ccae28 56Prereq: readline ncurses
57%endif
15d74e93 58BuildRequires: texinfo tetex autoconf pam-devel patch libcap-devel
788cdc6d 59# Initscripts > 5.60 is required for IPv6 support
30b9d89b 60Prereq: initscripts >= 5.60
45315b5d 61Prereq: ncurses readline pam
788cdc6d 62Prereq: /sbin/install-info
63Provides: routingdaemon
64BuildRoot: %{_tmppath}/%{name}-%{version}-root
6bd8fd3b 65Obsoletes: bird gated mrt zebra
788cdc6d 66
67%description
6bd8fd3b 68Quagga is a free software that manages TCP/IP based routing
788cdc6d 69protocol. It takes multi-server and multi-thread approach to resolve
70the current complexity of the Internet.
71
6bd8fd3b 72Quagga supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.
788cdc6d 73
6bd8fd3b 74Quagga 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.
788cdc6d 79
448ed4a2 80%package contrib
6bd8fd3b 81Summary: contrib tools for quagga
448ed4a2 82Group: System Environment/Daemons
83
84%description contrib
6bd8fd3b 85Contributed/3rd party tools which may be of use with quagga.
448ed4a2 86
e0626854 87%package devel
6bd8fd3b 88Summary: Header and object files for quagga development
e0626854 89Group: System Environment/Daemons
90
91%description devel
6bd8fd3b 92The quagga-devel package contains the header and object files neccessary for
93developing OSPF-API and quagga applications.
e0626854 94
788cdc6d 95%prep
96%setup -q
788cdc6d 97
98%build
99%configure \
788cdc6d 100%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
68980084 124%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
5b819262 134%if %with_irdp
135 --enable-irdp=yes \
136%else
137 --enable-irdp=no \
138%endif
788cdc6d 139%if %with_pam
edd7c245 140 --with-libpam \
788cdc6d 141%endif
6bd8fd3b 142%if %quagga_user
143 --enable-user=%quagga_user \
144 --enable-group=%quagga_user \
edd7c245 145%endif
146%if %vty_group
147 --enable-vty-group=%vty_group \
148%endif
edd7c245 149--enable-netlink
788cdc6d 150
151make %{?_smp_mflags} MAKEINFO="makeinfo --no-split"
152
153pushd doc
6bd8fd3b 154texi2html quagga.texi
788cdc6d 155popd
156
157%install
158rm -rf $RPM_BUILD_ROOT
159
160install -d $RPM_BUILD_ROOT/etc/{rc.d/init.d,sysconfig,logrotate.d,pam.d} \
6bd8fd3b 161 $RPM_BUILD_ROOT/var/log/quagga $RPM_BUILD_ROOT%{_infodir}
788cdc6d 162
163make install \
164 DESTDIR=$RPM_BUILD_ROOT
165
9a344b74 166# Remove this file, as it is uninstalled and causes errors when building on RH9
167rm -rf $RPM_BUILD_ROOT/usr/share/info/dir
168
15d74e93 169# 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
6bd8fd3b 180install -d -m750 $RPM_BUILD_ROOT/var/run/quagga
edd7c245 181
182%pre
183# add vty_group
184%if %vty_group
185groupadd -r %vty_group 2> /dev/null || :
186%endif
6bd8fd3b 187# add quagga user and group
188%if %quagga_user
15d74e93 189/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" \
6bd8fd3b 192 -d %_localstatedir %quagga_user 2> /dev/null || :
edd7c245 193%endif
788cdc6d 194
788cdc6d 195%post
30b9d89b 196# zebra_spec_add_service <service name> <port/proto> <comment>
788cdc6d 197# 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"
d7ccae28 210%if %with_ipv6
788cdc6d 211zebra_spec_add_service ripngd 2603/tcp "RIPngd vty"
d7ccae28 212%endif
788cdc6d 213zebra_spec_add_service ospfd 2604/tcp "OSPFd vty"
214zebra_spec_add_service bgpd 2605/tcp "BGPd vty"
d7ccae28 215%if %with_ipv6
788cdc6d 216zebra_spec_add_service ospf6d 2606/tcp "OSPF6d vty"
d7ccae28 217%endif
7021c425 218%if %with_ospfapi
219zebra_spec_add_service ospfapi 2607/tcp "OSPF-API"
220%endif
5a514b14 221zebra_spec_add_service isisd 2608/tcp "ISISd vty"
788cdc6d 222
15d74e93 223for daemon in %daemon_list ; do
224 /sbin/chkconfig --add ${daemon}
225done
788cdc6d 226
6bd8fd3b 227/sbin/install-info %{_infodir}/quagga.info.gz %{_infodir}/dir
788cdc6d 228
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
15d74e93 241 for daemon in %daemon_list ; do
242 /etc/rc.d/init.d/${daemon} condrestart >/dev/null 2>&1
243 done
788cdc6d 244fi
788cdc6d 245
246%preun
247if [ "$1" = "0" ]; then
15d74e93 248 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
788cdc6d 253fi
254
255%clean
b5f310cb 256%if !%{keep_build}
257rm -rf $RPM_BUILD_ROOT
258%endif
788cdc6d 259
260%files
261%defattr(-,root,root)
448ed4a2 262%doc */*.sample* AUTHORS COPYING
6bd8fd3b 263%doc doc/quagga.html
30b9d89b 264%doc doc/mpls
8f754983 265%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
6bd8fd3b 266%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
edd7c245 270%else
788cdc6d 271%dir %attr(750,root,root) %{_sysconfdir}
6bd8fd3b 272%dir %attr(750,root,root) /var/log/quagga
788cdc6d 273%dir %attr(755,root,root) /usr/share/info
6bd8fd3b 274%dir %attr(750,root,root) /var/run/quagga
edd7c245 275%endif
276%if %vty_group
6bd8fd3b 277%attr(750,%quagga_user,%vty_group) %{_sysconfdir}/vtysh.conf.sample
edd7c245 278%endif
788cdc6d 279%{_infodir}/*info*
280%{_mandir}/man*/*
281%{_sbindir}/*
2ff9e826 282%{_libdir}/lib*.so
283%{_libdir}/lib*.so.*
d7ccae28 284%if %with_vtysh
788cdc6d 285%{_bindir}/*
d7ccae28 286%endif
6bd8fd3b 287%config /etc/quagga/[!v]*
788cdc6d 288%config /etc/rc.d/init.d/*
15d74e93 289%config(noreplace) /etc/sysconfig/quagga
6bd8fd3b 290%config(noreplace) /etc/pam.d/quagga
788cdc6d 291%config(noreplace) %attr(640,root,root) /etc/logrotate.d/*
292
448ed4a2 293%files contrib
294%defattr(-,root,root)
295%doc tools
296
e0626854 297%files devel
298%defattr(-,root,root)
2ff9e826 299%dir %{_libdir}/*.a
300%dir %{_libdir}/*.la
15d74e93 301%dir %{_includedir}/%name/*.h
302%dir %{_includedir}/%name/ospfd/*.h
68980084 303%if %with_ospfapi
15d74e93 304%dir %{_includedir}/%name/ospfapi/*.h
68980084 305%endif
e0626854 306
788cdc6d 307%changelog
15d74e93 308%changelog
00bc5603 309* 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
15d74e93 314* 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
406f7000 325* Sun Nov 2 2003 Paul Jakma <paul@dishone.st>
326- Fix -devel package to include all files
327- Sync to 0.96.4
328
6bd8fd3b 329* Tue Aug 12 2003 Paul Jakma <paul@dishone.st>
330- Renamed to Quagga
331- Sync to Quagga release 0.96
332
edd7c245 333* Tue Mar 20 2003 Paul Jakma <paul@dishone.st>
334- zebra privileges support
335
e0626854 336* 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
448ed4a2 341* 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
8f754983 346* 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
d7ccae28 356* 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
788cdc6d 362* 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