dhcp/dhcp.spec

356 lines
12 KiB
RPMSpec
Raw Permalink Normal View History

%define patchver %(echo %version | cut -d. -f4)
%define releasever %(echo %version | cut -d. -f1-3)
Name: dhcp
Version: 4.3.0
Release: 2mamba
Summary: The ISC DHCP (Dynamic Host Configuration Protocol) client
Group: System/Servers
Vendor: openmamba
Distribution: openmamba
Packager: Silvan Calarco <silvan.calarco@mambasoft.it>
URL: http://www.isc.org/software/dhcp
Source0: ftp://ftp.isc.org/isc/dhcp/%{releasever}/%{name}-%{releasever}.tar.gz
#Source0: ftp://ftp.freenet.de/pub/ftp.isc.org/isc/dhcp/%{name}-%{releasever}%{?patchver:-%patchver}.tar.gz
Source1: dhcpd-initscript
Source2: dhcpd-conf
Source3: dhcpd-sysconfig
Source4: dhcp-Makefile.conf
Source5: dhcp-dhclient.conf
Patch0: %{name}-3.0.1-dhclient-script-nodomain.patch
Patch1: %{name}-3.0.2-dhclient-log-less-annoying.patch
Patch2: %{name}-4.0.0-dhclient-script-chk4lock.patch
Patch3: %{name}-4.0.0-dhclient-script-setpath.patch
Patch4: %{name}-4.1.0-ping_from_if.patch
Patch5: dhcp-4.3.0-xen-checksum.patch
License: BSD
## AUTOBUILDREQ-BEGIN
BuildRequires: glibc-devel
## AUTOBUILDREQ-END
BuildRequires: idutils
BuildRequires: net-tools
Requires: net-tools
BuildRoot: %{_tmppath}/%{name}-%{version}-root
%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.
This package contains the DHCP server and a DHCP relay agent.
%package client
Summary: DHCP client
Group: System/Servers
Requires(post):net-tools
Requires(post):coreutils
Provides: dhcp-common
Obsoletes: dhcp-common
Provides: dhcpclient
Requires: %{name}-common = %{?epoch:%epoch:}%{version}-%{release}
%description client
DHCP client is the Internet Software Consortium (ISC) DHCP client for various UNIX operating systems.
It allows a UNIX machine to obtain it's networking parameters from a DHCP server.
%package devel
Summary: DHCP common
Group: System/Servers
Requires: %{name}-common = %{?epoch:%epoch:}%{version}-%{release}
%description devel
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.
This package contains static libraries and header files need for development.
%package server
Summary: DHCP server
Group: System/Servers
Requires: %{name}-common = %{?epoch:%epoch:}%{version}-%{release}
%description server
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.
This package contains the DHCP server.
%prep
#%setup -q -n %{name}-%{releasever}%{?patchver:-%patchver}
%setup -q -n %{name}-%{releasever}
#%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
#cp %{S:4} Makefile.conf
#
#cat << EOF >> includes/site.h
##define _PATH_DHCPD_PID "%{_localstatedir}/run/dhcp/dhcpd.pid"
##define _PATH_DHCPD_DB "%{_localstatedir}/lib/dhcp/dhcpd.leases"
##define _PATH_DHCPD_CONF "%{_sysconfdir}/dhcpd.conf"
#EOF
#
#cat << EOF >> includes/dhcp.h
##define _PATH_DHCLIENT_CONF "%{_sysconfdir}/dhclient.conf"
##define _PATH_DHCLIENT_DB "%{_localstatedir}/lib/dhcp/dhclient.leases"
#EOF
%build
%if "%{_host}" != "%{_build}"
cat > config.cache << _EOF
ac_cv_file__dev_random=yes
_EOF
%endif
%configure \
--sbindir=/sbin \
--with-srv-lease-file=/var/lib/dhcp/dhcpd.leases \
--with-cli-lease-file=/var/lib/dhclient/dhclient.leases \
--with-srv-pid-file=/run/dhcpd.pid \
--with-srv6-pid-file=/run/dhcpd6.pid \
--with-cli-pid-file=/run/dhclient.pid \
--with-cli6-pid-file=/run/dhclient6.pid \
--with-relay-pid-file=/run/dhcrelay.pid \
--with-relay6-pid-file=/run/dhcrelay6.pid \
%if "%{_host}" != "%{_build}"
--cache-file=config.cache
%endif
%make
%install
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%makeinstall DESTDIR=%{buildroot}
install -m0700 client/scripts/linux %{buildroot}/sbin/dhclient-script
install -D %{S:1} %{buildroot}%{_initrddir}/dhcpd
install -D %{S:2} %{buildroot}%{_sysconfdir}/dhcpd.conf
install -D %{S:3} %{buildroot}%{_sysconfdir}/sysconfig/dhcpd
install -D %{S:5} %{buildroot}%{_sysconfdir}/dhclient.conf
install -d %{buildroot}%{_localstatedir}/lib/dhcp
install -d %{buildroot}%{_localstatedir}/lib/dhclient
touch %{buildroot}%{_localstatedir}/lib/dhcp/dhcpd.leases
%clean
[ "%{buildroot}" != / ] && rm -rf "%{buildroot}"
%preun server
# erase
if [ $1 -eq 0 ]; then
service dhcpd stop
/sbin/chkconfig --del dhcpd
fi
:
%postun server
# update
if [ $1 -eq 1 ]; then
/sbin/chkconfig dhcpd
[ $? -eq 0 ] && service dhcpd restart
fi
:
%post client
# Remove "tao" send hostname to fix bug from installations pre <20090705
RANDOM_PASSWORD=`dd if=/dev/urandom count=128 bs=1 2>&1 | md5sum | cut -b-8`
sed -i "/^send host-name \"tao\"/d" %{_sysconfdir}/dhclient.conf
grep "^send host-name" %{_sysconfdir}/dhclient.conf >/dev/null || {
echo "send host-name \"`hostname`-${RANDOM_PASSWORD}\";" \
>> %{_sysconfdir}/dhclient.conf
}
:
%files client
%defattr(-,root,root)
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/dhclient.conf
%{_sysconfdir}/dhclient.conf.example
/sbin/dhclient
/sbin/dhclient-script
%dir %{_localstatedir}/lib/dhclient
%{_mandir}/man5/dhclient*
%{_mandir}/man5/dhcp-*
%{_mandir}/man8/dhclient*
%doc LICENSE
%files server
%defattr(-,root,root)
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/dhcpd.conf
%attr(644,root,root) %config(noreplace) %{_sysconfdir}/sysconfig/dhcpd
%{_sysconfdir}/dhcpd.conf.example
%attr(755,root,root) %{_initrddir}/dhcpd
%{_bindir}/omshell
/sbin/dhcpd
/sbin/dhcrelay
%dir %{_localstatedir}/lib/dhcp
%config(noreplace) %{_localstatedir}/lib/dhcp/dhcpd.leases
%{_mandir}/man1/omshell.*
%{_mandir}/man5/dhcpd.*
%{_mandir}/man8/dhcpd.*
%{_mandir}/man8/dhcrelay.*
%doc LICENSE README RELNOTES
%doc doc
%files devel
%defattr(-,root,root)
%dir %{_includedir}/dhcpctl
%{_includedir}/dhcpctl/dhcpctl.h
%dir %{_includedir}/isc-dhcp
%{_includedir}/isc-dhcp/*.h
%dir %{_includedir}/omapip
%{_includedir}/omapip/*.h
%{_libdir}/libdhcpctl.a
%{_libdir}/libdst.a
%{_libdir}/libomapi.a
%{_mandir}/man3/*
%changelog
* Tue May 20 2014 Silvan Calarco <silvan.calarco@mambasoft.it> 4.3.0-2mamba
- fix dhcp requests under xen/kvm (http://en.it-usenet.org/thread/1990/300659/)
* Tue Feb 04 2014 Automatic Build System <autodist@mambasoft.it> 4.3.0-1mamba
- automatic version update by autodist
* Wed Sep 11 2013 Automatic Build System <autodist@mambasoft.it> 4.2.5.p1-1mamba
- automatic version update by autodist
* Wed Jul 31 2013 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.5.P1-2mamba
- configure for pid files under /run instead of /var/run
* Tue Mar 26 2013 Automatic Build System <autodist@mambasoft.it> 4.2.5.P1-1mamba
- automatic version update by autodist
* Fri Jan 18 2013 Automatic Build System <autodist@mambasoft.it> 4.2.5-1mamba
- automatic version update by autodist
* Fri Oct 12 2012 Automatic Build System <autodist@mambasoft.it> 4.2.4.P2-1mamba
- automatic version update by autodist
* Thu Aug 16 2012 Automatic Build System <autodist@mambasoft.it> 4.2.4.P1-1mamba
- automatic version update by autodist
* Tue Jun 05 2012 Automatic Build System <autodist@mambasoft.it> 4.2.4-1mamba
- automatic version update by autodist
* Fri Jan 13 2012 Automatic Build System <autodist@mambasoft.it> 4.2.3.P2-1mamba
- automatic version update by autodist
* Sun Dec 18 2011 Automatic Build System <autodist@mambasoft.it> 4.2.3.P1-1mamba
- automatic version update by autodist
* Mon Nov 28 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.3-2mamba
- fixed initscript and default configuration for openmamba
* Sun Oct 23 2011 Automatic Build System <autodist@mambasoft.it> 4.2.3-1mamba
- update to 4.2.3
* Fri Aug 12 2011 Automatic Build System <autodist@mambasoft.it> 4.2.2-1mamba
- update to 4.2.2
* Wed Apr 06 2011 Automatic Build System <autodist@mambasoft.it> 4.2.1.P1-1mamba
- automatic update by autodist
* Thu Mar 03 2011 Automatic Build System <autodist@mambasoft.it> 4.2.1-1mamba
- automatic update by autodist
* Fri Feb 04 2011 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.0.P2-2mamba
- obsolete dhcp-common
- dchp-client: provide /var/lib/dhclient and dhcpclient
- dhcp-client: add send hostname with random suffix in post script when missing
* Mon Dec 13 2010 Automatic Build System <autodist@mambasoft.it> 4.2.0.P2-1mamba
- automatic update by autodist
* Thu Dec 02 2010 Silvan Calarco <silvan.calarco@mambasoft.it> 4.2.0.P1-2mamba
- rebuilt with ipv6 support also to work with NetworkManager (it requires -4 option)
* Wed Nov 03 2010 Automatic Build System <autodist@mambasoft.it> 4.2.0.P1-1mamba
- automatic update to 4.2.0.P1 by autodist
* Wed Sep 29 2010 Automatic Build System <autodist@mambasoft.it> 4.2.0-1mamba
- update to 4.2.0
* Thu Jun 03 2010 Automatic Build System <autodist@mambasoft.it> 4.1.1.P1-1mamba
- update to 4.1.1.P1
* Fri Jan 22 2010 Automatic Build System <autodist@mambasoft.it> 4.1.1-1mamba
- automatic update to 4.1.1 by autodist
* Fri Jul 24 2009 Automatic Build System <autodist@mambasoft.it> 4.1.0p1-1mamba
- automatic update to 4.1.0p1 by autodist
* Sun Jul 05 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.0-3mamba
- dhclient.conf: remove default configuration for send host-name and let dhclient use default value
* Sat Jan 17 2009 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.0-2mamba
- dhclient-script: ping ip from proper interface to test gateway reachability
* Sun Dec 21 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 4.1.0-1mamba
- automatic update to 4.1.0 by autodist
* Mon Jul 07 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 4.0.0-2mamba
- disabled ipv6 support
* Thu Jul 03 2008 Silvan Calarco <silvan.calarco@mambasoft.it> 4.0.0-1mamba
- update to 4.0.0
* Sun Nov 18 2007 Stefano Cotta Ramusino <stefano.cotta@openmamba.org> 3.0.6-1mamba
- update to 3.0.6
* Fri May 25 2007 Silvan Calarco <silvan.calarco@mambasoft.it> 3.0.5-1mamba
- update to 3.0.5
* Thu Jun 15 2006 Davide Madrisan <davide.madrisan@qilinux.it> 3.0.4-2qilnx
- updated dhcpd initscript to fix qibug 24
* Fri May 12 2006 Davide Madrisan <davide.madrisan@qilinux.it> 3.0.4-1qilnx
- update to version 3.0.4 by autospec
- fixed license
* Wed Apr 12 2006 Davide Madrisan <davide.madrisan@qilinux.it> 3.0.3-1qilnx
- update to version 3.0.3 by autospec
* Fri Nov 04 2005 Davide Madrisan <davide.madrisan@qilinux.it> 3.0.2-3qilnx
- p#2 modified
* Thu Nov 03 2005 Davide Madrisan <davide.madrisan@qilinux.it> 3.0.2-2qilnx
- p#2: do not overwrite /etc/resolv.conf when locked
* Mon May 05 2005 Silvan Calarco <silvan.calarco@mambasoft.it> 3.0.2-1qilnx
- make dhclient-script create /etc/resolv.conf even if domain name was not
passed from DHCP server
- make dhclient log less annoying when a interface is looking for a dhcp
server
* Fri Oct 22 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 3.0.1-2qilnx
- added requirement for net-tools
* Sun Jul 18 2004 Silvan Calarco <silvan.calarco@mambasoft.it> 3.0.1-1qilnx
- new version build
* Mon Dec 02 2003 Silvan Calarco <silvan.calarco@mambasoft.it> 3.0pl2-7qilnx
- removed initscript reload (not supported by dhcpd)
* Wed Oct 08 2003 Davide Madrisan <davide.madrisan@qilinuc.it> 3.0p12-6qilnx
- new policies for chkconfig and automatic start/restart of the dhcp service
* Mon Jul 02 2003 Silvan Calarco <silvan.calarco@qinet.it> 3.0pl2-5qilnx
- fixed dhclient.conf send host-name (a ; was missing)
- fixed initscript [ OK ] alignment
* Mon Jun 23 2003 Silvan Calarco <silvan.calarco@qinet.it> 3.0pl2-4qilnx
- fixed dhcclient leases dir
- added new-style post and pre scripts
* Wed May 28 2003 Silvan Calarco <silvan.calarco@qinet.it> 3.0pl2-3qilnx
- added initscripts and configuration
* Wed Apr 16 2003 Luca Tinelli <luca.tinelli@qinet.it>
- modified description
* Tue Apr 15 2003 Luca Tinelli <luca.tinelli@qinet.it>
- first build