1 |
# Copyright 1999-2010 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/dhcpcd/dhcpcd-5.1.5.ebuild,v 1.2 2010/03/31 18:03:50 solar Exp $ |
4 |
|
5 |
EAPI=1 |
6 |
|
7 |
inherit eutils |
8 |
|
9 |
MY_P="${P/_alpha/-alpha}" |
10 |
MY_P="${MY_P/_beta/-beta}" |
11 |
MY_P="${MY_P/_rc/-rc}" |
12 |
S="${WORKDIR}/${MY_P}" |
13 |
|
14 |
DESCRIPTION="A fully featured, yet light weight RFC2131 compliant DHCP client" |
15 |
HOMEPAGE="http://roy.marples.name/projects/dhcpcd/" |
16 |
SRC_URI="http://roy.marples.name/downloads/${PN}/${MY_P}.tar.bz2" |
17 |
LICENSE="BSD-2" |
18 |
|
19 |
KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" |
20 |
|
21 |
SLOT="0" |
22 |
IUSE="+zeroconf elibc_glibc" |
23 |
|
24 |
DEPEND="" |
25 |
PROVIDE="virtual/dhcpc" |
26 |
|
27 |
src_unpack() { |
28 |
unpack ${A} |
29 |
cd "${S}" |
30 |
|
31 |
if ! use zeroconf; then |
32 |
elog "Disabling zeroconf support" |
33 |
{ |
34 |
echo |
35 |
echo "# dhcpcd ebuild requested no zeroconf" |
36 |
echo "noipv4ll" |
37 |
} >> dhcpcd.conf |
38 |
fi |
39 |
} |
40 |
|
41 |
src_compile() { |
42 |
local hooks="--with-hook=ntp.conf" |
43 |
use elibc_glibc && hooks="${hooks} --with-hook=yp.conf" |
44 |
econf --prefix= --libexecdir=/lib/dhcpcd --dbdir=/var/lib/dhcpcd \ |
45 |
--localstatedir=/var ${hooks} |
46 |
emake || die |
47 |
} |
48 |
|
49 |
src_install() { |
50 |
emake DESTDIR="${D}" install || die |
51 |
newinitd "${FILESDIR}"/${PN}.initd ${PN} |
52 |
} |
53 |
|
54 |
pkg_postinst() { |
55 |
# Upgrade the duid file to the new format if needed |
56 |
local old_duid="${ROOT}"/var/lib/dhcpcd/dhcpcd.duid |
57 |
local new_duid="${ROOT}"/etc/dhcpcd.duid |
58 |
if [ -e "${old_duid}" ] && ! grep -q '..:..:..:..:..:..' "${old_duid}"; then |
59 |
sed -i -e 's/\(..\)/\1:/g; s/:$//g' "${old_duid}" |
60 |
fi |
61 |
|
62 |
# Move the duid to /etc, a more sensible location |
63 |
if [ -e "${old_duid}" -a ! -e "${new_duid}" ]; then |
64 |
cp -p "${old_duid}" "${new_duid}" |
65 |
fi |
66 |
|
67 |
if use zeroconf; then |
68 |
elog "You have installed dhcpcd with zeroconf support." |
69 |
elog "This means that it will always obtain an IP address even if no" |
70 |
elog "DHCP server can be contacted, which will break any existing" |
71 |
elog "failover support you may have configured in your net configuration." |
72 |
elog "This behaviour can be controlled with the -L flag." |
73 |
elog "See the dhcpcd man page for more details." |
74 |
fi |
75 |
|
76 |
elog |
77 |
elog "Users transfering from 4.0 series should pay attention to removal" |
78 |
elog "of compat useflag. This changes behavior of dhcp in wide manner:" |
79 |
elog "dhcpcd no longer sends a default ClientID for ethernet interfaces." |
80 |
elog "This is so we can re-use the address the kernel DHCP client found." |
81 |
elog "To retain the old behaviour of sending a default ClientID based on the" |
82 |
elog "hardware address for interface, simply add the keyword clientid" |
83 |
elog "to dhcpcd.conf or use commandline parameter -I ''" |
84 |
} |