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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Thu Jul 2 16:26:13 2015 UTC (4 years, 5 months ago) by williamh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.10: +1 -1 lines
FILE REMOVED
remove all old versions

(Portage version: 2.2.18/cvs/Linux x86_64, signed Manifest commit with key 0x30C46538)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/dhcpcd/dhcpcd-6.6.7.ebuild,v 1.10 2015/05/24 18:21:01 mattst88 Exp $
4
5 EAPI=5
6
7 if [[ ${PV} == "9999" ]]; then
8 FOSSIL_URI="http://roy.marples.name/projects/dhcpcd"
9 else
10 MY_P="${P/_alpha/-alpha}"
11 MY_P="${MY_P/_beta/-beta}"
12 MY_P="${MY_P/_rc/-rc}"
13 SRC_URI="http://roy.marples.name/downloads/${PN}/${MY_P}.tar.bz2"
14 KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux"
15 S="${WORKDIR}/${MY_P}"
16 fi
17
18 inherit eutils systemd toolchain-funcs
19
20 DESCRIPTION="A fully featured, yet light weight RFC2131 compliant DHCP client"
21 HOMEPAGE="http://roy.marples.name/projects/dhcpcd/"
22 LICENSE="BSD-2"
23 SLOT="0"
24 IUSE="elibc_glibc ipv6 kernel_linux +udev"
25
26 COMMON_DEPEND="udev? ( virtual/udev )"
27 DEPEND="${COMMON_DEPEND}"
28 RDEPEND="${COMMON_DEPEND}"
29
30 if [[ ${PV} == "9999" ]]; then
31 DEPEND+=" dev-vcs/fossil"
32
33 src_unpack()
34 {
35 local distdir=${PORTAGE_ACTUAL_DISTDIR:-${DISTDIR}}
36 local repo=${distdir}/fossil/${PN}.fossil
37
38 addwrite "${distdir}"
39
40 if [[ -e "${repo}" ]]; then
41 fossil pull "${FOSSIL_URI}" -R "${repo}" || die
42 else
43 mkdir -p "${distdir}/fossil" || die
44 fossil clone "${FOSSIL_URI}" "${repo}" || die
45 fi
46
47 mkdir -p "${S}" || die
48 cd "${S}" || die
49 fossil open "${repo}" || die
50 }
51 fi
52
53 src_prepare()
54 {
55 epatch_user
56 }
57
58 src_configure()
59 {
60 local dev hooks rundir
61 use udev || dev="--without-dev --without-udev"
62 hooks="--with-hook=ntp.conf"
63 use elibc_glibc && hooks="${hooks} --with-hook=yp.conf"
64 use kernel_linux && rundir="--rundir=${EPREFIX}/run"
65 econf \
66 --prefix="${EPREFIX}" \
67 --libexecdir="${EPREFIX}/lib/dhcpcd" \
68 --dbdir="${EPREFIX}/var/lib/dhcpcd" \
69 --localstatedir="${EPREFIX}/var" \
70 ${rundir} \
71 $(use_enable ipv6) \
72 ${dev} \
73 CC="$(tc-getCC)" \
74 ${hooks}
75 }
76
77 src_install()
78 {
79 default
80 newinitd "${FILESDIR}"/${PN}.initd ${PN}
81 systemd_dounit "${FILESDIR}"/${PN}.service
82 }
83
84 pkg_postinst()
85 {
86 # Upgrade the duid file to the new format if needed
87 local old_duid="${ROOT}"/var/lib/dhcpcd/dhcpcd.duid
88 local new_duid="${ROOT}"/etc/dhcpcd.duid
89 if [ -e "${old_duid}" ] && ! grep -q '..:..:..:..:..:..' "${old_duid}"; then
90 sed -i -e 's/\(..\)/\1:/g; s/:$//g' "${old_duid}"
91 fi
92
93 # Move the duid to /etc, a more sensible location
94 if [ -e "${old_duid}" -a ! -e "${new_duid}" ]; then
95 cp -p "${old_duid}" "${new_duid}"
96 fi
97
98 if [ -z "$REPLACING_VERSIONS" ]; then
99 elog
100 elog "dhcpcd has zeroconf support active by default."
101 elog "This means it will always obtain an IP address even if no"
102 elog "DHCP server can be contacted, which will break any existing"
103 elog "failover support you may have configured in your net configuration."
104 elog "This behaviour can be controlled with the noipv4ll configuration"
105 elog "file option or the -L command line switch."
106 elog "See the dhcpcd and dhcpcd.conf man pages for more details."
107
108 elog
109 elog "Dhcpcd has duid enabled by default, and this may cause issues"
110 elog "with some dhcp servers. For more information, see"
111 elog "https://bugs.gentoo.org/show_bug.cgi?id=477356"
112 fi
113
114 if ! has_version net-dns/bind-tools; then
115 elog
116 elog "If you activate the lookup-hostname hook to look up your hostname"
117 elog "using the dns, you need to install net-dns/bind-tools."
118 fi
119 }

  ViewVC Help
Powered by ViewVC 1.1.20