diff options
author | Eric Hameleers <alien@slackware.com> | 2008-03-13 09:48:56 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2008-03-13 09:48:56 +0000 |
commit | bace7a179448bdd612363cfb463c2137e6930e7f (patch) | |
tree | 1ab373055c20b83be180ac6ae03a33a06604e92e /libsndfile | |
parent | d3bf20e4810cf9321dc17ec056d22cbad91542fc (diff) | |
download | asb-bace7a179448bdd612363cfb463c2137e6930e7f.tar.gz asb-bace7a179448bdd612363cfb463c2137e6930e7f.tar.xz |
Apply patch to allow building against flac > 1.1.2 (for Slackware 12.1)
Diffstat (limited to 'libsndfile')
-rwxr-xr-x | libsndfile/build/libsndfile.SlackBuild | 129 |
1 files changed, 51 insertions, 78 deletions
diff --git a/libsndfile/build/libsndfile.SlackBuild b/libsndfile/build/libsndfile.SlackBuild index 65396475..3632a523 100755 --- a/libsndfile/build/libsndfile.SlackBuild +++ b/libsndfile/build/libsndfile.SlackBuild @@ -1,7 +1,25 @@ #!/bin/sh # $Id$ -# Distributed under the terms of the GNU General Public License, Version 2 -# Copyright (c) 2006 Eric Hameleers <alien@slackware.com> +# Copyright (c) 2006-2008 Eric Hameleers <alien@slackware.com> +# All rights reserved. +# +# Permission to use, copy, modify, and distribute this software for +# any purpose with or without fee is hereby granted, provided that +# the above copyright notice and this permission notice appear in all +# copies. +# +# THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED 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 AUTHORS AND COPYRIGHT HOLDERS AND THEIR +# CONTRIBUTORS 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. # ----------------------------------------------------------------------------- # # Slackware SlackBuild script @@ -12,10 +30,12 @@ # URL: http://www.mega-nerd.com/libsndfile/ # Needs: # Changelog: -# 1.0.14-1: 03/mrt/2006 by Eric Hameleers <alien@slackware.com> +# 1.0.14-1: 03/mrt/2006 by Eric Hameleers <alien@slackware.com> # * Initial build. -# 1.0.17-1: 17/Dec/2006 by Eric Hameleers <alien@slackware.com> +# 1.0.17-1: 17/Dec/2006 by Eric Hameleers <alien@slackware.com> # * Update, also for a rework of the SlackBuild +# 1.0.17-2: 13/Mar/2008 by Eric Hameleers <alien@slackware.com> +# * Apply patch for flac > 1.1.2 # # Run 'sh libsndfile.SlackBuild --cleanup' to build a Slackware package. # The package (.tgz) plus descriptive .txt file are created in /tmp . @@ -23,13 +43,12 @@ # # ----------------------------------------------------------------------------- -# --- INIT --- # Set initial variables: PRGNAM=libsndfile VERSION=${VERSION:-1.0.17} ARCH=${ARCH:-i486} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} DOCS="AUTHORS COPYING ChangeLog INSTALL NEWS README TODO" @@ -86,36 +105,22 @@ case "$ARCH" in ;; esac -if [ ! -d $TMP/tmp-$PRGNAM ]; then - mkdir -p $TMP/tmp-$PRGNAM # location to build the source -elif [ "$P1" != "--oldbuild" ]; then - # If the "--oldbuild" parameter is present, we keep - # the old build files and continue; - # By default we remove the remnants of previous build and continue: - rm -rf $TMP/tmp-$PRGNAM/* -fi - -if [ ! -d $PKG ]; then - mkdir -p $PKG # place for the package to be built -else - rm -rf $PKG/* # We always erase old package's contents: -fi - -if [ ! -d $OUTPUT ]; then - mkdir -p $OUTPUT # place for the package to be saved -fi - - -# --- SOURCE FILE AVAILABILITY --- +# Create working directories: +mkdir -p $TMP/tmp-$PRGNAM # location to build the source +rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build +mkdir -p $PKG # place for the package to be built +rm -rf $PKG/* # We always erase old package's contents +mkdir -p $OUTPUT # place for the package to be saved +# Source file availability: if ! [ -f ${SOURCE} ]; then if ! [ "x${SRCURL}" == "x" ]; then # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/`basename $SOURCE`" echo "Source '`basename ${SOURCE}`' not available yet..." echo "Will download file to `dirname $SOURCE`" - wget -nv -O "${SOURCE}" "${SRCURL}" || true - if [ $? -ne 0 ]; then + wget -nv -T 20 -O "${SOURCE}" "${SRCURL}" || true + if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then echo "Downloading '`basename ${SOURCE}`' failed... aborting the build." mv -f "${SOURCE}" "${SOURCE}".FAIL exit 1 @@ -137,37 +142,26 @@ echo "++" echo "|| $PRGNAM-$VERSION" echo "++" -cd $PKG - -# Explode the package framework: -if [ -f $SRCDIR/_$PRGNAM.tar.gz ]; then - explodepkg $SRCDIR/_$PRGNAM.tar.gz -fi - cd $TMP/tmp-$PRGNAM - - -# --- TARBALL EXTRACTION,PATCH,MODIFY --- - echo "Extracting the source archive(s) for $PRGNAM..." -if `file ${SOURCE} | grep -q ": bzip2"`; then +if $(file ${SOURCE} | grep -q ": bzip2"); then tar -xjvf ${SOURCE} -else +elif $(file ${SOURCE} | grep -q ": gzip"); then tar -xzvf ${SOURCE} fi cd ${PRGNAM}-${VERSION} - -chown -R root.root * -find . -perm 777 -exec chmod 755 {} \; -find . -perm 666 -exec chmod 644 {} \; - - -# --- BUILDING --- +# Apply patch for flac > 1.1.2 where the API changed: +if [ $(flac -v | cut -f2 -d' ' | tr -d '.') -gt 112 ]; then + patch -p1 < $SRCDIR/${PRGNAM}_flac.patch \ + 2>&1 | tee $OUTPUT/patch-${PRGNAM}.log +fi +chown -R root.root . +chmod -R u+w,go+r-w,a-s . echo Building ... - LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ ./configure --prefix=/usr \ --libdir=/usr/lib${LIBDIRSUFFIX} \ --localstatedir=/var \ @@ -175,62 +169,44 @@ CFLAGS="$SLKCFLAGS" \ --disable-static \ --program-prefix="" \ --program-suffix="" \ - $ARCH-slackware-linux \ + --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 -# # 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 +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 - - -# --- DOCUMENTATION --- - +# Add package documentation: mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true mv $PKG/usr/share/doc/libsndfile1-dev/html \ $PKG/usr/doc/$PRGNAM-$VERSION rm -rf $PKG/usr/share/doc -chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/* +find $PKG/usr/doc -type f -exec chmod 644 {} \; -# Move incorrectly installed man pages, if any -[ -d $PKG/usr/share/man ] && \ - mv $PKG/usr/share/man $PKG/usr/ && rmdir $PKG/usr/share || true -# Compress the man page(s) +# Compress the man page(s): [ -d $PKG/usr/man ] && \ find $PKG/usr/man -type f -name "*.?" -exec gzip -9f {} \; -# Strip binaries +# Strip binaries: ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) - -# --- OWNERSHIP, RIGHTS --- - -chmod -R o-w $PKG - - -# --- PACKAGE DESCRIPTION --- - +# Add a package description: mkdir -p $PKG/install cat $SRCDIR/slack-desc > $PKG/install/slack-desc if [ -f $SRCDIR/doinst.sh ]; then cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh fi - -# --- BUILDING --- - # Build the package: cd $PKG makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz \ @@ -238,9 +214,6 @@ makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz (cd $OUTPUT && md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz.md5) cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.txt - -# --- CLEANUP --- - # Clean up the extra stuff: if [ "$P1" = "--cleanup" ]; then rm -rf $TMP/tmp-$PRGNAM |