--- /dev/null
+# Copyright © 2018 Nick Bowler
+# License GPLv3+: GNU General Public License version 3 or later.
+# There is NO WARRANTY, to the extent permitted by law.
+
+EAPI=6
+
+inherit autotools
+
+MY_PN=ypbind-mt
+MY_P=$MY_PN-$PV
+
+DESCRIPTION="NIS binding service (ypbind-mt)"
+HOMEPAGE="https://www.thkukuk.de/nis/nis/ypbind-mt/"
+SRC_URI="http://www.thkukuk.de/nis/download/$MY_PN/$MY_P.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="dbus nls slp systemd"
+
+LIBDEPEND="slp? ( net-libs/openslp )
+ dbus? ( dev-libs/dbus-glib )
+ systemd? ( sys-apps/systemd:= )"
+DEPEND="virtual/pkgconfig
+ <sys-libs/glibc-2.26
+ nls? ( sys-devel/gettext )
+ $LIBDEPEND"
+RDEPEND="net-nds/yp-tools
+ net-nds/rpcbind
+ $LIBDEPEND"
+
+PATCHES=("$FILESDIR/$P-fix-systemd-configuration.patch"
+ "$FILESDIR/$P-avoid-autopoint.patch"
+ "$FILESDIR/$P-flexible-bindingdir.patch")
+
+S=$WORKDIR/$MY_P
+
+src_prepare() {
+ default
+
+ eautoreconf
+}
+
+src_configure() {
+ local pidfile=${EPREFIX%/}/run/$PN.pid
+ local bindingdir=${EPREFIX%/}/var/yp/binding
+ local my_cppflags=("-D_YPBIND_PIDFILE=\\\"$pidfile\\\""
+ "-DBINDINGDIR=\\\"$bindingdir\\\"")
+
+ sed -f - "$FILESDIR/ypbind.initd" >ypbind.initd <<EOF || die
+/^prefix=/c\
+prefix=${EPREFIX}
+EOF
+
+ local myconf=($(use_enable nls) $(use_with systemd)
+ $(use_enable dbus dbus-nm) $(use_enable slp))
+ econf CPPFLAGS="${my_cppflags[*]}" "${myconf[@]}"
+}
+
+src_install() {
+ default
+
+ dodoc etc/yp.conf
+ newinitd ypbind.initd ypbind
+}