summaryrefslogtreecommitdiffstats
path: root/source/a/dosfstools/dosfstools.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/a/dosfstools/dosfstools.SlackBuild')
-rwxr-xr-xsource/a/dosfstools/dosfstools.SlackBuild125
1 files changed, 93 insertions, 32 deletions
diff --git a/source/a/dosfstools/dosfstools.SlackBuild b/source/a/dosfstools/dosfstools.SlackBuild
index ebe99c68b..abb2d85ba 100755
--- a/source/a/dosfstools/dosfstools.SlackBuild
+++ b/source/a/dosfstools/dosfstools.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2007-2009 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2011 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -20,55 +20,116 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-VERSION=2.11
-ARCH=${ARCH:-x86_64}
-BUILD=${BUILD:-1}
+
+PKGNAM=dosfstools
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.bz2 | rev | cut -f 3- -d . | rev | cut -f 2- -d -)}
+BUILD=${BUILD:-2}
+
+# Automatically determine the architecture we're building on:
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) export ARCH=i486 ;;
+ arm*) export ARCH=arm ;;
+ # Unless $ARCH is already set, use uname -m for all other archs:
+ *) export ARCH=$( uname -m ) ;;
+ esac
+fi
+
+NUMJOBS=${NUMJOBS:-" -j7 "}
+
+if [ "$ARCH" = "i486" ]; then
+ SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "s390" ]; then
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ LIBDIRSUFFIX=""
+fi
CWD=$(pwd)
TMP=${TMP:-/tmp}
-PKG=$TMP/package-dosfstools
+PKG=$TMP/package-$PKGNAM
rm -rf $PKG
mkdir -p $TMP $PKG
cd $TMP
-rm -rf dosfstools-$VERSION
-tar xzvf $CWD/dosfstools-$VERSION.src.tar.gz
-cd dosfstools-$VERSION
+rm -rf $PKGNAM-$VERSION
+tar xvf $CWD/$PKGNAM-$VERSION.tar.bz2 || exit 1
+cd $PKGNAM-$VERSION
+
chown -R root:root .
-make -j4 || exit 1
-
-( cd mkdosfs
- mkdir -p $PKG/sbin
- cat mkdosfs > $PKG/sbin/mkdosfs
- chmod 755 $PKG/sbin/mkdosfs
- mkdir -p $PKG/usr/man/man8
- cat mkdosfs.8 | gzip -9c > $PKG/usr/man/man8/mkdosfs.8.gz
-)
-( cd $PKG/sbin ; rm -f mkfs.msdos ; ln -sf mkdosfs mkfs.msdos )
-( cd dosfsck
- cat dosfsck > $PKG/sbin/dosfsck
- chmod 755 $PKG/sbin/dosfsck
- cat dosfsck.8 | gzip -9c > $PKG/usr/man/man8/dosfsck.8.gz
-)
-mkdir -p $PKG/usr/doc/dosfstools-$VERSION
+find . \
+ \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
+ -exec chmod 755 {} \; -o \
+ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
+ -exec chmod 644 {} \;
+
+zcat $CWD/dosfstools.paths.diff.gz | patch -p1 --verbose || exit 1
+
+# Build and install:
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+## I do not believe we want these, or it may cause autofscking fat volumes at boot:
+## NOTE: only if it is set in fstab, which is not default. Some other things need
+## to see fsck.vfat, so allowing it again.
+#rm -f $PKG/sbin/fsck.* $PKG/usr/man/man?/fsck.*
+
+# We can handle this:
+rm -r $PKG/usr/doc
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/$PKGNAM-$VERSION
cp -a \
- CHANGES README.Atari TODO \
- $PKG/usr/doc/dosfstools-$VERSION
-mkdir -p $PKG/usr/doc/dosfstools-$VERSION/mkdosfs
-( cd mkdosfs ; cp -a ANNOUNCE COPYING README mkdosfs-ygg-0.3b.lsm $PKG/usr/doc/dosfstools-$VERSION/mkdosfs )
-mkdir -p $PKG/usr/doc/dosfstools-$VERSION/dosfsck
-( cd dosfsck ; cp -a CHANGES COPYING README $PKG/usr/doc/dosfstools-$VERSION/dosfsck )
+ COPYING* README* \
+ doc/ANNOUNCE* doc/README* doc/TODO* \
+ $PKG/usr/doc/$PKGNAM-$VERSION
+# Strip binaries:
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
+# Compress and if needed symlink the man pages:
+if [ -d $PKG/usr/man ]; then
+ ( cd $PKG/usr/man
+ for manpagedir in $(find . -type d -name "man*") ; do
+ ( cd $manpagedir
+ for eachpage in $( find . -type l -maxdepth 1) ; do
+ ln -s $( readlink $eachpage ).gz $eachpage.gz
+ rm $eachpage
+ done
+ gzip -9 *.?
+ )
+ done
+ )
+fi
+
+# Compress info files, if any:
+if [ -d $PKG/usr/info ]; then
+ ( cd $PKG/usr/info
+ rm -f dir
+ gzip -9 *
+ )
+fi
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
-# Build the package:
cd $PKG
-makepkg -l y -c n $TMP/dosfstools-$VERSION-$ARCH-$BUILD.txz
+/sbin/makepkg -l y -c n $TMP/$PKGNAM-$(echo $VERSION | tr - _)-$ARCH-$BUILD.txz