summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-08-27 15:41:50 +0000
committerMike Frysinger <vapier@gentoo.org>2011-08-27 15:41:50 +0000
commitd7718e3c539334117ad9d549456af8071a328f51 (patch)
treece330b6794b00f8ca0ef702012945d458fa30fca
parentStable for HPPA (bug #372593). (diff)
downloadhistorical-d7718e3c539334117ad9d549456af8071a328f51.tar.gz
historical-d7718e3c539334117ad9d549456af8071a328f51.tar.bz2
historical-d7718e3c539334117ad9d549456af8071a328f51.zip
Fix up some bad paths to conf/run files #380829 by Agostino Sarubbo.
Package-Manager: portage-2.2.0_alpha51/cvs/Linux x86_64
-rw-r--r--net-misc/dhcp/ChangeLog7
-rw-r--r--net-misc/dhcp/Manifest13
-rw-r--r--net-misc/dhcp/dhcp-4.2.2-r1.ebuild260
3 files changed, 278 insertions, 2 deletions
diff --git a/net-misc/dhcp/ChangeLog b/net-misc/dhcp/ChangeLog
index b249409203d6..6e18b298ca50 100644
--- a/net-misc/dhcp/ChangeLog
+++ b/net-misc/dhcp/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for net-misc/dhcp
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.183 2011/08/27 04:58:56 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/ChangeLog,v 1.184 2011/08/27 15:41:50 vapier Exp $
+
+*dhcp-4.2.2-r1 (27 Aug 2011)
+
+ 27 Aug 2011; Mike Frysinger <vapier@gentoo.org> +dhcp-4.2.2-r1.ebuild:
+ Fix up some bad paths to conf/run files #380829 by Agostino Sarubbo.
27 Aug 2011; Mike Frysinger <vapier@gentoo.org> dhcp-4.2.2.ebuild,
+files/dhcp-4.2.2-bind-build-flags.patch,
diff --git a/net-misc/dhcp/Manifest b/net-misc/dhcp/Manifest
index c154dc3b9571..60f32f3c0575 100644
--- a/net-misc/dhcp/Manifest
+++ b/net-misc/dhcp/Manifest
@@ -1,3 +1,6 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA256
+
AUX dhcp-3.0-fix-perms.patch 485 RMD160 3857270dffed5feee95609aeb37d0c9ef8844945 SHA1 1217265a8a7f1416b781e9f79e8dfb8304268e6c SHA256 a805a60b36e148886887aebb797e80f642386b3e55ef4a0b5132f96a2877e018
AUX dhcp-3.0-paranoia.patch 5366 RMD160 7c64e3dac5b07ff3859fcaa7a8b0e52a0c50446c SHA1 a30103c138e480766f84644fffb1d0897709c27d SHA256 a8db9eb98397a9c1b3a0de07fc107c39dc4f6a4a331d404fc6fcc4a8dbc7aeae
AUX dhcp-3.0.2-gmake.patch 1872 RMD160 d2d41c0a7e002103d68605d2492bfe716bb2889e SHA1 f60c89233f06ca8554cd5cc9ed0301b597a724f7 SHA256 b2bbfc1d1f5b4d03ff3f53b3974ec32731e5f626de8f8d127328591e4c721215
@@ -38,6 +41,14 @@ DIST dhcp-4.2.2.tar.gz 8764108 RMD160 a7d0a66a6156cc2194a784b120587ffd5e8e200e S
EBUILD dhcp-3.1.2_p1.ebuild 7582 RMD160 d7f42417b80f9f17e0c8c217c978707506802a22 SHA1 be9987191d730c6065c74fc8c9e8835e5d229561 SHA256 4ebe414e6dc4ce6f6b9ebf4f0bfd44b6af03330ff48c39ad7c9987ac1cae624f
EBUILD dhcp-3.1.3_p1.ebuild 7741 RMD160 62ef4cf524beadef2847675416ea5982f23a3f8e SHA1 3995b5c53d6b11fde440cf43c0dacac31f084d72 SHA256 7a71c86e1685858826a09f28dff77d69a98ec1d37c93bbb6e4dd216af00ce96c
EBUILD dhcp-4.2.1_p1.ebuild 6610 RMD160 0d058e755de185a58fc62a3d047021671de9a54a SHA1 5cf96d94250ba44b3120ae6a961c04e4f01996b5 SHA256 70534d654d5a2d02ea009d87f77bf86724ee94b7587f5b6959eef90475e5062a
+EBUILD dhcp-4.2.2-r1.ebuild 7690 RMD160 860df856e851e6e42e88efbe90df84c3b91be3be SHA1 6419f2c216bb72334249ff156a763bdf21a3179e SHA256 afe394e0d037a73c92743620125cd9eec794965f23c858018bb0333ede742f9c
EBUILD dhcp-4.2.2.ebuild 7474 RMD160 a80b1fb2eb31ba8dc20f9d6fb914e37a5cf12174 SHA1 089b6bb9e87f07c950d7ee4261e081ba59f29fa5 SHA256 9f15f5b2d35d9ff4372250886f3751b94abb0fbebc99ea4d16e5abd74ccf9755
-MISC ChangeLog 31497 RMD160 d5f79f68712e5af8fe28745b0fecaaff1fb2e84f SHA1 f8a19a8decb657f8be3324b1067379300664a742 SHA256 aa39bdd6f705d61655db71dc08a28692f92b6bd695ca603a120c16b2b1e74fda
+MISC ChangeLog 31672 RMD160 7722280ac44f1a37bf93b58b4c87414edda5f052 SHA1 d3bb2f4c1950ba7d9690511abe16f52f7f6bd3e8 SHA256 6b337ac01f18229f43e99a90d89dfd1b40e505baf6afd547c6563bbda8ee3934
MISC metadata.xml 500 RMD160 b5ad909ab2b12acd20e78039e33fda0a27383c9e SHA1 2fc5cee8e105e75a251195254c96085a0f3fa9a3 SHA256 e9e4edcf7671391ee2f2af0917a75fc07883f1401aaa22b72dd0133bef81601c
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.17 (GNU/Linux)
+
+iF4EAREIAAYFAk5ZEDUACgkQaC/OocHi7Jb29gD8D6sOTj++1Ho7tkJT6kc3GgHQ
+N2z368EHEb6gWvsb7UwA/2FOg/cHHi4Rljc7gNSdok7N4Wfxk3o1N+B+lgXqswuQ
+=WsjR
+-----END PGP SIGNATURE-----
diff --git a/net-misc/dhcp/dhcp-4.2.2-r1.ebuild b/net-misc/dhcp/dhcp-4.2.2-r1.ebuild
new file mode 100644
index 000000000000..55f86bec7db3
--- /dev/null
+++ b/net-misc/dhcp/dhcp-4.2.2-r1.ebuild
@@ -0,0 +1,260 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcp/dhcp-4.2.2-r1.ebuild,v 1.1 2011/08/27 15:41:50 vapier Exp $
+
+EAPI="2"
+
+inherit eutils toolchain-funcs
+
+MY_PV="${PV//_alpha/a}"
+MY_PV="${MY_PV//_beta/b}"
+MY_PV="${MY_PV//_rc/rc}"
+MY_PV="${MY_PV//_p/-P}"
+MY_P="${PN}-${MY_PV}"
+DESCRIPTION="ISC Dynamic Host Configuration Protocol (DHCP) client/server"
+HOMEPAGE="http://www.isc.org/products/DHCP"
+SRC_URI="ftp://ftp.isc.org/isc/dhcp/${MY_P}.tar.gz"
+
+LICENSE="as-is BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="+client ipv6 kernel_linux ldap selinux +server ssl vim-syntax"
+
+DEPEND="selinux? ( sec-policy/selinux-dhcp )
+ kernel_linux? ( sys-apps/net-tools )
+ vim-syntax? ( app-vim/dhcpd-syntax )
+ ldap? (
+ net-nds/openldap
+ ssl? ( dev-libs/openssl )
+ )"
+RDEPEND="${DEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+src_unpack() {
+ unpack ${A}
+ # handle local bind hell
+ cd "${S}"/bind
+ unpack ./bind.tar.gz
+}
+
+src_prepare() {
+ # Gentoo patches - these will probably never be accepted upstream
+ # Fix some permission issues
+ epatch "${FILESDIR}"/${PN}-3.0-fix-perms.patch
+ # Enable dhclient to equery NTP servers
+ epatch "${FILESDIR}"/${PN}-4.0-dhclient-ntp.patch
+ # resolvconf support in dhclient-script
+ epatch "${FILESDIR}"/${PN}-4.2.2-dhclient-resolvconf.patch
+ # Stop downing the interface on Linux as that breaks link daemons
+ # such as wpa_supplicant and netplug
+ epatch "${FILESDIR}"/${PN}-3.0.3-dhclient-no-down.patch
+ epatch "${FILESDIR}"/${PN}-4.2.0-errwarn-message.patch
+ # Enable dhclient to get extra configuration from stdin
+ epatch "${FILESDIR}"/${PN}-4.2.2-dhclient-stdin-conf.patch
+ epatch "${FILESDIR}"/${PN}-4.2.2-nogateway.patch #265531
+
+ # NetworkManager support patches
+ # If they fail to apply to future versions they will be dropped
+ # Add dbus support to dhclient
+ epatch "${FILESDIR}"/${PN}-3.0.3-dhclient-dbus.patch
+
+ # Brand the version with Gentoo
+ sed -i \
+ -e "/VERSION=/s:'$: Gentoo-${PR}':" \
+ configure || die
+
+ # Change the hook script locations of the scripts
+ sed -i \
+ -e 's,/etc/dhclient-exit-hooks,/etc/dhcp/dhclient-exit-hooks,g' \
+ -e 's,/etc/dhclient-enter-hooks,/etc/dhcp/dhclient-enter-hooks,g' \
+ client/scripts/* || die
+
+ # No need for the linux script to force bash #158540
+ sed -i -e 's,#!/bin/bash,#!/bin/sh,' client/scripts/linux || die
+
+ # Quiet the freebsd logger a little
+ sed -i -e '/LOGGER=/ s/-s -p user.notice //g' client/scripts/freebsd || die
+
+ # Remove these options from the sample config
+ sed -i \
+ -e "/\(script\|host-name\|domain-name\) / d" \
+ client/dhclient.conf || die
+
+ if use client && ! use server ; then
+ sed -i -r \
+ -e '/^SUBDIRS/s:\<(dhcpctl|relay|server)\>::g' \
+ Makefile.in || die
+ elif ! use client && use server ; then
+ sed -i -r \
+ -e '/^SUBDIRS/s:\<client\>::' \
+ Makefile.in || die
+ fi
+
+ # Only install different man pages if we don't have en
+ if [[ " ${LINGUAS} " != *" en "* ]]; then
+ # Install Japanese man pages
+ if [[ " ${LINGUAS} " == *" ja "* && -d doc/ja_JP.eucJP ]]; then
+ einfo "Installing Japanese documention"
+ cp doc/ja_JP.eucJP/dhclient* client
+ cp doc/ja_JP.eucJP/dhcp* common
+ fi
+ fi
+ # Now remove the non-english docs so there are no errors later
+ rm -rf doc/ja_JP.eucJP
+
+ # make the bind build work
+ binddir=${S}/bind
+ cd "${binddir}" || die
+ cat <<-EOF > bindvar.tmp
+ binddir=${binddir}
+ GMAKE=${MAKE:-gmake}
+ EOF
+ epatch "${FILESDIR}"/${PN}-4.2.2-bind-disable.patch
+ cd bind-*/
+ epatch "${FILESDIR}"/${PN}-4.2.2-bind-parallel-build.patch #380717
+ epatch "${FILESDIR}"/${PN}-4.2.2-bind-build-flags.patch
+}
+
+src_configure() {
+ # bind defaults to stupid `/usr/bin/ar`
+ tc-export AR BUILD_CC
+ export ac_cv_path_AR=${AR}
+
+ # Use FHS sane paths ... some of these have configure options,
+ # but not all, so just do it all here.
+ local e="/etc/dhcp" r="/var/run/dhcp" l="/var/lib/dhcp"
+ cat <<-EOF >> includes/site.h
+ #define _PATH_DHCPD_CONF "${e}/dhcpd.conf"
+ #define _PATH_DHCLIENT_CONF "${e}/dhclient.conf"
+ #define _PATH_DHCPD_DB "${l}/dhcpd.leases"
+ #define _PATH_DHCPD6_DB "${l}/dhcpd6.leases"
+ #define _PATH_DHCLIENT_DB "${l}/dhclient.leases"
+ #define _PATH_DHCLIENT6_DB "${l}/dhclient6.leases"
+ #define _PATH_DHCPD_PID "${r}/dhcpd.pid"
+ #define _PATH_DHCPD6_PID "${r}/dhcpd6.pid"
+ #define _PATH_DHCLIENT_PID "${r}/dhcpclient.pid"
+ #define _PATH_DHCLIENT6_PID "${r}/dhcpclient6.pid"
+ #define _PATH_DHCRELAY_PID "${r}/dhcprelay.pid"
+ #define _PATH_DHCRELAY6_PID "${r}/dhcprelay6.pid"
+ EOF
+
+ econf \
+ --enable-paranoia \
+ --sysconfdir=${e} \
+ $(use_enable ipv6 dhcpv6) \
+ $(use_with ldap) \
+ $(use ldap && use_with ssl ldapcrypto || echo --without-ldapcrypto)
+
+ # configure local bind cruft
+ cd bind/bind-*/ || die
+ eval econf \
+ $(sed -n '/ [.].configure /{s:^[^-]*::;s:>.*::;p}' ../Makefile) \
+ --without-make-clean
+}
+
+src_compile() {
+ # build local bind cruft first
+ emake -C bind/bind-*/lib/export install || die
+ # then build standard dhcp code
+ emake || die
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die
+
+ dodoc README RELNOTES doc/{api+protocol,IANA-arp-parameters}
+ dohtml doc/References.html
+
+ if [[ -e client/dhclient ]] ; then
+ # move the client to /
+ dodir /sbin
+ mv "${D}"/usr/sbin/dhclient "${D}"/sbin/ || die
+
+ exeinto /sbin
+ if use kernel_linux ; then
+ newexe "${S}"/client/scripts/linux dhclient-script || die
+ else
+ newexe "${S}"/client/scripts/freebsd dhclient-script || die
+ fi
+ fi
+
+ if [[ -e server/dhcpd ]] ; then
+ if use ldap ; then
+ insinto /etc/openldap/schema
+ doins contrib/ldap/dhcp.* || die
+ dosbin contrib/ldap/dhcpd-conf-to-ldap || die
+ fi
+
+ newinitd "${FILESDIR}"/dhcpd.init3 dhcpd || die
+ newconfd "${FILESDIR}"/dhcpd.conf dhcpd || die
+ newinitd "${FILESDIR}"/dhcrelay.init2 dhcrelay || die
+ newconfd "${FILESDIR}"/dhcrelay.conf dhcrelay || die
+
+ keepdir /var/{lib,run}/dhcp
+ fi
+}
+
+pkg_preinst() {
+ enewgroup dhcp
+ enewuser dhcp -1 -1 /var/lib/dhcp dhcp
+
+ # Keep the user files over the sample ones
+ local f
+ for f in dhclient dhcpd ; do
+ f="/etc/dhcp/${f}.conf"
+ if [ -e "${ROOT}"${f} ] ; then
+ cp -p "${ROOT}"${f} "${D}"${f}
+ fi
+ done
+}
+
+pkg_postinst() {
+ chown -R dhcp:dhcp "${ROOT}"/var/{lib,run}/dhcp
+
+ if [[ -e "${ROOT}"/etc/init.d/dhcp ]] ; then
+ ewarn
+ ewarn "WARNING: The dhcp init script has been renamed to dhcpd"
+ ewarn "/etc/init.d/dhcp and /etc/conf.d/dhcp need to be removed and"
+ ewarn "and dhcp should be removed from the default runlevel"
+ ewarn
+ fi
+
+ einfo "You can edit /etc/conf.d/dhcpd to customize dhcp settings."
+ einfo
+ einfo "If you would like to run dhcpd in a chroot, simply configure the"
+ einfo "DHCPD_CHROOT directory in /etc/conf.d/dhcpd and then run:"
+ einfo " emerge --config =${PF}"
+}
+
+pkg_config() {
+ local CHROOT="$(
+ sed -n -e 's/^[[:blank:]]\?DHCPD_CHROOT="*\([^#"]\+\)"*/\1/p' \
+ "${ROOT}"/etc/conf.d/dhcpd
+ )"
+
+ if [[ -z ${CHROOT} ]]; then
+ eerror "CHROOT not defined in /etc/conf.d/dhcpd"
+ return 1
+ fi
+
+ CHROOT="${ROOT}/${CHROOT}"
+
+ if [[ -d ${CHROOT} ]] ; then
+ ewarn "${CHROOT} already exists - aborting"
+ return 0
+ fi
+
+ ebegin "Setting up the chroot directory"
+ mkdir -m 0755 -p "${CHROOT}/"{dev,etc,var/lib,var/run/dhcp}
+ cp /etc/{localtime,resolv.conf} "${CHROOT}"/etc
+ cp -R /etc/dhcp "${CHROOT}"/etc
+ cp -R /var/lib/dhcp "${CHROOT}"/var/lib
+ ln -s ../../var/lib/dhcp "${CHROOT}"/etc/dhcp/lib
+ chown -R dhcp:dhcp "${CHROOT}"/var/{lib,run}/dhcp
+ eend 0
+
+ local logger="$(best_version virtual/logger)"
+ einfo "To enable logging from the dhcpd server, configure your"
+ einfo "logger (${logger}) to listen on ${CHROOT}/dev/log"
+}