summaryrefslogtreecommitdiff
path: root/source/a/file
diff options
context:
space:
mode:
authorPatrick J Volkerding <volkerdi@slackware.com>2016-06-30 20:26:57 +0000
committerEric Hameleers <alien@slackware.com>2018-05-31 23:31:18 +0200
commitd31c50870d0bee042ce660e445c9294a59a3a65b (patch)
tree6bfc0de3c95267b401b620c2c67859557dc60f97 /source/a/file
parent76fc4757ac91ac7947a01fb7b53dddf9a78a01d1 (diff)
downloadcurrent-d31c50870d0bee042ce660e445c9294a59a3a65b.tar.gz
Slackware 14.2slackware-14.2
Thu Jun 30 20:26:57 UTC 2016 Slackware 14.2 x86_64 stable is released! The long development cycle (the Linux community has lately been living in "interesting times", as they say) is finally behind us, and we're proud to announce the release of Slackware 14.2. The new release brings many updates and modern tools, has switched from udev to eudev (no systemd), and adds well over a hundred new packages to the system. Thanks to the team, the upstream developers, the dedicated Slackware community, and everyone else who pitched in to help make this release a reality. The ISOs are off to be replicated, a 6 CD-ROM 32-bit set and a dual-sided 32-bit/64-bit x86/x86_64 DVD. Please consider supporting the Slackware project by picking up a copy from store.slackware.com. We're taking pre-orders now, and offer a discount if you sign up for a subscription. Have fun! :-)
Diffstat (limited to 'source/a/file')
-rw-r--r--source/a/file/doinst.sh5
-rwxr-xr-xsource/a/file/file.SlackBuild51
-rw-r--r--source/a/file/recompile_magic.mgc.sh14
3 files changed, 44 insertions, 26 deletions
diff --git a/source/a/file/doinst.sh b/source/a/file/doinst.sh
new file mode 100644
index 00000000..d9c7f047
--- /dev/null
+++ b/source/a/file/doinst.sh
@@ -0,0 +1,5 @@
+# Compile /etc/file/magic.mgc:
+chroot . /usr/bin/file --compile 1> /dev/null 2> /dev/null
+if [ -r magic.mgc ]; then
+ mv magic.mgc etc/file
+fi
diff --git a/source/a/file/file.SlackBuild b/source/a/file/file.SlackBuild
index 2435c5f0..d6ed07ee 100755
--- a/source/a/file/file.SlackBuild
+++ b/source/a/file/file.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
-# Copyright 2005-2008, 2009, 2010, 2013 Patrick J. Volkerding, Sebeka, MN, USA
+# Copyright 2005-2008, 2009, 2010, 2013, 2015 Patrick J. Volkerding, Sebeka, MN, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -28,15 +28,15 @@ NUMJOBS=${NUMJOBS:--j7}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) export ARCH=i486 ;;
+ i?86) export ARCH=i586 ;;
arm*) export ARCH=arm ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) export ARCH=$( uname -m ) ;;
esac
fi
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
@@ -106,30 +106,28 @@ cat $(which libtool) > libtool
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
+# Ignore for now - still labeled as experimental
+# Actually, let's ignore it until something needs it :) <volkerdi>
+#cd python/
+# python setup.py build
+# python setup.py install --root=$PKG
+#cd ..
+
# Seems --disable-static has been ignored lately:
rm -f $PKG/usr/lib${LIBDIRSUFFIX}/libmagic.a
-# Update: We're going to use magic.mgc now as the flat files cause
-# libmagic crashes with versions newer than file-5.11. Maybe that
-# wasn't being tested as well... in any case, using magic.mgc works.
-#
-#
-## 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.
+# Install the flat files.
+# We'll generate /etc/file/magic.mgc in the doinst.sh.
+rm -f $PKG/etc/file/magic.mgc
+mkdir -p $PKG/etc/file/magic
+cp -a magic/Magdir/* $PKG/etc/file/magic
+
+# Add a script to recompile the flat files in the obvious location.
+# The package install script will compile the flat files initially.
+cp -a $CWD/recompile_magic.mgc.sh.gz $PKG/etc/file
+gzip -d $PKG/etc/file/recompile_magic.mgc.sh.gz
+chown root:root $PKG/etc/file/recompile_magic.mgc.sh
+chmod 755 $PKG/etc/file/recompile_magic.mgc.sh
# IMHO, moving this sort of thing does not make sense.
# We'll support both the traditional and new locations.
@@ -148,11 +146,12 @@ find $PKG | xargs file | grep -e "executable" -e "shared object" \
mkdir -p $PKG/usr/doc/file-$VERSION
cp -a \
- AUTHORS COPYING INSTALL MAINT NEWS README TODO \
+ AUTHORS COPYING* INSTALL MAINT NEWS README* TODO \
$PKG/usr/doc/file-$VERSION
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
+zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh
# Build the package:
cd $PKG
diff --git a/source/a/file/recompile_magic.mgc.sh b/source/a/file/recompile_magic.mgc.sh
new file mode 100644
index 00000000..2ae5ca39
--- /dev/null
+++ b/source/a/file/recompile_magic.mgc.sh
@@ -0,0 +1,14 @@
+#!/bin/sh
+#
+# Recompile the /etc/file/magic.mgc database.
+# This should be done after any additions or changes to the files
+# in /etc/file/magic/.
+
+if [ ! "$UID" = "0" ]; then
+ echo "Error: must be root to recompile the system magic.mgc"
+ exit 1
+fi
+
+cd /etc/file
+/usr/bin/file --compile
+