diff options
author | Eric Hameleers <alien@slackware.com> | 2009-09-15 12:17:35 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2009-09-15 12:17:35 +0000 |
commit | 3d80650e307a11a3ad0e1d9f92d7b92828bf6dd2 (patch) | |
tree | 9a6a12c325c3364fc7e00d721ee6cedef79f3144 /obconf | |
parent | d74c7cb7b1eff2e5bdbb941e4d6f04bc2f6e15f5 (diff) | |
download | asb-3d80650e307a11a3ad0e1d9f92d7b92828bf6dd2.tar.gz asb-3d80650e307a11a3ad0e1d9f92d7b92828bf6dd2.tar.xz |
Some modernisations
Diffstat (limited to 'obconf')
-rwxr-xr-x | obconf/build/obconf.SlackBuild | 58 |
1 files changed, 21 insertions, 37 deletions
diff --git a/obconf/build/obconf.SlackBuild b/obconf/build/obconf.SlackBuild index f8deac79..d58af010 100755 --- a/obconf/build/obconf.SlackBuild +++ b/obconf/build/obconf.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh # $Id$ -# Copyright (c) 2008 Eric Hameleers <alien@slackware.com> +# Copyright (c) 2008-2009 Eric Hameleers, Eindhoven, NL # All rights reserved. # # Permission to use, copy, modify, and distribute this software for @@ -33,7 +33,7 @@ # 2.0.3-1: 05/Aug/2008 by Eric Hameleers <alien@slackware.com> # * Initial build. # -# Run 'sh obconf.SlackBuild --cleanup' to build a Slackware package. +# Run 'sh obconf.SlackBuild' to build a Slackware package. # The package (.tgz) plus descriptive .txt file are created in /tmp . # Install using 'installpkg'. # @@ -71,15 +71,8 @@ trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR set -u P1=${1:-1} -# Slackware 11 and up need other option (gcc > 3.3.x) -if [ $(gcc -dumpversion | tr -d '.' |cut -c 1-2) -gt 33 ]; then - MOPT=tune -else - MOPT=cpu -fi - case "$ARCH" in - i486) SLKCFLAGS="-O2 -march=i486 -m${MOPT}=i686" + i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; s390) SLKCFLAGS="-O2" @@ -91,9 +84,6 @@ case "$ARCH" in x86_64) SLKCFLAGS="-O2 -fPIC" SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" ;; - athlon-xp) SLKCFLAGS="-march=athlon-xp -O3 -pipe -fomit-frame-pointer" - SLKLDFLAGS=""; LIBDIRSUFFIX="" - ;; esac # Create working directories: @@ -135,11 +125,7 @@ echo "++" cd $TMP/tmp-$PRGNAM echo "Extracting the source archive(s) for $PRGNAM..." -if $(file ${SOURCE} | grep -q ": bzip2"); then - tar -xjvf ${SOURCE} -elif $(file ${SOURCE} | grep -q ": gzip"); then - tar -xzvf ${SOURCE} -fi +tar -xvf ${SOURCE} cd ${PRGNAM}-${VERSION} chown -R root:root . chmod -R u+w,go+r-w,a-s . @@ -148,14 +134,15 @@ echo Building ... LDFLAGS="$SLKLDFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ CFLAGS="$SLKCFLAGS" \ -./configure --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --localstatedir=/var \ - --sysconfdir=/etc \ - --program-prefix="" \ - --program-suffix="" \ - --build=$ARCH-slackware-linux \ - 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --program-prefix= \ + --program-suffix= \ + --build=$ARCH-slackware-linux \ + 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log make 2>&1 | tee $OUTPUT/make-${PRGNAM}.log # Install all the needed stuff to the package dir @@ -172,7 +159,7 @@ fi cat <<EOT >> $PKG/install/doinst.sh # Update the desktop database: if [ -x usr/bin/update-desktop-database ]; then - chroot . /usr/bin/update-desktop-database /usr/share/applications > /dev/null 2>&1 + chroot . /usr/bin/update-desktop-database usr/share/applications > /dev/null 2>&1 fi # Update the mime database: if [ -x usr/bin/update-mime-database ]; then @@ -184,15 +171,17 @@ EOT # Add documentation: mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true -cp -a $SRCDIR/$(basename $0) $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cat $SRCDIR/$(basename $0) | sed \ + -e "/^VERSION=/s/:-.*}/:-$VERSION}/" \ + -e "/^ARCH=/s/:-.*}/:-$ARCH}/" \ + -e "/^BUILD=/s/:-.*}/:-$BUILD}/" \ + > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild chown -R root:root $PKG/usr/doc/$PRGNAM-$VERSION find $PKG/usr/doc -type f -exec chmod 644 {} \; # Strip binaries: -cd $PKG -find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true -cd - +find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true # Add a package description: mkdir -p $PKG/install @@ -215,8 +204,3 @@ if [ -f $PKG/install/slack-required ]; then cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.dep fi -# Clean up the extra stuff: -if [ "$P1" = "--cleanup" ]; then - rm -rf $TMP/tmp-$PRGNAM - rm -rf $PKG -fi |