Sophie

Sophie

distrib > Mandriva > 2009.0 > x86_64 > media > main-testing-src > by-pkgid > d9da1cc217400f6c4d82193d24fc7d10 > files > 12

dhcp-3.0.7-1.5mdv2009.0.src.rpm

%define _catdir /var/cache/man

Summary:	The ISC DHCP (Dynamic Host Configuration Protocol) server/relay agent/client
Name:		dhcp
Epoch:		2
Version:	3.0.7
%define subrel 5
Release:	%mkrel 1
License:	Distributable
Group:		System/Servers
URL:		http://www.isc.org/dhcp.html
Source0:	ftp://ftp.isc.org/isc/%{name}/%{name}-%{version}.tar.gz
Source1:	ftp://ftp.isc.org/isc/%{name}/%{name}-%{version}.tar.gz.sha512.asc
Source2:	dhcpd.conf
Source3:	dhcpd.init
Source4:	dhcp-dynamic-dns-examples.tar.bz2
Source5:	dhcrelay.init
Source6:	update_dhcp.pl
Source7:	dhcpreport.pl
Source8:	dhcpd-chroot.sh
Patch0:		dhcp-3.0.5-ifup.patch
# http://home.ntelos.net/%7Emasneyb/dhcp-3.0.1rc14-ldap-patch
# http://www.newwave.net/~masneyb/dhcp-3.0.5-ldap-patch
Patch1:		dhcp-3.0.5-ldap.patch
# (oe) http://www.episec.com/people/edelkind/patches/
Patch2:		dhcp-3.0.1-paranoia.diff
Patch4:		dhcp-3.0.1-default-timeout.patch
Patch5:		dhcp-4.1.0-prevent_wireless_deassociation.patch
Patch6:		dhcp-3.0.7-CVE-2009-0692.diff
Patch7:		dhcp-3.0.7-CVE-2009-1892.diff
Patch8:		dhcp-4.1.0-mtu.patch
BuildRequires:	perl groff-for-man
BuildRequires:	openldap-devel
Provides:	dhcpd
Obsoletes:	dhcpd < 3.0.6
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot

%description 
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows 
individual devices on an IP network to get their own network configuration
information (IP address, subnetmask, broadcast address, etc.) from a DHCP
server. The overall purpose of DHCP is to make it easier to administer a 
large network. The dhcp package includes the DHCP server and a DHCP relay
agent. You will also need to install the dhcp-client or dhcpcd package,
or pump or dhcpxd, which provides the DHCP client daemon, on client machines.

If you want the DHCP server and/or relay, you will also need to install the
dhcp-server and/or dhcp-relay packages.

%package common
Summary:	The ISC DHCP (Dynamic Host Configuration Protocol) server
Group:		System/Servers

%description common
DHCP (Dynamic Host Configuration Protocol) is a protocol which allows 
individual devices on an IP network to get their own network 
configuration information (IP address, subnetmask, broadcast address, 
etc.) from a DHCP server.  The overall purpose of DHCP is to make it 
easier to administer a large network.  The dhcp package includes the 
DHCP server and a DHCP relay agent.

You will also need to install the dhcp-client or dhcpcd package, or pump or
dhcpxd, which provides the DHCP client daemon, on  client machines. If you
want the DHCP server and/or relay, you will also need to install the
dhcp-server and/or dhcp-relay packages.

%package doc
Summary:	Documentation about the ISC DHCP server/client
Group:		System/Servers

%description doc
This package contains RFC/API/protocol documentation about the ISC
DHCP server and client.

DHCP (Dynamic Host Configuration Protocol) is a protocol which allows 
individual devices on an IP network to get their own network 
configuration information (IP address, subnetmask, broadcast address, 
etc.) from a DHCP server.  The overall purpose of DHCP is to make it 
easier to administer a large network.  The dhcp package includes the 
DHCP server and a DHCP relay agent.

