/[gentoo-x86]/net-misc/dhcpcd/dhcpcd-4.0.2.ebuild
Gentoo

Contents of /net-misc/dhcpcd/dhcpcd-4.0.2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (hide annotations) (download)
Sat Feb 7 14:38:08 2009 UTC (5 years, 7 months ago) by armin76
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
arm/ia64/s390/sh/sparc stable wrt #254812, remove old
(Portage version: 2.1.6.4/cvs/Linux 2.6.26-gentoo-r2 ia64)

1 darkside 1.10 # Copyright 1999-2009 Gentoo Foundation
2 robbat2 1.1 # Distributed under the terms of the GNU General Public License v2
3 armin76 1.11 # $Header: /var/cvsroot/gentoo-x86/net-misc/dhcpcd/dhcpcd-4.0.2.ebuild,v 1.10 2009/01/08 01:39:08 darkside Exp $
4 robbat2 1.1
5     EAPI=1
6    
7     inherit toolchain-funcs 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 darkside 1.10 DESCRIPTION="A fully featured, yet light weight RFC2131 compliant DHCP client"
15 robbat2 1.1 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 vapier 1.9 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd"
20 robbat2 1.1
21     SLOT="0"
22     IUSE="+compat zeroconf"
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     if use compat; then
41     elog "dhcpcd-3 command line support enabled"
42     {
43     echo
44     echo "/* User indicated command line compatability */"
45     echo "#define CMDLINE_COMPAT"
46     } >> config.h
47     fi
48     }
49    
50     pkg_setup() {
51     MAKE_ARGS="DBDIR=/var/lib/dhcpcd LIBEXECDIR=/lib/dhcpcd"
52     }
53    
54     src_compile() {
55     [ -z "${MAKE_ARGS}" ] && die "MAKE_ARGS is empty"
56     emake CC="$(tc-getCC)" ${MAKE_ARGS} || die
57     }
58    
59     src_install() {
60     local hooks="50-ntp.conf"
61     use elibc_glibc && hooks="${hooks} 50-yp.conf"
62     emake ${MAKE_ARGS} HOOKSCRIPTS="${hooks}" DESTDIR="${D}" install || die
63     }
64    
65     pkg_postinst() {
66     # Upgrade the duid file to the new format if needed
67     local old_duid="${ROOT}"/var/lib/dhcpcd/dhcpcd.duid
68     local new_duid="${ROOT}"/etc/dhcpcd.duid
69     if [ -e "${old_duid}" ] && ! grep -q '..:..:..:..:..:..' "${old_duid}"; then
70     sed -i -e 's/\(..\)/\1:/g; s/:$//g' "${old_duid}"
71     fi
72    
73     # Move the duid to /etc, a more sensible location
74     if [ -e "${old_duid}" -a ! -e "${new_duid}" ]; then
75     cp -p "${old_duid}" "${new_duid}"
76     fi
77    
78     if use zeroconf; then
79     elog "You have installed dhcpcd with zeroconf support."
80     elog "This means that it will always obtain an IP address even if no"
81     elog "DHCP server can be contacted, which will break any existing"
82     elog "failover support you may have configured in your net configuration."
83     elog "This behaviour can be controlled with the -L flag."
84     elog "See the dhcpcd man page for more details."
85     fi
86     }

  ViewVC Help
Powered by ViewVC 1.1.20