Files
ntfs-3g/source.sh
T
2025-12-14 09:56:13 +02:00

47 lines
1.7 KiB
Bash

# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
# The prepare function is executed in the root of the temp directory
# This function is used for putting downloaded files to the correct location or applying patches
prepare() {
cd "$BPM_SOURCE"
autoreconf -fi
# Install binaries in usr/bin and usr/sbin
sed -i 's|$(DESTDIR)/sbin|$(DESTDIR)/usr/sbin|' {ntfsprogs,src}/Makefile.in
}
# The build function is executed in the source directory
# This function is used to compile the source code
build() {
./configure --prefix=/usr \
--mandir=/usr/share/man \
--disable-ldconfig \
--disable-static \
--with-fuse=external \
--enable-xattr-mappings \
--enable-posix-acls \
--enable-extras \
--enable-crypto
make
}
# The package function is executed in the source directory
# This function is used to move the compiled files into the output directory
package() {
make DESTDIR="$BPM_OUTPUT" rootbindir=/usr/bin install
# Move mount binaries
mv "$BPM_OUTPUT"/usr/sbin/mount* -t "$BPM_OUTPUT"/usr/bin
# Create symlink for mounting NTFS partitions
ln -sf ntfs-3g "${BPM_OUTPUT}"/usr/bin/mount.ntfs
# Remove documentation for non-existent file
rm "$BPM_OUTPUT"/usr/share/man/man8/ntfsfallocate.8
# Install package license
install -Dm644 "$BPM_SOURCE"/COPYING* -t "$BPM_OUTPUT"/usr/share/licenses/ntfs-3g/
}