sys-block/btrace: Merge GitHub PR #1716
[gentoo.git] / sys-fs / ntfs3g / ntfs3g-2014.2.15-r1.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=5
6 inherit eutils linux-info udev toolchain-funcs autotools
7
8 MY_PN=${PN/3g/-3g}
9 MY_P=${MY_PN}_ntfsprogs-${PV}
10
11 DESCRIPTION="Open source read-write NTFS driver that runs under FUSE"
12 HOMEPAGE="http://www.tuxera.com/community/ntfs-3g-download/"
13 SRC_URI="http://tuxera.com/opensource/${MY_P}.tgz"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="alpha amd64 arm ppc ppc64 sparc x86 ~amd64-linux ~arm-linux ~x86-linux"
18 IUSE="acl debug +external-fuse ntfsdecrypt +ntfsprogs static-libs suid xattr"
19
20 RDEPEND="!<sys-apps/util-linux-2.20.1-r2
21         !sys-fs/ntfsprogs
22         ntfsdecrypt? (
23                 >=dev-libs/libgcrypt-1.2.2:0
24                 >=net-libs/gnutls-1.4.4
25         )
26         external-fuse? ( >=sys-fs/fuse-2.8.0 )"
27 DEPEND="${RDEPEND}
28         sys-apps/attr
29         virtual/pkgconfig"
30
31 S="${WORKDIR}/${MY_P}"
32
33 DOCS="AUTHORS ChangeLog CREDITS README"
34
35 PATCHES=(
36         "${FILESDIR}"/${PN}-2014.2.15-no-split-usr.patch
37         "${FILESDIR}"/${PN}-2014.2.15-dont-put-things-in-root.patch
38         "${FILESDIR}"/${P}-update-fuse-lite-to-support-ioctls.patch
39         "${FILESDIR}"/${P}-implement-fstrim.patch
40         "${FILESDIR}"/${P}-fix-fstrim-applied-to-partitons.patch
41 )
42
43 pkg_setup() {
44         if use external-fuse && use kernel_linux; then
45                 if kernel_is lt 2 6 9; then
46                         die "Your kernel is too old."
47                 fi
48                 CONFIG_CHECK="~FUSE_FS"
49                 FUSE_FS_WARNING="You need to have FUSE module built to use ntfs-3g"
50                 linux-info_pkg_setup
51         fi
52 }
53
54 src_prepare() {
55         epatch "${PATCHES[@]}"
56         eautoreconf
57         elibtoolize
58 }
59
60 src_configure() {
61         tc-ld-disable-gold
62         econf \
63                 --prefix="${EPREFIX}"/usr \
64                 --exec-prefix="${EPREFIX}"/usr \
65                 --docdir="${EPREFIX}"/usr/share/doc/${PF} \
66                 $(use_enable debug) \
67                 --enable-ldscript \
68                 --disable-ldconfig \
69                 $(use_enable acl posix-acls) \
70                 $(use_enable xattr xattr-mappings) \
71                 $(use_enable ntfsdecrypt crypto) \
72                 $(use_enable ntfsprogs) \
73                 --without-uuid \
74                 --enable-extras \
75                 $(use_enable static-libs static) \
76                 --with-fuse=$(usex external-fuse external internal)
77 }
78
79 src_install() {
80         default
81
82         use suid && fperms u+s /usr/bin/${MY_PN}
83         udev_dorules "${FILESDIR}"/99-ntfs3g.rules
84         prune_libtool_files
85
86         dosym mount.ntfs-3g /usr/sbin/mount.ntfs #374197
87 }