cifs-utils-6.4.ebuild 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils linux-info multilib
  5. DESCRIPTION="Tools for Managing Linux CIFS Client Filesystems"
  6. HOMEPAGE="http://wiki.samba.org/index.php/LinuxCIFS_utils"
  7. SRC_URI="ftp://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"
  12. DEPEND="!net-fs/mount-cifs
  13. !<net-fs/samba-3.6_rc1
  14. ads? (
  15. sys-apps/keyutils
  16. sys-libs/talloc
  17. virtual/krb5
  18. )
  19. caps? ( !caps-ng? ( sys-libs/libcap ) )
  20. caps? ( caps-ng? ( sys-libs/libcap-ng ) )
  21. creds? ( sys-apps/keyutils )"
  22. PDEPEND="${DEPEND}
  23. acl? ( || (
  24. =net-fs/samba-3.6*[winbind]
  25. >=net-fs/samba-4.0.0_alpha1
  26. ) )
  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_configure() {
  44. ROOTSBINDIR="${EPREFIX}"/sbin \
  45. econf \
  46. $(use_enable acl cifsacl cifsidmap) \
  47. $(use_enable ads cifsupcall) \
  48. $(use caps && use_with !caps-ng libcap || echo --without-libcap) \
  49. $(use caps && use_with caps-ng libcap-ng || echo --without-libcap-ng) \
  50. $(use_enable creds cifscreds)
  51. }
  52. src_install() {
  53. default
  54. # remove empty directories
  55. find "${ED}" -type d -print0 | xargs --null rmdir \
  56. --ignore-fail-on-non-empty &>/dev/null
  57. if use acl ; then
  58. dodir /etc/cifs-utils
  59. dosym /usr/$(get_libdir)/cifs-utils/idmapwb.so \
  60. /etc/cifs-utils/idmap-plugin
  61. dodir /etc/request-key.d
  62. echo 'create cifs.idmap * * /usr/sbin/cifs.idmap %k' \
  63. > "${ED}/etc/request-key.d/cifs.idmap.conf"
  64. fi
  65. if use ads ; then
  66. dodir /etc/request-key.d
  67. echo 'create dns_resolver * * /usr/sbin/cifs.upcall %k' \
  68. > "${ED}/etc/request-key.d/cifs.upcall.conf"
  69. echo 'create cifs.spnego * * /usr/sbin/cifs.upcall %k' \
  70. > "${ED}/etc/request-key.d/cifs.spnego.conf"
  71. fi
  72. }
  73. pkg_postinst() {
  74. # Inform about set-user-ID bit of mount.cifs
  75. ewarn "setuid use flag was dropped due to multiple security implications"
  76. ewarn "such as CVE-2009-2948, CVE-2011-3585 and CVE-2012-1586"
  77. ewarn "You are free to set setuid flags by yourself"
  78. # Inform about upcall usage
  79. if use acl ; then
  80. einfo "The cifs.idmap utility has been enabled by creating the"
  81. einfo "configuration file /etc/request-key.d/cifs.idmap.conf"
  82. einfo "This enables you to get and set CIFS acls."
  83. fi
  84. if use ads ; then
  85. einfo "The cifs.upcall utility has been enabled by creating the"
  86. einfo "configuration file /etc/request-key.d/cifs.upcall.conf"
  87. einfo "This enables you to mount DFS shares."
  88. fi
  89. }