summaryrefslogtreecommitdiff
blob: f0044e8383317d06794a07b53725fd465b49f889 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Copyright 1999-2008 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcpcd/dhcpcd-3.1.5-r1.ebuild,v 1.3 2008/01/10 09:15:26 vapier Exp $

inherit toolchain-funcs

DESCRIPTION="A DHCP client"
HOMEPAGE="http://dhcpcd.berlios.de"
SRC_URI="http://download.berlios.de/${PN}/${P}.tar.bz2"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="alpha amd64 arm hppa ia64 mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
IUSE="vram"

DEPEND=""
PROVIDE="virtual/dhcpc"

src_unpack() {
	unpack ${A}
	cd "${S}"

	# Redefine the location of ntp.drift
	{
		echo
		echo "/* Gentoo stores ntpd drift file here */"
		echo "#undef NTPDRIFTFILE"
		echo "#define NTPDRIFTFILE \"/var/lib/ntp/ntp.drift\""
	} >> config.h

	# Disable DUID support if we have volatile storage.
	# LiveCD's *should* enable this USE flag
	if use vram; then
		einfo "Disabling DUID support in dhcpcd"
		{
			echo
			echo "/* User indicated volatile ram storage */"
			echo "#undef ENABLE_DUID"
		} >> config.h
	else
		einfo "DUID support enabled"
	fi
}

src_compile() {
	emake CC="$(tc-getCC)" CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}" || die
}

src_install() {
	emake DESTDIR="${D}" install || die
	dodoc ChangeLog
}

pkg_postinst() {
	use vram && return 0

	ewarn "You have installed dhcpcd with DUID support."
	einfo "This means that we will generate a DUID in /var/lib/dhcpcd/dhcpcd.duid"
	einfo "This is generated from a MAC address of the card and a timestamp."
	einfo "It will be used in every subsequent DHCP transaction, along with a IAID"
	einfo "in the ClientID option. This is required by RFC 4361."
	echo
	ewarn "Some DHCP server implementations require a MAC address only in the"
	ewarn "ClientID field. These DHCP servers should be updated to be RFC"
	ewarn "conformant. If you cannot do this, you can revert to the old"
	ewarn "behaviour by using the -I '' option OR building dhcpcd with the"
	ewarn "vram USE flag enabled."
}