ntfs3g-2016.2.22-r2.ebuild 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils linux-info udev toolchain-funcs libtool
  5. MY_PN=${PN/3g/-3g}
  6. MY_P=${MY_PN}_ntfsprogs-${PV}
  7. DESCRIPTION="Open source read-write NTFS driver that runs under FUSE"
  8. HOMEPAGE="http://www.tuxera.com/community/ntfs-3g-download/"
  9. SRC_URI="http://tuxera.com/opensource/${MY_P}.tgz"
  10. LICENSE="GPL-2"
  11. # The subslot matches the SONAME major #.
  12. SLOT="0/87"
  13. KEYWORDS="alpha amd64 arm ~hppa ppc ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
  14. IUSE="acl debug +external-fuse ntfsdecrypt +ntfsprogs static-libs suid xattr"
  15. RDEPEND="!<sys-apps/util-linux-2.20.1-r2
  16. !sys-fs/ntfsprogs
  17. ntfsdecrypt? (
  18. >=dev-libs/libgcrypt-1.2.2:0
  19. >=net-libs/gnutls-1.4.4
  20. )
  21. external-fuse? (
  22. >=sys-fs/fuse-2.8.0
  23. <sys-fs/fuse-3.0.0_pre
  24. )"
  25. DEPEND="${RDEPEND}
  26. sys-apps/attr
  27. virtual/pkgconfig"
  28. S="${WORKDIR}/${MY_P}"
  29. DOCS="AUTHORS ChangeLog CREDITS README"
  30. PATCHES=(
  31. "${FILESDIR}"/${PN}-2014.2.15-no-split-usr.patch
  32. "${FILESDIR}"/${PN}-2016.2.22-sysmacros.patch #580136
  33. "${FILESDIR}"/${PN}-2016.2.22-CVE-2017-0358.patch #607912
  34. )
  35. pkg_setup() {
  36. if use external-fuse && use kernel_linux; then
  37. if kernel_is lt 2 6 9; then
  38. die "Your kernel is too old."
  39. fi
  40. CONFIG_CHECK="~FUSE_FS"
  41. FUSE_FS_WARNING="You need to have FUSE module built to use ntfs-3g"
  42. linux-info_pkg_setup
  43. fi
  44. }
  45. src_prepare() {
  46. epatch "${PATCHES[@]}"
  47. # Keep the symlinks in the same place we put the main binaries.
  48. # Having them in / when all the progs are in /usr is pointless.
  49. sed -i \
  50. -e 's:/sbin:$(sbindir):g' \
  51. {ntfsprogs,src}/Makefile.in || die #578336
  52. # Note: patches apply to Makefile.in, so don't run autotools here.
  53. elibtoolize
  54. }
  55. src_configure() {
  56. tc-ld-disable-gold
  57. econf \
  58. --prefix="${EPREFIX}"/usr \
  59. --exec-prefix="${EPREFIX}"/usr \
  60. --docdir="${EPREFIX}"/usr/share/doc/${PF} \
  61. $(use_enable debug) \
  62. --enable-ldscript \
  63. --disable-ldconfig \
  64. $(use_enable acl posix-acls) \
  65. $(use_enable xattr xattr-mappings) \
  66. $(use_enable ntfsdecrypt crypto) \
  67. $(use_enable ntfsprogs) \
  68. $(use_enable ntfsprogs quarantined) \
  69. --without-uuid \
  70. --enable-extras \
  71. $(use_enable static-libs static) \
  72. --with-fuse=$(usex external-fuse external internal)
  73. }
  74. src_install() {
  75. default
  76. use suid && fperms u+s /usr/bin/${MY_PN}
  77. udev_dorules "${FILESDIR}"/99-ntfs3g.rules
  78. prune_libtool_files
  79. dosym mount.ntfs-3g /usr/sbin/mount.ntfs #374197
  80. }