%package server
Summary:	The ISC DHCP (Dynamic Host Configuration Protocol) server
Group:		System/Servers
Requires:	dhcp-common = %{epoch}:%{version}-%{release}
Requires(post):	rpm-helper
Requires(preun): rpm-helper
Obsoletes:	dhcp < 3.0.6
Provides:	dhcp

%description server
DHCP server is the Internet Software Consortium (ISC) DHCP server for various
UNIX operating systems. It allows a UNIX mac hine to serve DHCP requests from
the network.

You should install dhcp-server if you want to set up a DHCP server on your
network. You will also need to install the base dhcp package.

%package client
Summary:	The ISC DHCP (Dynamic Host Configuration Protocol) client
Group:		System/Servers
Requires:	dhcp-common = %{epoch}:%{version}-%{release}

%description client
DHCP client is the Internet Software Consortium (ISC) DHCP client for various
UNIX operating systems.  It allows a UNIX mac hine to obtain it's networking
parameters from a DHCP server.

You should install dhcp-client if you want to use the ISC DHCP client instead
of the Red Hat DHCP client, pump, or dhcpcd, or dhcpxd. You will also need to
install the base dhcp package.

%package relay
Summary:	The ISC DHCP (Dynamic Host Configuration Protocol) relay
Group:		System/Servers
Requires:	dhcp-common = %{epoch}:%{version}-%{release}
Requires(post):	rpm-helper
Requires(preun): rpm-helper

%description relay
DHCP relay is the Internet Software Consortium (ISC) relay agent for DHCP
packets. It is used on a subnet with DHCP clients to "relay" their requests
to a subnet that has a DHCP server on it. Because DHCP packets can be
broadcast, they will not be routed off of the local subnet. The DHCP relay
takes care of this for the client. You will need to set the environment
variable SERVERS and optionally OPTIONS in /etc/sysconfig/dhcrelay before
starting the server.

%package devel
Summary:	Development headers and libraries for the dhcpctl API
Group:		Development/Other
Requires:	dhcp-common = %{epoch}:%{version}-%{release}

%description devel
DHCP devel contains all of the libraries and headers for developing with the
Internet Software Consortium (ISC) dhcpctl API.

%prep

%setup -q -n %{name}-%{version} -a4
%patch0 -p1 -b .ifup
%patch1 -p1 -b .dhcp-ldap
%patch2 -p1 -b .paranoia
%patch4 -p1 -b .default-timeout
%patch5 -p1 -b .prevent_wireless_deassociation
%patch6 -p0 -b .CVE-2009-0692
%patch7 -p0 -b .CVE-2009-1892
%patch8 -p1 -b .mtu

cat << EOF >site.conf
VARDB=%{_var}/lib/dhcp
LIBDIR=%{_libdir}
INCDIR=%{_includedir}
ADMMANDIR=%{_mandir}/man8
FFMANDIR=%{_mandir}/man5
LIBMANDIR=%{_mandir}/man3
USRMANDIR=%{_mandir}/man1
EOF
cat << EOF >>includes/site.h
#define _PATH_DHCPD_PID		"%{_var}/run/dhcpd/dhcpd.pid"
#define _PATH_DHCPD_DB		"%{_var}/lib/dhcp/dhcpd.leases"
#define _PATH_DHCLIENT_DB	"%{_var}/lib/dhcp/dhclient.leases"
EOF

%build
%serverbuild
echo 'int main() { return sizeof(void *) != 8; }' | gcc -xc - -o is_ptr64
./is_ptr64 && PTR64_FLAGS="-DPTRSIZE_64BIT"

./configure --copts "%{optflags} $PTR64_FLAGS -DPARANOIA -DCL_DEFAULT_TIMEOUT=60 -DLDAP_DEPRECATED"

#-DEARLY_CHROOT

%make

%install
rm -rf %{buildroot}

