summaryrefslogtreecommitdiffstats
path: root/source.local/a/file
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2013-03-22 16:47:17 -0700
committer Eric Hameleers <alien@slackware.com>2013-03-22 16:47:17 -0700
commit69dd99f961988fa15da8d7f0d63b62f3385419c3 (patch)
treed57eb3e85e1d08e7815787de26946ee42c398b66 /source.local/a/file
downloadalienarm-69dd99f961988fa15da8d7f0d63b62f3385419c3.tar.gz
alienarm-69dd99f961988fa15da8d7f0d63b62f3385419c3.tar.xz
Initial commit of a Slackware cross-arch bootstrap framework.
Diffstat (limited to 'source.local/a/file')
-rwxr-xr-xsource.local/a/file/file.SlackBuild168
-rw-r--r--source.local/a/file/file.crdaregbin.magic.gzbin0 -> 195 bytes
-rw-r--r--source.local/a/file/file.etc.file.diff.gzbin0 -> 212 bytes
-rw-r--r--source.local/a/file/file.quiet.diff.gzbin0 -> 336 bytes
-rw-r--r--source.local/a/file/file.short.diff.gzbin0 -> 250 bytes
-rw-r--r--source.local/a/file/file.xz.magic.gzbin0 -> 248 bytes
-rw-r--r--source.local/a/file/file.zisofs.magic.gzbin0 -> 214 bytes
-rw-r--r--source.local/a/file/slack-desc19
8 files changed, 187 insertions, 0 deletions
diff --git a/source.local/a/file/file.SlackBuild b/source.local/a/file/file.SlackBuild
new file mode 100755
index 0000000..089849c
--- /dev/null
+++ b/source.local/a/file/file.SlackBuild
@@ -0,0 +1,168 @@
+#!/bin/sh
+
+# Copyright 2005-2008, 2009, 2010, 2012 Patrick J. Volkerding, Sebeka, MN, USA
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# Modified 2012 by Eric Hameleers <alien at slackware.com> for ARM port.
+
+
+VERSION=${VERSION:-$(echo file-*.tar.?z* | cut -d - -f 2 | rev | cut -f 3- -d . | rev)}
+BUILD=${BUILD:-1}
+
+NUMJOBS=${NUMJOBS:--j7}
+
+if [ -e $CWD/machine.conf ]; then
+ . $CWD/machine.conf ]
+elif [ -e /etc/slackbuild/machine.conf ]; then
+ . /etc/slackbuild/machine.conf ]
+else
+ # 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
+ # Set CFLAGS/CXXFLAGS and LIBDIRSUFFIX:
+ 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
+fi
+
+case "$ARCH" in
+ arm*) TARGET=$ARCH-slackware-linux-gnueabi ;;
+ *) TARGET=$ARCH-slackware-linux ;;
+esac
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp}
+PKG=$TMP/package-file
+
+rm -rf $PKG
+mkdir -p $TMP $PKG
+cd $TMP
+rm -rf file-$VERSION
+tar xvf $CWD/file-$VERSION.tar.?z* || exit 1
+cd file-$VERSION || exit 1
+chown -R root:root .
+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 {} \;
+
+# Make the default data directory /etc/file like it has always been:
+zcat $CWD/file.etc.file.diff.gz | patch -p1 --verbose || exit 1
+# This is needed after the patch above:
+autoreconf || exit 1
+
+# Don't spew warnings about using the flat text files
+zcat $CWD/file.quiet.diff.gz | patch -p1 -E --verbose || exit 1
+# I don't know what this one does
+zcat $CWD/file.short.diff.gz | patch -p1 -E --verbose || exit 1
+
+# Add zisofs and crda regulatory bin detection
+zcat $CWD/file.zisofs.magic.gz >> magic/Magdir/compress
+zcat $CWD/file.crdaregbin.magic.gz >> magic/Magdir/crdaregbin
+
+# End of preparations
+if echo "$*" | grep -qw -- --prep ; then
+ exit 0
+fi
+
+CFLAGS="$SLKCFLAGS" \
+./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --datadir=/etc \
+ --mandir=/usr/man \
+ --infodir=/usr/info \
+ --docdir=/usr/doc/file-$VERSION \
+ --enable-fsect-man5 \
+ --disable-static \
+ --build=$TARGET
+
+# The generated $TMP/file-$VERSION/libtool is buggy. I don't know if this is supposed
+# to work, but it certainly does, so... :-)
+cat $(which libtool) > libtool
+
+make $NUMJOBS || make || exit 1
+make install DESTDIR=$PKG || exit 1
+
+# Seems --disable-static has been ignored lately:
+rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libmagic.a
+
+# Is file really this much of a processing bottleneck? Doubtful.
+#
+# NOTE: Benchmarked flat files vs. .mgc June 2009, found no measurable
+# difference on 3000+ files.
+#
+# If you really need these (let's say you're doing virus scanning
+# and this *would* speed things up quite a bit) you can create
+# the pre-parsed file yourself using file's -C option.
+rm -f $PKG/etc/file/magic.mgc
+mkdir -p $PKG/etc/file/magic
+cp -a magic/Magdir/* $PKG/etc/file/magic
+# After building, this works fine. /etc/file/magic/ takes up 1.2M,
+# while the magic.mgc file is 1.7M. Considering a difference of 500k,
+# and the potential speedup, I'm not sure it's worth the effort...
+# but it does make it easier for an admin to add a small chunk of
+# new magic.
+
+# IMHO, moving this sort of thing does not make sense.
+# We'll support both the traditional and new locations.
+# I hate to squat on a name as generic as "/etc/misc/",
+# but it wasn't my idea.
+( cd $PKG/etc ; ln -sf file misc )
+
+# Strip everything for good measure:
+find $PKG | xargs file | grep -e "executable" -e "shared object" \
+ | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
+
+( cd $PKG/usr/man || exit 1
+ find . -type f -exec gzip -9 {} \;
+ for i in $(find . -type l) ; do ln -s $(readlink $i).gz $i.gz ; rm $i ; done
+)
+
+mkdir -p $PKG/usr/doc/file-$VERSION
+cp -a \
+ AUTHORS COPYING INSTALL MAINT NEWS README TODO \
+ $PKG/usr/doc/file-$VERSION
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+# Build the package:
+cd $PKG
+/sbin/makepkg -l y -c n $TMP/file-$VERSION-$ARCH-$BUILD.txz
+
diff --git a/source.local/a/file/file.crdaregbin.magic.gz b/source.local/a/file/file.crdaregbin.magic.gz
new file mode 100644
index 0000000..bc69a4f
--- /dev/null
+++ b/source.local/a/file/file.crdaregbin.magic.gz
Binary files differ
diff --git a/source.local/a/file/file.etc.file.diff.gz b/source.local/a/file/file.etc.file.diff.gz
new file mode 100644
index 0000000..6686f5c
--- /dev/null
+++ b/source.local/a/file/file.etc.file.diff.gz
Binary files differ
diff --git a/source.local/a/file/file.quiet.diff.gz b/source.local/a/file/file.quiet.diff.gz
new file mode 100644
index 0000000..5baf0d8
--- /dev/null
+++ b/source.local/a/file/file.quiet.diff.gz
Binary files differ
diff --git a/source.local/a/file/file.short.diff.gz b/source.local/a/file/file.short.diff.gz
new file mode 100644
index 0000000..aff3d7e
--- /dev/null
+++ b/source.local/a/file/file.short.diff.gz
Binary files differ
diff --git a/source.local/a/file/file.xz.magic.gz b/source.local/a/file/file.xz.magic.gz
new file mode 100644
index 0000000..89d8281
--- /dev/null
+++ b/source.local/a/file/file.xz.magic.gz
Binary files differ
diff --git a/source.local/a/file/file.zisofs.magic.gz b/source.local/a/file/file.zisofs.magic.gz
new file mode 100644
index 0000000..d229703
--- /dev/null
+++ b/source.local/a/file/file.zisofs.magic.gz
Binary files differ
diff --git a/source.local/a/file/slack-desc b/source.local/a/file/slack-desc
new file mode 100644
index 0000000..d405cb8
--- /dev/null
+++ b/source.local/a/file/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description. Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in. You must
+# make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':'.
+
+ |-----handy-ruler------------------------------------------------------|
+file: file (a utility to determine file type)
+file:
+file: This is Ian F. Darwin's 'file' utility, used to identify files.
+file: Christos Zoulas has been file's maintainer since 1994.
+file:
+file: Home FTP site: ftp://ftp.astron.com/pub/file/
+file:
+file:
+file:
+file:
+file: