# Copyright 1999-2010 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ EAPI="2" inherit eutils multilib autotools PATCH_VER="1" 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://78.47.71.153/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 DEPEND="hesiod? ( net-dns/hesiod ) ldap? ( >=net-nds/openldap-2.0 sasl? ( dev-libs/cyrus-sasl dev-libs/libxml2 virtual/krb5 ) )" RDEPEND="${DEPEND}" src_prepare() { EPATCH_SUFFIX="patch" \ epatch "${WORKDIR}"/patches # fixes bug #210762 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 epatch "${FILESDIR}"/${P}-fix-building-without-sasl.patch eautoreconf || die "eautoreconf failed" } src_configure() { local myconf="" if use sasl && ! use ldap; then elog "USE=\"sasl\" adds SASL support to the LDAP module" elog "which will not be build. If SASL support should be" elog "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 \ || die "configure failed" } src_install() { make DESTDIR="${D}" install || die "make install failed" # make DESTDIR="${D}" install_kernel || die "make install failed" # make DESTDIR="${D}" install_samples || die "make install failed" dodoc "${S}"/{README*,CHANGELOG,CREDITS,COPYRIGHT,INSTALL} \ || die "dodoc failed" # kernel patches docinto patches dodoc "${S}"/patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch \ || die "Installing patches failed" newinitd "${FILESDIR}"/autofs5.rc1 autofs } pkg_postinst() { elog "Note: You might need to patch your kernel to use this" elog "version of ${PN}. Upstream kernel patches have been" elog "installed into \"/usr/share/doc/${P}/patches\"." elog "For further instructions, please refer to" elog "\"/usr/share/doc/${P}/README\"." elog "" elog "Note: If you plan on using autofs for automounting" elog "remote NFS mounts without having the NFS daemon running" elog "please add portmap or rpcbind to your default run-level." }