install -d %{buildroot}%{_bindir}
install -d %{buildroot}%{_sysconfdir}/sysconfig
install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_var}/lib/dhcp
install -d %{buildroot}%{_var}/run/dhcpd

%makeinstall_std

install -m0755 %{SOURCE3} %{buildroot}%{_initrddir}/dhcpd
install -m0755 %{SOURCE5} %{buildroot}%{_initrddir}/dhcrelay
install -m0755 %{SOURCE6} %{SOURCE7} %{SOURCE8} %{buildroot}%{_sbindir}/
install -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/
install -m0755 contrib/dhcpd-conf-to-ldap.pl %{buildroot}%{_sbindir}/

cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcpd <<EOF
# You can set here various option for dhcpd

# Which configuration file to use.
# CONFIGFILE="/etc/dhcpd.conf"

# Where to store the lease state information.
# LEASEFILE="/var/lib/dhcp/dhcpd.leases"

# Define INTERFACES to limit which network interfaces dhcpd listens on.
# The default null value causes dhcpd to listen on all interfaces.
#INTERFACES=""

# Define OPTIONS with any other options to pass to the dhcpd server.
# See dhcpd(8) for available options and syntax.
OPTIONS="-q"

EOF

touch %{buildroot}%{_var}/lib/dhcp/dhcpd.leases
touch %{buildroot}%{_var}/lib/dhcp/dhclient.leases

cat > %{buildroot}%{_sysconfdir}/sysconfig/dhcrelay <<EOF
# Define SERVERS with a list of one or more DHCP servers where
# DHCP packets are to be relayed to and from.  This is mandatory.
#SERVERS="10.11.12.13 10.9.8.7"
SERVERS=""

# Define OPTIONS with any other options to pass to the dhcrelay server.
# See dhcrelay(8) for available options and syntax.
#OPTIONS="-q -i eth0 -i eth1"
OPTIONS="-q"
EOF

find . -type d -exec chmod 0755 {} \;
find . -type f -exec chmod 0644 {} \;

rm -rf doc/ja_JP.eucJP

# remove empty files
find -size 0 |grep ldap | xargs rm -rf 

%post server
%_post_service dhcpd
# New dhcpd lease file
if [ ! -f %{_var}/lib/dhcp/dhcpd.leases ]; then
    touch %{_var}/lib/dhcp/dhcpd.leases
fi

if [ $1 = 0 ]; then
	%{_initrddir}/dhcpd start
fi

#update an eventual installed dhcp-2* server
if [ -f %{_sysconfdir}/dhcpd.conf ]; then
	perl %{_sbindir}/update_dhcp.pl
fi

%preun server
%_preun_service dhcpd

%postun server
if [ "$1" -ge "1" ]; then
    /sbin/service dhcpd condrestart >/dev/null 2>&1  
fi

%post relay
%_post_service dhcrelay

%preun relay
%_preun_service dhcrelay

%postun relay
if [ "$1" -ge "1" ]; then
    /sbin/service dhcrelay condrestart >/dev/null 2>&1
fi
		 
%post client
touch /var/lib/dhcp/dhclient.leases

%postun client
rm -rf /var/lib/dhcp/dhclient.leases

%clean
rm -rf %{buildroot}

%files common
%defattr(-,root,root)
%doc README README.ldap RELNOTES Changelog-LDAP
%doc contrib/3.0b1-lease-convert
%dir %{_var}/lib/dhcp
%{_mandir}/man5/dhcp-options.5*

