Use https by default
[gentoo.git] / net-fs / autofs / autofs-5.1.1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6
7 AUTOTOOLS_AUTORECONF=true
8 AUTOTOOLS_IN_SOURCE_BUILD=true
9
10 inherit autotools-utils linux-info multilib systemd toolchain-funcs
11
12 PATCH_VER=
13 [[ -n ${PATCH_VER} ]] && \
14         PATCHSET_URI="https://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
15
16 DESCRIPTION="Kernel based automounter"
17 HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
18 SRC_URI="
19         mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.xz
20         ${PATCHSET_URI}"
21
22 LICENSE="GPL-2"
23 SLOT="0"
24 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
25 IUSE="-dmalloc hesiod ldap libtirpc mount-locking sasl"
26
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 )"
30
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
36                 sasl? (
37                         dev-libs/cyrus-sasl
38                         dev-libs/libxml2
39                         virtual/krb5
40                 )
41         )
42         libtirpc? ( net-libs/libtirpc )"
43
44 DEPEND="${RDEPEND}
45         sys-devel/flex
46         virtual/yacc"
47
48 CONFIG_CHECK="~AUTOFS4_FS"
49
50 src_prepare() {
51         # Upstream's patchset
52         if [[ -n ${PATCH_VER} ]]; then
53                 EPATCH_SUFFIX="patch" \
54                         epatch "${WORKDIR}"/patches
55         fi
56
57         sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
58         autotools-utils_src_prepare
59 }
60
61 src_configure() {
62         # bug #483716
63         tc-export AR
64         # --with-confdir is for bug #361481
65         # --with-mapdir is for bug #385113
66         local myeconfargs=(
67                 --with-confdir=/etc/conf.d
68                 --with-mapdir=/etc/autofs
69                 $(use_with dmalloc)
70                 $(use_with ldap openldap)
71                 $(use_with libtirpc)
72                 $(use_with sasl)
73                 $(use_with hesiod)
74                 $(use_enable mount-locking)
75                 --disable-ext-env
76                 --enable-sloppy-mount # bug #453778
77                 --enable-force-shutdown
78                 --enable-ignore-busy
79                 --with-systemd="$(systemd_get_unitdir)" #bug #479492
80                 RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
81         )
82         autotools-utils_src_configure
83 }
84
85 src_compile() {
86         autotools-utils_src_compile DONTSTRIP=1
87 }
88
89 src_install() {
90         autotools-utils_src_install
91
92         if kernel_is -lt 2 6 30; then
93                 # kernel patches
94                 docinto patches
95                 dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
96         fi
97         newinitd "${FILESDIR}"/autofs5.initd autofs
98         insinto etc/autofs
99         newins "${FILESDIR}"/autofs5-auto.master auto.master
100 }
101
102 pkg_postinst() {
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."
110                 elog
111         fi
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"
114         elog "are running."
115 }