efe3fcc71a739b40aa0264f94c91b9f21f0b5746
[gentoo.git] / sys-fs / ntfs3g / ntfs3g-2017.3.23-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5 inherit linux-info udev toolchain-funcs libtool
6
7 MY_PN=${PN/3g/-3g}
8 MY_P=${MY_PN}_ntfsprogs-${PV}
9
10 DESCRIPTION="Open source read-write NTFS driver that runs under FUSE"
11 HOMEPAGE="http://www.tuxera.com/community/ntfs-3g-download/"
12 SRC_URI="http://tuxera.com/opensource/${MY_P}.tgz"
13
14 LICENSE="GPL-2"
15 # The subslot matches the SONAME major #.
16 SLOT="0/88"
17 KEYWORDS="~alpha amd64 arm ~arm64 ~hppa ppc ppc64 sparc x86 ~amd64-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? (
27                 >=sys-fs/fuse-2.8.0:0
28         )
29 "
30 DEPEND="${RDEPEND}
31         sys-apps/attr
32         virtual/pkgconfig
33 "
34
35 S="${WORKDIR}/${MY_P}"
36
37 DOCS="AUTHORS ChangeLog CREDITS README"
38
39 PATCHES=(
40         "${FILESDIR}"/${PN}-2014.2.15-no-split-usr.patch
41         "${FILESDIR}"/${PN}-2016.2.22-sysmacros.patch #580136
42         # Fedora fixes
43         "${FILESDIR}"/${PN}-2017.3.23-check-mftmirr.patch
44         "${FILESDIR}"/${PN}-2017.3.23-big-sectors.patch
45         "${FILESDIR}"/${PN}-2017.3.23-full-clusters.patch
46 )
47
48 pkg_setup() {
49         if use external-fuse && use kernel_linux; then
50                 if kernel_is lt 2 6 9; then
51                         die "Your kernel is too old."
52                 fi
53                 CONFIG_CHECK="~FUSE_FS"
54                 FUSE_FS_WARNING="You need to have FUSE module built to use ntfs-3g"
55                 linux-info_pkg_setup
56         fi
57 }
58
59 src_prepare() {
60         default
61         # Keep the symlinks in the same place we put the main binaries.
62         # Having them in / when all the progs are in /usr is pointless.
63         sed -i \
64                 -e 's:/sbin:$(sbindir):g' \
65                 {ntfsprogs,src}/Makefile.in || die #578336
66         # Note: patches apply to Makefile.in, so don't run autotools here.
67         elibtoolize
68 }
69
70 src_configure() {
71         # disable hd library until we have the right library in the tree and
72         # don't links to hwinfo one causing issues like bug #602360
73         tc-ld-disable-gold
74         econf \
75                 --prefix="${EPREFIX}"/usr \
76                 --exec-prefix="${EPREFIX}"/usr \
77                 --docdir="${EPREFIX}"/usr/share/doc/${PF} \
78                 $(use_enable debug) \
79                 --enable-ldscript \
80                 --disable-ldconfig \
81                 $(use_enable acl posix-acls) \
82                 $(use_enable xattr xattr-mappings) \
83                 $(use_enable ntfsdecrypt crypto) \
84                 $(use_enable ntfsprogs) \
85                 $(use_enable ntfsprogs quarantined) \
86                 --without-uuid \
87                 --without-hd \
88                 --enable-extras \
89                 $(use_enable static-libs static) \
90                 --with-fuse=$(usex external-fuse external internal)
91 }
92
93 src_install() {
94         default
95
96         use suid && fperms u+s /usr/bin/${MY_PN}
97         # Not needed with the link of mount.ntfs being created, causes
98         # issues like bug #635080
99 #       udev_dorules "${FILESDIR}"/99-ntfs3g.rules
100         dosym mount.ntfs-3g /usr/sbin/mount.ntfs #374197
101
102         find "${D}" -name '*.la' -type f -delete || die
103 }