%files doc
%defattr(-,root,root)
%doc doc/*

%files server
%defattr(-,root,root)
%doc server/dhcpd.conf tests/failover contrib/dhcp.schema
%{_initrddir}/dhcpd
%config(noreplace) %{_sysconfdir}/dhcpd.conf
%config(noreplace) %{_sysconfdir}/sysconfig/dhcpd
%config(noreplace) %ghost %{_var}/lib/dhcp/dhcpd.leases
%{_sbindir}/dhcpd
%{_sbindir}/update_dhcp.pl
%{_sbindir}/dhcpreport.pl
%{_sbindir}/dhcpd-conf-to-ldap.pl
%{_sbindir}/dhcpd-chroot.sh
%{_bindir}/omshell
%{_mandir}/man1/omshell.1*
%{_mandir}/man3/omapi.3*
%{_mandir}/man5/dhcpd.conf.5*
%{_mandir}/man5/dhcpd.leases.5*
%{_mandir}/man5/dhcp-eval.5*
%{_mandir}/man8/dhcpd.8*
%dir %{_var}/run/dhcpd

%files relay
%defattr(-,root,root)
%{_initrddir}/dhcrelay
%config(noreplace) %{_sysconfdir}/sysconfig/dhcrelay
%{_sbindir}/dhcrelay
%{_mandir}/man8/dhcrelay.8*

%files client
%defattr(-,root,root)
%doc client/dhclient.conf
%config(noreplace) %ghost %{_var}/lib/dhcp/dhclient.leases
%attr (0755,root,root) /sbin/dhclient-script
/sbin/dhclient
%{_mandir}/man5/dhclient.conf.5*
%{_mandir}/man5/dhclient.leases.5*
%{_mandir}/man8/dhclient.8*
%{_mandir}/man8/dhclient-script.8*

%files devel
%defattr(-,root,root)
%{_includedir}/*
%{_libdir}/*
%{_mandir}/man3/*




%changelog
* Tue Jan 26 2010 Eugeni Dodonov <eugeni@mandriva.com> 2:3.0.7-1.5mdv2009.0
+ Revision: 496854
- Added missing patch for CVE-2009-1892.
- Support setting MTU when asked by server (#57260).

* Wed Jul 15 2009 Security Team <security@mandriva.com> 2:3.0.7-1.3mdv2009.0
+ Revision: 396421
- P6: security fix for CVE-2009-0692

* Fri Mar 20 2009 Gustavo De Nardin <gustavodn@mandriva.com> 2:3.0.7-1.2mdv2009.0
+ Revision: 359220
- build for updates
- fix merged from Cooker:
  - added Patch7, as suggested by Andrey Borzenkov, which prevents
    dhclient-script from bringing interfaces down needlessly, which in turn
    works around bug #43441 (deassociation going unnoticed by wpa_supplicant,
    in the end causing the interface to not get an IP address)

  + root <root>
    - Branching 2009.0 release for updates.

* Sun Jul 13 2008 Tomasz Pawel Gajc <tpg@mandriva.org> 2:3.0.7-1mdv2009.0
+ Revision: 234269
- update to new version 3.0.7
- Patch1: new version
- use %%_var instead of %%_localstatedir
- spec file clean

* Mon Jun 16 2008 Thierry Vignaud <tvignaud@mandriva.com> 2:3.0.6-6mdv2009.0
+ Revision: 220615
- rebuild

  + Pixel <pixel@mandriva.com>
    - adapt to %%_localstatedir now being /var instead of /var/lib (#22312)

* Wed Mar 26 2008 Oden Eriksson <oeriksson@mandriva.com> 2:3.0.6-5mdv2008.1
+ Revision: 190309
- don't start it per default

* Wed Jan 23 2008 Thierry Vignaud <tvignaud@mandriva.com> 2:3.0.6-4mdv2008.1
+ Revision: 157246
- rebuild with fixed %%serverbuild macro

* Mon Dec 24 2007 Oden Eriksson <oeriksson@mandriva.com> 2:3.0.6-3mdv2008.1
+ Revision: 137459
- rebuilt against openldap-2.4.7 libs

  + Olivier Blin <oblin@mandriva.com>
    - restore BuildRoot
    - fix typo in doc description

  + Thierry Vignaud <tvignaud@mandriva.com>
    - kill re-definition of %%buildroot on Pixel's request

* Wed Dec 12 2007 Olivier Blin <oblin@mandriva.com> 2:3.0.6-2mdv2008.1
+ Revision: 119077
- move rpm-helper requirements in post/preun instead of pre/postun when needed

* Tue Jul 10 2007 Tomasz Pawel Gajc <tpg@mandriva.org> 2:3.0.6-1mdv2008.0
+ Revision: 50797
- new version

* Wed Jul 04 2007 Andreas Hasenack <andreas@mandriva.com> 2:3.0.5-8mdv2008.0
+ Revision: 48227
- use serverbuild macro (-fstack-protector-all)


* Wed Mar 28 2007 Olivier Blin <oblin@mandriva.com> 3.0.5-7mdv2007.1
+ Revision: 149230
- dhcpcd should start ldap (Daggett)

* Fri Mar 16 2007 Olivier Blin <oblin@mandriva.com> 2:3.0.5-6mdv2007.1
+ Revision: 144641
- drop useless perl(Win32API::Registry) requires exception
- move RFC/API/protocol doc in a dhcp-doc sub-package

* Sat Mar 10 2007 Olivier Blin <oblin@mandriva.com> 2:3.0.5-5mdv2007.1
+ Revision: 140432
- PEERGATEWAY support (#20806)

* Sat Mar 10 2007 Olivier Blin <oblin@mandriva.com> 2:3.0.5-4mdv2007.1
+ Revision: 140295
- default to NEEDHOSTNAME=no, as described in initscripts documentation

* Thu Jan 11 2007 Olivier Blin <oblin@mandriva.com> 2:3.0.5-3mdv2007.1
+ Revision: 107599
- make dhclient-script set DEVICE variable when no ifcfg file is present (to call resolvconf correctly)

* Tue Jan 02 2007 Olivier Blin <oblin@mandriva.com> 2:3.0.5-2mdv2007.1
+ Revision: 103318
- bump release
- do not call unknown /sbin/update-resolvrdv in dhclient-script
- set metric before creating resolv.conf (useful for resolvconf)

* Thu Nov 16 2006 Guillaume Rousse <guillomovitch@mandriva.org> 2:3.0.5-1mdv2007.1
+ Revision: 84730
- new version
  install configuration file under real name, not as sample

* Fri Sep 01 2006 Olivier Blin <oblin@mandriva.com> 2:3.0.4-2mdv2007.0
+ Revision: 59227
- add METRIC support in dhclient-script (from Fabrice Facorat, #23164)
- bunzip sources and patches
- Import dhcp

* Mon May 22 2006 Oden Eriksson <oeriksson@mandriva.com> 3.0.4-1mdk
- 3.0.4
- added new rediffed ldap patch (P1)

* Mon Feb 06 2006 Olivier Blin <oblin@mandriva.com> 3.0.4-0.b2.8mdk
- use $'\n' in dhclient-script (required for initscripts >= 7.66,
  since change_resolv_conf doesn't use "echo -e" anymore)

* Mon Jan 09 2006 Olivier Blin <oblin@mandriva.com> 3.0.4-0.b2.7mdk
- fix requires post and preun
- fix typo in initscript

* Mon Jan 09 2006 Olivier Blin <oblin@mandriva.com> 3.0.4-0.b2.6mdk
- convert parallel init to LSB

* Mon Jan 02 2006 Olivier Blin <oblin@mandriva.com> 3.0.4-0.b2.5mdk
- parallel init support

* Tue Dec 06 2005 Frederic Lepied <flepied@mandriva.com> 3.0.4-0.b2.4mdk
- use change_resolv_conf in dhclient-scripts to be able to do the right
thing wrt nscd.

* Tue Nov 29 2005 Thierry Vignaud <tvignaud@mandriva.com> 3.0.4-0.b2.3mdk
- fix build on x86_64

* Thu Nov 24 2005 Oden Eriksson <oeriksson@mandriva.com> 3.0.4-0.b2.2mdk
- exclude debug files in the -devel package, temporary solution

* Mon Nov 14 2005 Oden Eriksson <oeriksson@mandriva.com> 3.0.4-0.b2.1mdk
- 3.0.4b2
- pass "-DLDAP_DEPRECATED" to the CFLAGS
- updated rediffed P1 (dhcp-3.0.3-ldap-patch)
- fix the chroot script so it won't touch the /etc/dhcpd.conf file

* Wed Aug 31 2005 Oden Eriksson <oeriksson@mandriva.com> 3.0.3-3mdk
- rebuilt against new openldap-2.3.6 libs

* Sat Aug 06 2005 Michael Scherer <misc@mandriva.org> 3.0.3-2mdk
- fill a default config file

* Mon Aug 01 2005 Oden Eriksson <oeriksson@mandriva.com> 3.0.3-1mdk
- 3.0.3
- fix deps
- drop the gcc343 patch (P3), it's fixed upstream
- use the %%mkrel macro

* Sat Apr 23 2005 Olivier Blin <oblin@mandriva.com> 3.0.2-2mdk
- do not make dhclient-script fail and return DENY return code when no
  config file for the interface is found (update and re-indent Patch0)

* Thu Feb 24 2005 Oden Eriksson <oeriksson@mandrakesoft.com> 3.0.2-1mdk
- 3.0.2

* Fri Feb 04 2005 Buchan Milne <bgmilne@linux-mandrake.com> 3.0.1-9mdk
- rebuild for ldap2.2_7

* Wed Feb 02 2005 Frederic Lepied <flepied@mandrakesoft.com> 3.0.1-8mdk
- back to standard 60 seconds timeout.

* Wed Feb 02 2005 Frederic Lepied <flepied@mandrakesoft.com> 3.0.1-7mdk
- default timeout to 5 seconds

* Fri Dec 24 2004 Oden Eriksson <oeriksson@mandrakesoft.com> 3.0.1-6mdk
- new ldap patch
- renumber sources and patches
- bzip sources
- added P2 that allows us to run it chroot
- added S8 that makes it easier to chroot the server
- fixed S3 to make use of P2 & S8
- fix pid file location for the dhcpd daemon
- added P3 to make it build with latest cooker gcc (rock linux)
- misc spec file fixes

* Sat Jul 31 2004 Frederic Lepied <flepied@mandrakesoft.com> 3.0.1-5mdk
- by default hostname is set

* Sat Jul 31 2004 Frederic Lepied <flepied@mandrakesoft.com> 3.0.1-4mdk
- assign default gateway by interface (updated patch1)

* Fri Jul 30 2004 Frederic Lepied <flepied@mandrakesoft.com> 3.0.1-3mdk
- only change the hostname if NEEDHOSTNAME=yes (updated patch1)

* Thu Jul 29 2004 Buchan Milne <bgmilne@linux-mandrake.com> 3.0.1-2mdk
- update ldap patch

* Thu Jul 29 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 3.0.1-1mdk
- 3.0.1

* Thu Jul 01 2004 Florin <florin@mandrakesoft.com> 3.0-1.rc14.2mdk
- bring back the ldap patch and buildrequires

* Tue Jun 29 2004 Florin <florin@mandrakesoft.com> 3.0-1.rc14.1mdk
- rebuild for cooker

* Tue Jun 22 2004 Vincent Danen <vdanen@mandrakesoft.com> 3.0-1.rc14.0.1.100mdk
- 3.0.1rc14
- security fixes for CAN-2004-0460 (VU#317350) and CAN-2004-0461 (VU#654390)

* Wed May 05 2004 Per Øyvind Karlsen <peroyvind@linux-mandrake.com> 3.0-1.rc13.6mdk
- fix buildrequires

* Sat Apr 24 2004 Florin <florin@mandrakesoft.com> 3.0-1.rc13.5mdk
- add the dhcp-ldap support