1 # Build recipe for ntfs-3g.
3 # Copyright (c) 2022 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # Exit immediately on any error
20 program=ntfs-3g_ntfsprogs
25 # Define a category for the output of the package name
28 tarname=${program}-${version}.tgz
31 fetch=https://tuxera.com/opensource/$tarname
34 Drivers and utilities for the NTFS file system.
36 The ntfs-3g package contains a stable, read-write open source driver for
37 NTFS partitions. NTFS partitions are used by most Microsoft operating
38 systems, ntfs-3g allows you to mount NTFS partitions in read-write mode
39 from your GNU/Linux system. It uses the FUSE kernel module to be able to
40 implement NTFS support in user space. The package also contains various
41 utilities useful for manipulating NTFS partitions.
44 homepage=https://www.tuxera.com/community/open-source-ntfs-3g/
45 license="GPLv2+, LGPLv2+"
47 # Source documentation
48 docs="AUTHORS COPYING* CREDITS ChangeLog NEWS README TODO*"
49 docsdir="${docdir}/${pkgname}-${version}"
53 unpack "${tardir}/$tarname"
57 # Set sane permissions
58 chmod -R u+w,go-w,a+rX-s .
60 # Make sure to point to the /usr hierarchy
61 sed -i 's#$(DESTDIR)/sbin#$(DESTDIR)/usr/sbin#g' src/Makefile.in
63 ./configure CPPFLAGS="$QICPPFLAGS" \
64 CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
66 --libdir=/usr/lib${libSuffix} \
72 --enable-xattr-mappings \
74 --with-fuse=external \
76 --build="$(gcc -dumpmachine)" \
78 rootsbindir=/usr/sbin \
79 rootlibdir=/usr/lib${libSuffix} \
83 rootsbindir=/usr/sbin \
84 rootlibdir=/usr/lib${libSuffix} \
85 DESTDIR="$destdir" install
87 install -p -m 755 "${worktree}/archive/ntfs-3g/mount.ntfs3" \
88 "${destdir}/usr/bin/mount.ntfs3"
90 # Check if 'ntfsallocate' was installed, if not remove its manpage
91 if test ! -e "${destdir}/usr/bin/ntfsallocate"
93 rm -f "${destdir}/${mandir}/ntfsfallocate.8"
96 # Compress and link man pages (if needed)
97 if test -d "${destdir}/$mandir"
100 cd "${destdir}/$mandir"
101 find . -type f -exec lzip -9 {} +
102 find . -type l | while read -r file
104 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
111 mkdir -p "${destdir}${docsdir}"
112 cp -p $docs "${destdir}${docsdir}"