diff options
Diffstat (limited to 'source/a/module-init-tools/module-init-tools.SlackBuild')
-rwxr-xr-x | source/a/module-init-tools/module-init-tools.SlackBuild | 71 |
1 files changed, 31 insertions, 40 deletions
diff --git a/source/a/module-init-tools/module-init-tools.SlackBuild b/source/a/module-init-tools/module-init-tools.SlackBuild index d69b43bc..9b390d11 100755 --- a/source/a/module-init-tools/module-init-tools.SlackBuild +++ b/source/a/module-init-tools/module-init-tools.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh -# Copyright 2008, 2009 Patrick J. Volkerding, Sebeka, MN, USA +# Copyright 2008, 2009, 2010 Patrick J. Volkerding, Sebeka, MN, USA # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -21,12 +21,21 @@ # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -VERSION=3.6 -ARCH=${ARCH:-x86_64} -BUILD=${BUILD:-2} +VERSION=${VERSION:-$(echo module-init-tools-*.tar.?z* | cut -d - -f 4 | rev | cut -f 3- -d . | rev)} +BUILD=${BUILD:-1} NUMJOBS=${NUMJOBS:--j7} +# 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 + CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-module-init-tools @@ -36,7 +45,7 @@ mkdir -p $TMP $PKG cd $TMP rm -rf module-init-tools-$VERSION -tar xvf $CWD/module-init-tools-$VERSION.tar.bz2 || exit 1 +tar xvf $CWD/module-init-tools-$VERSION.tar.?z* || exit 1 cd module-init-tools-$VERSION || exit 1 chown -R root:root . find . \ @@ -45,20 +54,14 @@ find . \ \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ -exec chmod 644 {} \; -# Look for /etc/modprobe.d/ first rather than bailing on the idea if -# /etc/modprobe.conf exists. IMHO, this is a better default behavior -# because it allows /etc/modprobe.conf to remain behind if something -# still looks there, and allows a smoother transition towards using -# /etc/modprobe.d/ instead. -zcat $CWD/modprobe.favor.etc.modprobe.d.diff.gz | patch -p1 --verbose || exit 1 - # Exclude *.{old,new,bak} files (and a few others that obviously aren't # valid for this... Thanks to Marco d'Itri for the patch that it's based on -zcat $CWD/modprobe.ignore_some_suffixes.diff.gz | patch -p1 --verbose || exit 1 +zcat $CWD/modprobe.ignore_some_suffixes.diff.gz | patch -p1 || exit 1 -# We get (pointless) errors in early stages of the boot if modprobe checks for -# a mounted /sys before it actually gets mounted: -zcat $CWD/modprobe.no_sys_check.diff.gz | patch -p1 --verbose || exit 1 +# Using modprobe.conf still works, so don't whine about it, +# especially since there's nothing in /etc/modprobe.conf +# except for comments explaining not to use it. +zcat $CWD/modprobe.quit.whining.about.modprobe.conf.diff.gz | patch -p1 || exit 1 # Using --bindir=/sbin to make lsmod go there too CFLAGS= \ @@ -73,49 +76,37 @@ CFLAGS= \ make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 -# We don't need this -rm -f $PKG/sbin/generate-modprobe.conf +# Create the config directory just in case +mkdir -p $PKG/etc/modprobe.d/ -# Links lsmod into /bin +# Link lsmod into /bin mkdir -p $PKG/bin ( cd $PKG/bin ; ln -sf /sbin/lsmod . ) -# Add manpage symlink for modprobe.d -( cd $PKG/usr/man/man5 - if [ -f modprobe.conf.5 -a ! -e modprobe.d.5 ]; then - ln -sf modprobe.conf.5 modprobe.d.5 - fi -) - # Compress manpages ( cd $PKG/usr/man 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/etc/modprobe.d/ -cat << EOF > $PKG/etc/modprobe.conf.new -# /etc/modprobe.conf (old location for Linux 2.6+ config) -# -# The use of this config file is deprecated. -# Instead, create files in the /etc/modprobe.d/ directory -# containing modprobe options. -# -# For more information, see "man modprobe.conf". -EOF - find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null mkdir -p $PKG/usr/doc/module-init-tools-$VERSION -# Most of these are out of date cp -a \ - AUTHORS CODING COPYING FAQ HACKING INSTALL NEWS README TODO \ + AUTHORS CODING COPYING FAQ README TODO \ $PKG/usr/doc/module-init-tools-$VERSION +# 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/*-$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 -zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh cd $PKG /sbin/makepkg -l y -c n $TMP/module-init-tools-$VERSION-$ARCH-$BUILD.txz |