1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 AUTOTOOLS_AUTORECONF=true
8 AUTOTOOLS_IN_SOURCE_BUILD=true
10 inherit autotools-utils linux-info multilib systemd toolchain-funcs
13 [[ -n ${PATCH_VER} ]] && \
14 PATCHSET_URI="https://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
16 DESCRIPTION="Kernel based automounter"
17 HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
19 mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.xz
24 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
25 IUSE="-dmalloc hesiod ldap libtirpc mount-locking sasl"
27 # USE="sasl" adds SASL support to the LDAP module which will not be build. If
28 # SASL support should be available, please add "ldap" to the USE flags.
29 REQUIRED_USE="sasl? ( ldap )"
31 # currently, sasl code assumes the presence of kerberosV
32 RDEPEND=">=sys-apps/util-linux-2.20
33 dmalloc? ( dev-libs/dmalloc[threads] )
34 hesiod? ( net-dns/hesiod )
35 ldap? ( >=net-nds/openldap-2.0
42 libtirpc? ( net-libs/libtirpc )"
48 CONFIG_CHECK="~AUTOFS4_FS"
52 if [[ -n ${PATCH_VER} ]]; then
53 EPATCH_SUFFIX="patch" \
54 epatch "${WORKDIR}"/patches
57 sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
58 autotools-utils_src_prepare
64 # --with-confdir is for bug #361481
65 # --with-mapdir is for bug #385113
67 --with-confdir=/etc/conf.d
68 --with-mapdir=/etc/autofs
70 $(use_with ldap openldap)
74 $(use_enable mount-locking)
76 --enable-sloppy-mount # bug #453778
77 --enable-force-shutdown
79 --with-systemd="$(systemd_get_unitdir)" #bug #479492
80 RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
82 autotools-utils_src_configure
86 autotools-utils_src_compile DONTSTRIP=1
90 autotools-utils_src_install
92 if kernel_is -lt 2 6 30; then
95 dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
97 newinitd "${FILESDIR}"/autofs5.initd autofs
99 newins "${FILESDIR}"/autofs5-auto.master auto.master
103 if kernel_is -lt 2 6 30; then
104 elog "This version of ${PN} requires a kernel with autofs4 supporting"
105 elog "protocol version 5.00. Patches for kernels older than 2.6.30 have"
106 elog "been installed into"
107 elog "${EROOT}usr/share/doc/${P}/patches."
108 elog "For further instructions how to patch the kernel, please refer to"
109 elog "${EROOT}usr/share/doc/${P}/INSTALL."
112 elog "If you plan on using autofs for automounting remote NFS mounts,"
113 elog "please check that both portmap (or rpcbind) and rpc.statd/lockd"