daee2206b0c3ac09dfe6c3aeef7da708e584b5bb
[gentoo.git] / sys-fs / ntfs3g / ntfs3g-2014.2.15.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
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 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
46 src_prepare() {
47         # add missing $(sbindir) references
48         sed -e 's:sbin\($\|/\):$(sbindir)\1:g' \
49                 -i ntfsprogs/Makefile.in src/Makefile.in || die
50         epatch "${FILESDIR}"/${PN}-2014.2.15-no-split-usr.patch
51 }
52
53 src_configure() {
54         econf \
55                 --prefix="${EPREFIX}"/usr \
56                 --exec-prefix="${EPREFIX}"/usr \
57                 --docdir="${EPREFIX}"/usr/share/doc/${PF} \
58                 $(use_enable debug) \
59                 --enable-ldscript \
60                 --disable-ldconfig \
61                 $(use_enable acl posix-acls) \
62                 $(use_enable xattr xattr-mappings) \
63                 $(use_enable ntfsdecrypt crypto) \
64                 $(use_enable ntfsprogs) \
65                 --without-uuid \
66                 --enable-extras \
67                 $(use_enable static-libs static) \
68                 --with-fuse=$(usex external-fuse external internal)
69 }
70
71 src_install() {
72         default
73
74         use suid && fperms u+s /usr/bin/${MY_PN}
75         udev_dorules "${FILESDIR}"/99-ntfs3g.rules
76         prune_libtool_files
77
78         # https://bugs.gentoo.org/398069
79         rmdir "${D}"/sbin
80
81         dosym mount.ntfs-3g /usr/sbin/mount.ntfs #374197
82 }
83
84 pkg_pretend() {
85         if [[ ${MERGE_TYPE} != binary ]]; then
86                 # Bug 450024
87                 if tc-ld-is-gold; then
88                         eerror "ntfs-3g does not function correctly when built with the gold linker."
89                         eerror "Please select the bfd linker with binutils-config."
90                         die "GNU gold detected"
91                 fi
92         fi
93 }