Sophie

Sophie

distrib > Mandriva > 10.0-com > i586 > by-pkgid > 40e34a62102bc4411d1fd7fb42b19078 > files > 12

zebra-0.94-1mdk.src.rpm

%define with_snmp 0

Summary:	Routing daemon
Name:		zebra
Version:	0.94
Release:	1mdk
License:	GPL
Group:		System/Servers
Source0:	%{name}-%{version}.tar.bz2
Source1:	zebra.init.bz2
Source2:	bgpd.init.bz2
Source3:	ospf6d.init.bz2
Source4:	ospfd.init.bz2
Source5:	ripd.init.bz2
Source6:	ripngd.init.bz2
Source8:	zebra.pam.bz2
Source9:	zebra.logrotate.bz2
Source10:	zebra.jpg
Patch6:		zebra-0.91a-netlink.patch.bz2
URL:		http://www.zebra.org/
PreReq:		rpm-helper
BuildRequires:	texinfo tetex-texi2html autoconf readline-devel ncurses-devel pam-devel
#Requires:	pam (required by basesystem)
Provides:	routingdaemon
Obsoletes:	bird gated mrt
Provides:	bird gated mrt
BuildRoot:	%{_tmppath}/%{name}-root

%if %with_snmp
Requires:	net-snmp-mibs
BuildRequires:	net-snmp-devel
BuildRequires:	openssl-devel
%endif

%description
GNU Zebra is a free software that manages TCP/IP based routing
protocol. It takes multi-server and multi-thread approach to resolve
the current complexity of the Internet.

GNU Zebra supports BGP4, BGP4+, OSPFv2, OSPFv3, RIPv1, RIPv2, and RIPng.

GNU Zebra is intended to be used as a Route Server and a Route
Reflector. It is not a toolkit, it provides full routing power under
a new architecture. GNU Zebra is unique in design in that it has a
process for each protocol.

%prep
%setup  -q
%patch6 -p1 -b .netlink

%build
%serverbuild

%configure \
	--sysconfdir=%{_sysconfdir}/zebra \
	--disable-dependency-tracking \
	--enable-one-vty \
	--enable-ipv6 \
	--enable-netlink \
%if %with_snmp
	--enable-snmp \
%endif
	--enable-vtysh \
	--with-libpam \
	--enable-nssa \
	--enable-opaque-lsa \
	--enable-ospf-te

%make

pushd doc
    texi2html zebra.texi
popd

%install
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_sysconfdir}/{sysconfig,logrotate.d,pam.d}
install -d %{buildroot}/var/log/zebra
install -d %{buildroot}%{_infodir}
install -d %{buildroot}/var/www/icons

make DESTDIR=%{buildroot} install

