recipes: tools/ntfs-3g: Added version 2021.8.22
[dragora.git] / recipes / tools / ntfs-3g / recipe
blob8a657cf977e9eee87afc1849a8d652ee851062a9
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
18 set -e
20 program=ntfs-3g_ntfsprogs
21 pkgname=ntfs-3g
22 version=2021.8.22
23 release=1
25 # Define a category for the output of the package name
26 pkgcategory=tools
28 tarname=${program}-${version}.tgz
30 # Remote source(s)
31 fetch=https://tuxera.com/opensource/$tarname
33 description="
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}"
51 build()
53     unpack "${tardir}/$tarname"
55     cd "$srcdir"
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" \
65      $configure_args \
66      --libdir=/usr/lib${libSuffix} \
67      --mandir=$mandir \
68      --docdir=$docsdir \
69      --enable-static=no \
70      --enable-extras \
71      --enable-posix-acls \
72      --enable-xattr-mappings \
73      --enable-crypto \
74      --with-fuse=external \
75      --disable-ldconfig \
76      --build="$(gcc -dumpmachine)" \
77      rootbindir=/usr/bin \
78      rootsbindir=/usr/sbin \
79      rootlibdir=/usr/lib${libSuffix} \
81     make -j${jobs} V=1 \
82      rootbindir=/usr/bin \
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"
92     then
93         rm -f "${destdir}/${mandir}/ntfsfallocate.8"
94     fi
96     # Compress and link man pages (if needed)
97     if test -d "${destdir}/$mandir"
98     then
99         (
100             cd "${destdir}/$mandir"
101             find . -type f -exec lzip -9 {} +
102             find . -type l | while read -r file
103             do
104                 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
105                 rm -- "$file"
106             done
107         )
108     fi
110     # Copy documentation
111     mkdir -p "${destdir}${docsdir}"
112     cp -p $docs "${destdir}${docsdir}"