Use https by default
[gentoo.git] / net-fs / autofs / autofs-5.0.7-r5.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
9 inherit autotools-utils linux-info multilib systemd toolchain-funcs
10
11 PATCH_VER=3
12 [[ -n ${PATCH_VER} ]] && \
13         PATCHSET_URI="https://dev.gentoo.org/~jlec/distfiles/${P}-patches-${PATCH_VER}.tar.lzma"
14
15 DESCRIPTION="Kernel based automounter"
16 HOMEPAGE="http://www.linux-consulting.com/Amd_AutoFS/autofs.html"
17 SRC_URI="
18         mirror://kernel/linux/daemons/${PN}/v5/${P}.tar.bz2
19         ${PATCHSET_URI}"
20
21 LICENSE="GPL-2"
22 SLOT="0"
23 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
24 IUSE="-dmalloc hesiod ldap libtirpc mount-locking sasl"
25
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 )"
29
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
35                 sasl? (
36                         dev-libs/cyrus-sasl
37                         dev-libs/libxml2
38                         virtual/krb5
39                 )
40         )
41         libtirpc? ( net-libs/libtirpc )"
42
43 DEPEND="${RDEPEND}
44         sys-devel/flex
45         virtual/yacc"
46
47 CONFIG_CHECK="~AUTOFS4_FS"
48
49 PATCHES=(
50         # Fix for bug #210762
51         # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/4203
52         "${FILESDIR}"/${PN}-5.0.3-heimdal.patch
53
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
59
60         # Upstream reference: http://thread.gmane.org/gmane.linux.kernel.autofs/5371
61         "${FILESDIR}"/${PN}-5.0.5-fix-install-deadlink.patch
62
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
69         )
70
71 AUTOTOOLS_IN_SOURCE_BUILD=1
72
73 src_prepare() {
74         # Upstream's patchset
75         if [[ -n ${PATCH_VER} ]]; then
76                 EPATCH_SUFFIX="patch" \
77                         epatch "${WORKDIR}"/patches
78         fi
79         sed -i -e "s:/usr/bin/kill:/bin/kill:" samples/autofs.service.in || die #bug #479492
80         autotools-utils_src_prepare
81 }
82
83 src_configure() {
84         # bug #483716
85         tc-export AR
86         # --with-confdir is for bug #361481
87         # --with-mapdir is for bug #385113
88         local myeconfargs=(
89                 --with-confdir=/etc/conf.d
90                 --with-mapdir=/etc/autofs
91                 $(use_with dmalloc)
92                 $(use_with ldap openldap)
93                 $(use_with libtirpc)
94                 $(use_with sasl)
95                 $(use_with hesiod)
96                 $(use_enable mount-locking)
97                 --disable-ext-env
98                 --enable-sloppy-mount # bug #453778
99                 --enable-forced-shutdown
100                 --enable-ignore-busy
101                 --with-systemd
102                 systemddir="$(systemd_get_unitdir)" #bug #479492
103                 RANLIB="$(type -P $(tc-getRANLIB))" # bug #483716
104         )
105         autotools-utils_src_configure
106 }
107
108 src_install() {
109         autotools-utils_src_install
110
111         if kernel_is -lt 2 6 30; then
112                 # kernel patches
113                 docinto patches
114                 dodoc patches/${PN}4-2.6.??{,.?{,?}}-v5-update-????????.patch
115         fi
116         newinitd "${FILESDIR}"/autofs5.initd autofs
117         insinto etc/autofs
118         newins "${FILESDIR}"/autofs5-auto.master auto.master
119 }
120
121 pkg_postinst() {
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."
129                 elog
130         fi
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"
133         elog "are running."
134 }