# Copyright 1999-2011 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit eutils multilib autotools PATCH_VER="2" DESCRIPTION="Kernel based automounter" HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html" SRC_URI="mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.bz2 http://home.arcor.de/dpolke/distfiles/${P}-patches-${PATCH_VER}.tar.lzma" # mirror://gentoo/${P}-patches-${PATCH_VER}.tar.lzma" LICENSE="GPL-2" SLOT="0" KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86" IUSE="hesiod ldap sasl" # currently, sasl code assumes the presence of kerberosV RDEPEND="hesiod? ( net-dns/hesiod ) ldap? ( >=net-nds/openldap-2.0 sasl? ( dev-libs/cyrus-sasl dev-libs/libxml2 virtual/krb5 ) )" DEPEND="${RDEPEND} || ( app-arch/xz-utils app-arch/lzma-utils )" src_prepare() { # Upstream's patchset EPATCH_SUFFIX="patch" \ epatch "${WORKDIR}"/patches # Fix for bug #210762 # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/4203 epatch "${FILESDIR}"/${PN}-5.0.3-heimdal.patch # Accumulated fixes for bugs # #154797: Respect CC and CFLAGS # #253412: Respect LDFLAGS # #247969: Link order for --as-needed epatch "${FILESDIR}"/${P}-respect-user-flags-and-fix-asneeded.patch # do not include , rather , # as the former is a lame header for the latter (bug #157968) sed 's@nfs/nfs.h@linux/nfs.h@' -i include/rpc_subs.h || die # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5591 epatch "${FILESDIR}"/${P}-fix-building-without-sasl.patch # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5371 epatch "${FILESDIR}"/${P}-fix-install-deadlink.patch # Fix for bug #340761 # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5853 epatch "${FILESDIR}"/${P}-fix-prune-cache-valid-check.patch eautoreconf } src_configure() { local myconf="" if use sasl && ! use ldap; then ewarn "USE=\"sasl\" adds SASL support to the LDAP module" ewarn "which will not be build. If SASL support should be" ewarn "available, please add \"ldap\" to the USE flags." myconf="--with-openldap=no --with-sasl=no" epause 5 else myconf="$(use_with ldap openldap) $(use_with sasl)" fi econf \ ${myconf} \ $(use_with hesiod) \ --enable-ignore-busy } src_install() { make DESTDIR="${D}" install || die dodoc README* CHANGELOG CREDITS COPYRIGHT INSTALL || die # kernel patches docinto patches dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch || die newinitd "${FILESDIR}"/autofs5.initd autofs || die } pkg_postinst() { elog "Note: This version of ${PN} requires a kernel" elog "with autofs4 supporting protocol version 5.00." elog "Patches for kernels older than 2.6.30 have" elog "been installed into" elog "${ROOT}/usr/share/doc/${P}/patches." elog "For further instructions how to patch the" elog "kernel, please refer to" elog "${ROOT}/usr/share/doc/${P}/INSTALL." elog "" elog "Note: If you plan on using autofs for automounting" elog "remote NFS mounts without having the NFS daemon" elog "running, please add portmap or rpcbind and rpc.statd" elog "to your default run-level." }