blob: 3c94e8b3b04555f23797a4c453286843753b396d [file] [log] [blame]
# Copyright 1999-2017 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
EAPI="5"
inherit eutils systemd
if [[ ${PV} == "9999" ]] ; then
EGIT_REPO_URI="git://linux-nfs.org/~steved/rpcbind.git"
inherit autotools git-r3
else
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.bz2"
KEYWORDS="*"
fi
DESCRIPTION="portmap replacement which supports RPC over various protocols"
HOMEPAGE="https://sourceforge.net/projects/rpcbind/"
LICENSE="BSD"
SLOT="0"
IUSE="debug selinux systemd tcpd warmstarts"
CDEPEND=">=net-libs/libtirpc-1.0:=
systemd? ( sys-apps/systemd:= )
tcpd? ( sys-apps/tcp-wrappers )"
DEPEND="${CDEPEND}
virtual/pkgconfig"
RDEPEND="${CDEPEND}
selinux? ( sec-policy/selinux-rpcbind )"
PATCHES=(
"${FILESDIR}/${P}-change-runtime-directory.patch"
"${FILESDIR}/${P}-drop-root-check.patch"
)
src_prepare() {
[[ ${PV} == "9999" ]] && eautoreconf
epatch "${PATCHES[@]}"
epatch_user
}
src_configure() {
econf \
--bindir="${EPREFIX}"/sbin \
--with-statedir="${EPREFIX}"/run/${PN} \
--with-rpcuser=root \
--with-systemdsystemunitdir=$(usex systemd "$(systemd_get_unitdir)" "no") \
$(use_enable tcpd libwrap) \
$(use_enable debug) \
$(use_enable warmstarts)
}
src_install() {
default
newinitd "${FILESDIR}"/${PN}.initd ${PN}
newconfd "${FILESDIR}"/${PN}.confd ${PN}
systemd_dounit "${FILESDIR}"/${PN}.service
insinto /etc/init/
doins "${FILESDIR}/rpcbind.conf"
insinto /usr/share/policy
newins "${FILESDIR}/seccomp-${ARCH}.policy" rpcbind-seccomp.policy
}