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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.19 - (show annotations) (download)
Thu Jul 9 13:27:17 2015 UTC (4 years, 4 months ago) by williamh
Branch: MAIN
CVS Tags: HEAD
Changes since 1.18: +3 -3 lines
version bump and sync live ebuild

(Portage version: 2.2.20/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-9999.ebuild,v 1.18 2015/01/30 18:18:34 williamh 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.xz"
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 +embedded 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 embedded) \
72 $(use_enable ipv6) \
73 ${dev} \
74 CC="$(tc-getCC)" \
75 ${hooks}
76 }
77
78 src_install()
79 {
80 default
81 newinitd "${FILESDIR}"/${PN}.initd ${PN}
82 systemd_dounit "${FILESDIR}"/${PN}.service
83 }
84
85 pkg_postinst()
86 {
87 # Upgrade the duid file to the new format if needed
88 local old_duid="${ROOT}"/var/lib/dhcpcd/dhcpcd.duid
89 local new_duid="${ROOT}"/etc/dhcpcd.duid
90 if [ -e "${old_duid}" ] && ! grep -q '..:..:..:..:..:..' "${old_duid}"; then
91 sed -i -e 's/\(..\)/\1:/g; s/:$//g' "${old_duid}"
92 fi
93
94 # Move the duid to /etc, a more sensible location
95 if [ -e "${old_duid}" -a ! -e "${new_duid}" ]; then
96 cp -p "${old_duid}" "${new_duid}"
97 fi
98
99 if [ -z "$REPLACING_VERSIONS" ]; then
100 elog
101 elog "dhcpcd has zeroconf support active by default."
102 elog "This means it will always obtain an IP address even if no"
103 elog "DHCP server can be contacted, which will break any existing"
104 elog "failover support you may have configured in your net configuration."
105 elog "This behaviour can be controlled with the noipv4ll configuration"
106 elog "file option or the -L command line switch."
107 elog "See the dhcpcd and dhcpcd.conf man pages for more details."
108
109 elog
110 elog "Dhcpcd has duid enabled by default, and this may cause issues"
111 elog "with some dhcp servers. For more information, see"
112 elog "https://bugs.gentoo.org/show_bug.cgi?id=477356"
113 fi
114
115 if ! has_version net-dns/bind-tools; then
116 elog
117 elog "If you activate the lookup-hostname hook to look up your hostname"
118 elog "using the dns, you need to install net-dns/bind-tools."
119 fi
120 }

  ViewVC Help
Powered by ViewVC 1.1.20