summaryrefslogtreecommitdiff
path: root/net-misc/dhcpcd/dhcpcd-9999.ebuild
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-04-12 03:41:30 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-04-12 03:41:30 +0100
commit623ee73d661e5ed8475cb264511f683407d87365 (patch)
tree993eb27c93ec7a2d2d19550300d888fc1fed9e69 /net-misc/dhcpcd/dhcpcd-9999.ebuild
parentceeeb463cc1eef97fd62eaee8bf2196ba04bc384 (diff)
gentoo Easter resync : 12.04.2020
Diffstat (limited to 'net-misc/dhcpcd/dhcpcd-9999.ebuild')
-rw-r--r--net-misc/dhcpcd/dhcpcd-9999.ebuild36
1 files changed, 32 insertions, 4 deletions
diff --git a/net-misc/dhcpcd/dhcpcd-9999.ebuild b/net-misc/dhcpcd/dhcpcd-9999.ebuild
index e83bb217a35a..9656eabee928 100644
--- a/net-misc/dhcpcd/dhcpcd-9999.ebuild
+++ b/net-misc/dhcpcd/dhcpcd-9999.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -13,7 +13,7 @@ else
MY_P="${MY_P/_beta/-beta}"
MY_P="${MY_P/_rc/-rc}"
SRC_URI="https://roy.marples.name/downloads/${PN}/${MY_P}.tar.xz"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux"
S="${WORKDIR}/${MY_P}"
fi
@@ -21,11 +21,17 @@ DESCRIPTION="A fully featured, yet light weight RFC2131 compliant DHCP client"
HOMEPAGE="https://roy.marples.name/projects/dhcpcd"
LICENSE="BSD-2"
SLOT="0"
-IUSE="debug elibc_glibc +embedded ipv6 kernel_linux +udev"
+IUSE="debug elibc_glibc +embedded ipv6 kernel_linux +privsep +udev"
COMMON_DEPEND="udev? ( virtual/udev )"
DEPEND="${COMMON_DEPEND}"
-RDEPEND="${COMMON_DEPEND}"
+RDEPEND="
+ ${COMMON_DEPEND}
+ privsep? (
+ acct-group/dhcpcd
+ acct-user/dhcpcd
+ )
+"
src_configure() {
local myeconfargs=(
@@ -37,8 +43,10 @@ src_configure() {
$(use_enable debug)
$(use_enable embedded)
$(use_enable ipv6)
+ $(use_enable privsep)
$(usex elibc_glibc '--with-hook=yp.conf' '')
$(usex kernel_linux '--rundir=${EPREFIX}/run' '')
+ $(usex privsep '--privsepuser=dhcpcd' '')
$(usex udev '' '--without-dev --without-udev')
CC="$(tc-getCC)"
)
@@ -105,6 +113,26 @@ pkg_postinst() {
cp "${lease}" "${dbdir}/${new_lease}"
done
+ # dhcpcd-9 introduced privesep support in a chroot
+ if use privsep ; then
+ local dhcpcd_libdir="/var/lib/dhcpcd"
+ local chroot_base="${EROOT}/var/chroot/dhcpcd"
+ local chroot_dir="${chroot_base}${dhcpcd_libdir}"
+ local chroot_retval=0
+ # Set up proper chroot.
+ if [[ ! -e "${chroot_dir}" ]] ; then
+ mkdir -p "${chroot_dir}" || chroot_retval=1
+ cp -a "${EROOT}${dhcpcd_libdir}" "${chroot_dir}" || chroot_retval=1
+ chown -R dhcpcd:dhcpcd "${chroot_dir}" || chroot_retval=1
+ elif [[ ! -d "${chroot_dir}" ]] ; then
+ ewarn "${chroot_dir} is not a directory!"
+ ewarn "Did not set up ${PN} chroot!"
+ fi
+ if [[ "${chroot_retval}" -ne 0 ]] ; then
+ ewarn "There were issues setting up ${PN} chroot."
+ fi
+ fi
+
# Warn about removing stale files
if [[ -n "${old_files[@]}" ]] ; then
elog