app-admin/equo: Reassign due to bug #269417
[gentoo.git] / net-fs / cifs-utils / cifs-utils-6.5.ebuild
1 # Copyright 1999-2016 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=6
6
7 inherit eutils linux-info multilib
8
9 DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems"
10 HOMEPAGE="http://wiki.samba.org/index.php/LinuxCIFS_utils"
11 SRC_URI="https://ftp.samba.org/pub/linux-cifs/${PN}/${P}.tar.bz2"
12
13 LICENSE="GPL-3"
14 SLOT="0"
15 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~arm-linux ~x86-linux"
16 IUSE="+acl +ads +caps +caps-ng creds"
17
18 DEPEND="!net-fs/mount-cifs
19         !<net-fs/samba-3.6_rc1
20         ads? (
21                 sys-apps/keyutils
22                 sys-libs/talloc
23                 virtual/krb5
24         )
25         caps? ( !caps-ng? ( sys-libs/libcap ) )
26         caps? ( caps-ng? ( sys-libs/libcap-ng ) )
27         creds? ( sys-apps/keyutils )"
28 PDEPEND="${DEPEND}
29         acl? ( || (
30                 =net-fs/samba-3.6*[winbind]
31                 >=net-fs/samba-4.0.0_alpha1
32         ) )
33 "
34
35 REQUIRED_USE="acl? ( ads )"
36
37 DOCS="doc/linux-cifs-client-guide.odt"
38
39 pkg_setup() {
40         linux-info_pkg_setup
41
42         if ! linux_config_exists || ! linux_chkconfig_present CIFS; then
43                 ewarn "You must enable CIFS support in your kernel config, "
44                 ewarn "to be able to mount samba shares. You can find it at"
45                 ewarn
46                 ewarn "  File systems"
47                 ewarn " Network File Systems"
48                 ewarn "                 CIFS support"
49                 ewarn
50                 ewarn "and recompile your kernel ..."
51         fi
52 }
53
54 src_configure() {
55         ROOTSBINDIR="${EPREFIX}"/sbin \
56         econf \
57                 $(use_enable acl cifsacl cifsidmap) \
58                 $(use_enable ads cifsupcall) \
59                 $(use caps && use_with !caps-ng libcap || echo --without-libcap) \
60                 $(use caps && use_with caps-ng libcap-ng || echo --without-libcap-ng) \
61                 $(use_enable creds cifscreds)
62 }
63
64 src_install() {
65         default
66
67         # remove empty directories
68         find "${ED}" -type d -print0 | xargs --null rmdir \
69                 --ignore-fail-on-non-empty &>/dev/null
70
71         if use acl ; then
72                 dodir /etc/cifs-utils
73                 dosym /usr/$(get_libdir)/cifs-utils/idmapwb.so \
74                         /etc/cifs-utils/idmap-plugin
75                 dodir /etc/request-key.d
76                 echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \
77                         > "${ED}/etc/request-key.d/cifs.idmap.conf"
78         fi
79
80         if use ads ; then
81                 dodir /etc/request-key.d
82                 echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \
83                         > "${ED}/etc/request-key.d/cifs.upcall.conf"
84         fi
85 }
86
87 pkg_postinst() {
88         # Inform about set-user-ID bit of mount.cifs
89         ewarn "setuid use flag was dropped due to multiple security implications"
90         ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
91         ewarn "You are free to set setuid flags by yourself"
92
93         # Inform about upcall usage
94         if use acl ; then
95                 einfo "The cifs.idmap utility has been enabled by creating the"
96                 einfo "configuration file /etc/request-key.d/cifs.idmap.conf"
97                 einfo "This enables you to get and set CIFS acls."
98         fi
99
100         if use ads ; then
101                 einfo "The cifs.upcall utility has been enabled by creating the"
102                 einfo "configuration file /etc/request-key.d/cifs.upcall.conf"
103                 einfo "This enables you to mount DFS shares."
104         fi
105 }