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