1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 AUTOTOOLS_AUTORECONF=true
9 inherit autotools-utils linux-info multilib systemd toolchain-funcs
12 [[ -n ${PATCH_VER} ]] && \
13 PATCHSET_URI="https://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
15 DESCRIPTION="Kernel based automounter"
16 HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
18 mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.bz2
23 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
24 IUSE="-dmalloc hesiod ldap libtirpc mount-locking sasl"
26 # USE="sasl" adds SASL support to the LDAP module which will not be build. If
27 # SASL support should be available, please add "ldap" to the USE flags.
28 REQUIRED_USE="sasl? ( ldap )"
30 # currently, sasl code assumes the presence of kerberosV
31 RDEPEND=">=sys-apps/util-linux-2.20
32 dmalloc? ( dev-libs/dmalloc[threads] )
33 hesiod? ( net-dns/hesiod )
34 ldap? ( >=net-nds/openldap-2.0
41 libtirpc? ( net-libs/libtirpc )"
47 CONFIG_CHECK="~AUTOFS4_FS"
51 # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/4203
52 "${FILESDIR}"/${PN}-5.0.3-heimdal.patch
54 # Accumulated fixes for bugs
55 # #154797: Respect CC and CFLAGS
56 # #253412: Respect LDFLAGS
57 # #247969: Link order for --as-needed
58 "${FILESDIR}"/${PN}-5.0.7-respect-user-flags-and-fix-asneeded-r3.patch
60 # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5371
61 "${FILESDIR}"/${PN}-5.0.5-fix-install-deadlink.patch
63 "${FILESDIR}"/${P}-add-missing-endif-HAVE_SASL-in-modules-lookup_ldap.c.patch #361899, #468606
64 "${FILESDIR}"/${PN}-5.0.6-revert-ldap.patch #381315
65 "${FILESDIR}"/${PN}-5.0.7-sasl-def.patch #469324
66 "${FILESDIR}"/${PN}-5.0.7-libtirpc-link.patch #464120
67 "${FILESDIR}"/${PN}-5.0.7-parallel-make.patch
68 "${FILESDIR}"/${PN}-5.0.7-sloppy-mount.patch #545258
71 AUTOTOOLS_IN_SOURCE_BUILD=1
75 if [[ -n ${PATCH_VER} ]]; then
76 EPATCH_SUFFIX="patch" \
77 epatch "${WORKDIR}"/patches
79 sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
80 autotools-utils_src_prepare
86 # --with-confdir is for bug #361481
87 # --with-mapdir is for bug #385113
89 --with-confdir=/etc/conf.d
90 --with-mapdir=/etc/autofs
92 $(use_with ldap openldap)
96 $(use_enable mount-locking)
98 --enable-sloppy-mount # bug #453778
99 --enable-forced-shutdown
102 systemddir="$(systemd_get_unitdir)" #bug #479492
103 RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
105 autotools-utils_src_configure
109 autotools-utils_src_install
111 if kernel_is -lt 2 6 30; then
114 dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
116 newinitd "${FILESDIR}"/autofs5.initd autofs
118 newins "${FILESDIR}"/autofs5-auto.master auto.master
122 if kernel_is -lt 2 6 30; then
123 elog "This version of ${PN} requires a kernel with autofs4 supporting"
124 elog "protocol version 5.00. Patches for kernels older than 2.6.30 have"
125 elog "been installed into"
126 elog "${EROOT}usr/share/doc/${P}/patches."
127 elog "For further instructions how to patch the kernel, please refer to"
128 elog "${EROOT}usr/share/doc/${P}/INSTALL."
131 elog "If you plan on using autofs for automounting remote NFS mounts,"
132 elog "please check that both portmap (or rpcbind) and rpc.statd/lockd"