#!/bin/bash # Slackware build script for ntfsprogs-plus (ntfsck) # # This packages ONE binary: ntfsck, the NTFS checker from the # ntfsprogs-plus fork. The fork's other tools (mkntfs, ntfsresize, # ntfsclone, ntfslabel, ntfsinfo, ntfscluster) carry exactly the same # names as the ntfs-3g binaries already on the system, and those must # keep winning -- so they are deliberately not installed, and neither # are the fork's libntfs.so.90 or its headers (--disable-shared links # ntfsck statically against the fork's own libntfs, giving a single # self-contained binary; ldd shows libc and nothing else). # # Upstream's "make install" is not used: it is broken under DESTDIR # (its install hook mv's libntfs.so* into a $DESTDIR/lib it never # creates) and it would install the colliding tools above. # # No fsck.ntfs symlink is created, on purpose: fsck -A at boot would # start running this on every NTFS volume, and the dirty-flag, # boot-sector and chkdsk-scheduling jobs stay with ntfsfix. ntfsck # ignores the VolumeDirty flag entirely (neither reports nor clears # it); run "ntfsck -n" first and repair with -a only when -n found # something, because -a rewrites the $LogFile restart area even on a # healthy volume. # # Build requirements beyond a stock full install: none (autoconf, # automake, libtool and libgcrypt ship with Slackware; the tag tarball # has no ./configure, so autoreconf runs first). cd $(dirname $0) ; CWD=$(pwd) PRGNAM=ntfsprogs-plus VERSION=${VERSION:-1.0.0} BUILD=${BUILD:-1} TAG=${TAG:-} PKGTYPE=${PKGTYPE:-txz} if [ -z "$ARCH" ]; then case "$(uname -m)" in i?86) ARCH=i586 ;; arm*) ARCH=arm ;; *) ARCH=$(uname -m) ;; esac fi TMP=${TMP:-/tmp/pm} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" fi set -e rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ -o -perm 511 \) -exec chmod 755 {} \+ -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+ # The tag tarball ships no ./configure, so autoreconf must run -- and # automake's gnu strictness demands a file literally named README, which # the tarball lacks (it has README.md only; some automake builds accept # that in its place, some error out with "required file './README' not # found"). A real README copy satisfies every automake either way. [ -e README ] || cp README.md README autoreconf -fi CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ # --without-hd: the optional "Windows compliant disk geometry" code links # libhd (hwinfo). The shipped ntfsck has never had it, and whether it gets # enabled otherwise depends on whether hwinfo happens to be installed in the # build root -- a non-deterministic build. Pin it off. ./configure \ --without-hd \ --prefix=/usr \ --sbindir=/usr/sbin \ --mandir=/usr/man \ --disable-shared \ --build=$ARCH-slackware-linux make install -D -m 0755 src/ntfsck $PKG/usr/sbin/ntfsck install -D -m 0644 src/ntfsck.8 $PKG/usr/man/man8/ntfsck.8 strip --strip-unneeded $PKG/usr/sbin/ntfsck gzip -9 $PKG/usr/man/man8/ntfsck.8 mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a AUTHORS COPYING COPYING.LIB CREDITS ChangeLog NEWS README.md \ $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG /sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE