cifs-utils-6.7.ebuild 3.1 KB

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