cifs-utils-6.6-r2.ebuild 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit 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. creds? ( sys-apps/keyutils )
  23. pam? ( virtual/pam )
  24. "
  25. DEPEND="${RDEPEND}"
  26. PDEPEND="
  27. acl? ( || (
  28. =net-fs/samba-3.6*[winbind]
  29. >=net-fs/samba-4.0.0_alpha1
  30. ) )
  31. "
  32. REQUIRED_USE="acl? ( ads )"
  33. DOCS="doc/linux-cifs-client-guide.odt"
  34. pkg_setup() {
  35. linux-info_pkg_setup
  36. if ! linux_config_exists || ! linux_chkconfig_present CIFS; then
  37. ewarn "You must enable CIFS support in your kernel config, "
  38. ewarn "to be able to mount samba shares. You can find it at"
  39. ewarn
  40. ewarn " File systems"
  41. ewarn " Network File Systems"
  42. ewarn " CIFS support"
  43. ewarn
  44. ewarn "and recompile your kernel ..."
  45. fi
  46. }
  47. src_configure() {
  48. ROOTSBINDIR="${EPREFIX}"/sbin \
  49. econf \
  50. $(use_enable acl cifsacl cifsidmap) \
  51. $(use_enable ads cifsupcall) \
  52. $(use caps && use_with !caps-ng libcap || echo --without-libcap) \
  53. $(use caps && use_with caps-ng libcap-ng || echo --without-libcap-ng) \
  54. $(use_enable creds cifscreds) \
  55. $(use_enable pam) \
  56. $(use_with pam pamdir $(getpam_mod_dir))
  57. }
  58. src_install() {
  59. default
  60. # remove empty directories
  61. find "${ED}" -type d -print0 | xargs --null rmdir \
  62. --ignore-fail-on-non-empty &>/dev/null
  63. if use acl ; then
  64. dodir /etc/cifs-utils
  65. dosym /usr/$(get_libdir)/cifs-utils/idmapwb.so \
  66. /etc/cifs-utils/idmap-plugin
  67. dodir /etc/request-key.d
  68. echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \
  69. > "${ED}/etc/request-key.d/cifs.idmap.conf"
  70. fi
  71. if use ads ; then
  72. dodir /etc/request-key.d
  73. echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \
  74. > "${ED}/etc/request-key.d/cifs.upcall.conf"
  75. echo 'create cifs.spnego * * /usr/sbin/cifs.upcall %k' \
  76. > "${ED}/etc/request-key.d/cifs.spnego.conf"
  77. fi
  78. }
  79. pkg_postinst() {
  80. # Inform about set-user-ID bit of mount.cifs
  81. ewarn "setuid use flag was dropped due to multiple security implications"
  82. ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
  83. ewarn "You are free to set setuid flags by yourself"
  84. # Inform about upcall usage
  85. if use acl ; then
  86. einfo "The cifs.idmap utility has been enabled by creating the"
  87. einfo "configuration file /etc/request-key.d/cifs.idmap.conf"
  88. einfo "This enables you to get and set CIFS acls."
  89. fi
  90. if use ads ; then
  91. einfo "The cifs.upcall utility has been enabled by creating the"
  92. einfo "configuration file /etc/request-key.d/cifs.upcall.conf"
  93. einfo "This enables you to mount DFS shares."
  94. fi
  95. }