rm -fr %{buildroot}/%{_sysconfdir}/zebra/*.sample*

for I in zebra bgpd ospf6d ospfd ripd ripngd vtysh; do
	:> %{buildroot}/etc/zebra/$I.conf
done

bzcat %{SOURCE1} > %{buildroot}%{_initrddir}/zebra
bzcat %{SOURCE2} > %{buildroot}%{_initrddir}/bgpd
bzcat %{SOURCE3} > %{buildroot}%{_initrddir}/ospf6d
bzcat %{SOURCE4} > %{buildroot}%{_initrddir}/ospfd
bzcat %{SOURCE5} > %{buildroot}%{_initrddir}/ripd
bzcat %{SOURCE6} > %{buildroot}%{_initrddir}/ripngd
chmod 755 %{buildroot}%{_initrddir}/*

bzcat %{SOURCE8} > %{buildroot}%{_sysconfdir}/pam.d/zebra
bzcat %{SOURCE9} > %{buildroot}%{_sysconfdir}/logrotate.d/zebra

# install icon 
install -m0644 %{SOURCE10} %{buildroot}/var/www/icons/zebra.jpg

# remove installed file
rm -f %{buildroot}%{_infodir}/dir

%post
# zebra_spec_add_service <sercice name> <port/proto> <comment>
# e.g. zebra_spec_add_service zebrasrv 2600/tcp "zebra service"

zebra_spec_add_service ()
{
  # Add port /etc/services entry if it isn't already there 
  if [ -f %{_sysconfdir}/services ] && ! grep -q "^$1[^a-zA-Z0-9]" %{_sysconfdir}/services ; then
    echo "$1		$2			# $3"  >> %{_sysconfdir}/services
  fi
}

zebra_spec_add_service zeBRASRV 2600/tcp "zebra service"
zebra_spec_add_service zebra    2601/tcp "zebra vty"
zebra_spec_add_service ripd     2602/tcp "RIPd vty"
zebra_spec_add_service ripngd   2603/tcp "RIPngd vty"
zebra_spec_add_service ospfd    2604/tcp "OSPFd vty"
zebra_spec_add_service bgpd     2605/tcp "BGPd vty"
zebra_spec_add_service ospf6d   2606/tcp "OSPF6d vty"

%_install_info %{name}.info

%_post_service zebra 
%_post_service ripd
%_post_service ripngd
%_post_service ospfd
%_post_service ospf6d
%_post_service bgpd

# Create dummy files if they don't exist so basic functions can be used.
if [ ! -e %{_sysconfdir}/zebra/zebra.conf ]; then
	echo "hostname `hostname`" > %{_sysconfdir}/zebra/zebra.conf
	chmod 640 %{_sysconfdir}/zebra/zebra.conf
fi
if [ ! -e %{_sysconfdir}/zebra/vtysh.conf ]; then
	touch %{_sysconfdir}/zebra/vtysh.conf
	chmod 640 %{_sysconfdir}/zebra/vtysh.conf
fi

%preun
%_preun_service zebra
%_preun_service ripd
%_preun_service ripngd
%_preun_service ospfd
%_preun_service ospf6d
%_preun_service bgpd

%_remove_install_info %{name}.info

%clean
[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%files
%defattr(-,root,root)
%doc */*.sample* doc/zebra.html tools AUTHORS COPYING
%doc ChangeLog INSTALL NEWS README REPORTING-BUGS SERVICES TODO
%dir %attr(750,root,root) %{_sysconfdir}/zebra
%ghost %config(noreplace,missingok) %{_sysconfdir}/zebra/bgpd.conf
%ghost %config(noreplace,missingok) %{_sysconfdir}/zebra/ospf6d.conf
%ghost %config(noreplace,missingok) %{_sysconfdir}/zebra/ospfd.conf
%ghost %config(noreplace,missingok) %{_sysconfdir}/zebra/ripd.conf
%ghost %config(noreplace,missingok) %{_sysconfdir}/zebra/ripngd.conf
%ghost %config(noreplace,missingok) %{_sysconfdir}/zebra/vtysh.conf
%ghost %config(noreplace,missingok) %{_sysconfdir}/zebra/zebra.conf
%attr(755,root,root) %config(noreplace)  %{_initrddir}/*
%config(noreplace) %{_sysconfdir}/pam.d/zebra
%config(noreplace) %attr(644,root,root) %{_sysconfdir}/logrotate.d/*
%dir %attr(750,root,root) /var/log/zebra
%{_infodir}/*info*
%{_mandir}/man*/*
%{_sbindir}/*
%{_bindir}/*
/var/www/icons/zebra.jpg

%changelog
* Thu Nov 27 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.94-1mdk
- 0.94
- drop P0 - P5, these are integrated in the upstream source
- added S10

* Fri Nov 14 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.93b-3mdk
- merge with rh (fixes [CAN-2003-0795] & [CAN-2003-0858])
- misc spec file fixes

* Tue Sep 02 2003 Michael Scherer <scherer.michael@free.fr> 0.93b-2mdk 
- clean Requires
- s/tetex/tetex-texi2html/
- use macros for service

* Tue Jun 17 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.93b-1mdk
- merge with rh

* Tue Jan 28 2003 Lenny Cartier <lenny@mandrakesoft.com> 0.93a-4mdk
- rebuild

* Mon Jan 27 2003 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.93a-3mdk
- build release
- misc spec file fixes

* Sat Nov 23 2002 Olivier Thauvin <thauvin@aerov.jussieu.fr> 0.93a-2mdk
- fix unpackaged files
- Osboletes should be provides

* Wed Aug 21 2002 Oden Eriksson <oden.eriksson@kvikkjokk.net> 0.93a-1mdk
- initial cooker contrib, ripped from RH RawHide, adapted for ML
- misc spec file fixes
- fix SysV scripts

* Wed Aug 13 2002 Elliot Lee <sopwith@redhat.com> 0.93a-1
- New version

* Fri Jun 21 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Wed May 29 2002 Elliot Lee <sopwith@redhat.com> 0.92a-5
- Hack out the perl deps, yuk.

* Thu May 23 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Wed Apr 10 2002 Elliot Lee <sopwith@redhat.com> 0.92a-3
- Add Prereq on grep & chkconfig, remove other prereqs
that weren't needed anyways.

* Wed Jan 09 2002 Tim Powers <timp@redhat.com>
- automated rebuild

* Thu Jan 03 2002 Elliot Lee <sopwith@redhat.com> 0.92a-1
- Update to 0.92a

* Thu Aug 09 2001 Elliot Lee <sopwith@redhat.com> 0.91a-6
- Fix bug #51336

* Wed Aug  1 2001 Trond Eivind Glomsrød <teg@redhat.com> 0.91a-5
- Use generic initscript strings instead of initscript specific
  ( "Starting foo: " -> "Starting $prog:" )

* Fri Jul 27 2001 Elliot Lee <sopwith@redhat.com> 0.91a-4
- Bump the release when rebuilding into the dist.

* Tue Feb  6 2001 Tim Powers <timp@redhat.com>
- built for Powertools

* Sun Feb  4 2001 Pekka Savola <pekkas@netcore.fi> 
- Hacked up from PLD Linux 0.90-1, Mandrake 0.90-1mdk and one from zebra.org.
- Update to 0.91a
- Very heavy modifications to init.d/*, .spec, pam, i18n, logrotate, etc.
- Should be quite Red Hat'isque now.