diff options
author | Eric Hameleers <alien@slackware.com> | 2009-12-02 22:16:01 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2009-12-02 22:16:01 +0000 |
commit | 57cf52db63f9217c7cd753dbce83b204cedc6f94 (patch) | |
tree | 8e2224f702e2cb07f07a8d5d6bda4bad0e1730ce /potrace | |
parent | 38ebfa04fbaa800d5c99d3a1e085ca96320ff689 (diff) | |
download | asb-57cf52db63f9217c7cd753dbce83b204cedc6f94.tar.gz asb-57cf52db63f9217c7cd753dbce83b204cedc6f94.tar.xz |
Polished the script for Slackware 13.0
Diffstat (limited to 'potrace')
-rwxr-xr-x | potrace/build/potrace.SlackBuild | 85 |
1 files changed, 33 insertions, 52 deletions
diff --git a/potrace/build/potrace.SlackBuild b/potrace/build/potrace.SlackBuild index d8577d80..4feb6bb7 100755 --- a/potrace/build/potrace.SlackBuild +++ b/potrace/build/potrace.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 @@ -32,8 +32,10 @@ # Changelog: # 1.8-1: 08/Aug/2008 by Eric Hameleers <alien@slackware.com> # * Initial build. +# 1.8-2: 03/dec/2009 by Eric Hameleers <alien@slackware.com> +# * Slackware 13 packages built. # -# Run 'sh potrace.SlackBuild --cleanup' to build a Slackware package. +# Run 'sh potrace.SlackBuild' to build a Slackware package. # The package (.tgz) plus descriptive .txt file are created in /tmp . # Install using 'installpkg'. # @@ -43,8 +45,7 @@ PRGNAM=potrace VERSION=${VERSION:-1.8} -ARCH=${ARCH:-i486} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-alien} DOCS="AUTHORS COPYING ChangeLog NEWS README*" @@ -64,6 +65,16 @@ SRCURL="http://potrace.sourceforge.net/download/${PRGNAM}-${VERSION}.tar.gz" ## --- with a little luck, you won't have to edit below this point --- ## ## +# 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 + # Exit the script on errors: set -e trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR @@ -71,29 +82,16 @@ 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" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; - powerpc) SLKCFLAGS="-O2" - SLKLDFLAGS=""; LIBDIRSUFFIX="" - ;; 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 +133,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,26 +142,20 @@ echo Building ... LDFLAGS="$SLKLDFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ CFLAGS="$SLKCFLAGS" \ -./configure --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --localstatedir=/var \ - --sysconfdir=/etc \ - --enable-metric \ - --enable-a4 \ - --program-prefix="" \ - --program-suffix="" \ - --build=$ARCH-slackware-linux \ - 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log -make 2>&1 | tee $OUTPUT/make-${PRGNAM}.log +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --localstatedir=/var \ + --sysconfdir=/etc \ + --enable-metric \ + --enable-a4 \ + --program-prefix= \ + --program-suffix= \ + --build=$ARCH-slackware-linux \ + 2>&1 | tee $OUTPUT/configure-${PRGNAM}.log -# Install all the needed stuff to the package dir -# Use installwatch if available, to produce a logfile of the installation -# process that is more easily readable: -if $(which installwatch > /dev/null 2>&1); then - installwatch -o $OUTPUT/install-${PRGNAM}.log make DESTDIR=$PKG install -else - make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log -fi +make 2>&1 | tee $OUTPUT/make-${PRGNAM}.log +make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log # Add documentation: mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION @@ -182,11 +170,9 @@ if [ -d $PKG/usr/man ]; then for i in $(find $PKG/usr/man -type l -name "*.?") ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done fi -# 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 - +# Strip binaries (if any): +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 @@ -203,8 +189,3 @@ md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz > ${PRGNAM}-${VERSION}-${ cd - cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt -# Clean up the extra stuff: -if [ "$P1" = "--cleanup" ]; then - rm -rf $TMP/tmp-$PRGNAM - rm -rf $PKG -fi |