From ad09bd4d3ef3d5b9568233c0ac3fbcc7740e3144 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Sat, 18 Aug 2007 15:26:06 +0000 Subject: Update the script --- libdvdnav/build/libdvdnav.SlackBuild | 117 +++++++++++------------------------ 1 file changed, 35 insertions(+), 82 deletions(-) diff --git a/libdvdnav/build/libdvdnav.SlackBuild b/libdvdnav/build/libdvdnav.SlackBuild index 5afa009d..f17f6668 100755 --- a/libdvdnav/build/libdvdnav.SlackBuild +++ b/libdvdnav/build/libdvdnav.SlackBuild @@ -1,6 +1,23 @@ #!/bin/sh # $Id$ -# Copyright (c) 2006 Eric Hameleers +# Copyright (c) 2006,2007 Eric Hameleers +# 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 @@ -13,6 +30,8 @@ # Changelog: # 0.1.10-1: 07/Nov/2006 by Eric Hameleers # * Initial build. +# 0.1.10-2: 18/aug/2007 by Eric Hameleers +# * Update the SlackBuild. # # Run 'sh libdvdnav.SlackBuild --cleanup' to build a Slackware package. # The package (.tgz) plus descriptive .txt file are created in /tmp . @@ -26,7 +45,7 @@ PRGNAM=libdvdnav VERSION=${VERSION:-0.1.10} ARCH=${ARCH:-i486} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} DOCS="AUTHORS ChangeLog COPYING INSTALL NEWS README TODO" @@ -40,7 +59,6 @@ TMP=${TMP:-/tmp/build} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} -# Input URL: http://dl.sourceforge.net/sourceforge/dvd/libdvdnav-0.1.10.tar.gz SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz" SRCURL="http://dl.sourceforge.net/sourceforge/dvd/${PRGNAM}-${VERSION}.tar.gz" @@ -83,38 +101,20 @@ 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 [ "$PKG" = "" -o "$PKG" = "/" ] ; then - echo "Please provide a sane value for the variable 'PKG'." - exit 1 -elif [ ! -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 --- +mkdir -p $TMP/tmp-$PRGNAM # location to build the source +rm -rf $TMP/tmp-$PRGNAM/* # By default we 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 + wget -nv --connect-timeout=30 -O "${SOURCE}" "${SRCURL}" || true if [ $? -ne 0 ]; then echo "Downloading '`basename ${SOURCE}`' failed... aborting the build." mv -f "${SOURCE}" "${SOURCE}".FAIL @@ -131,53 +131,24 @@ if [ "$P1" == "--download" ]; then exit 0 fi -# --- PACKAGE BUILDING --- - +# Package building: 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 - tar -xjvf ${SOURCE} || true -elif `file ${SOURCE} | grep -qi ": zip"`; then - unzip ${SOURCE} || true -elif `file ${SOURCE} | grep -qi ": 7-zip"`; then - 7za -x ${SOURCE} || true -else - tar -xzvf ${SOURCE} || true -fi -if [ $? -ne 0 ]; then - echo "Error in unpacking '${SOURCE}!' Aborting..." - exit $? -fi -if [ -d ${PRGNAM}-${VERSION} ]; then - cd ${PRGNAM}-${VERSION} + tar -xjvf ${SOURCE} else - cd ${PRGNAM}* # a little less specific + tar -xzvf ${SOURCE} fi - +cd ${PRGNAM}-${VERSION} chown -R root.root * find . -perm 777 -exec chmod 755 {} \; find . -perm 666 -exec chmod 644 {} \; - -# --- BUILDING --- - echo Building ... - ./autogen.sh LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ @@ -187,13 +158,11 @@ CFLAGS="$SLKCFLAGS" \ --sysconfdir=/etc \ --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 @@ -202,10 +171,7 @@ else make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log fi - - -# --- DOCUMENTATION --- - +# Add documentation: mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/* @@ -223,14 +189,7 @@ chmod -R a-w $PKG/usr/doc/$PRGNAM-$VERSION/* 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 @@ -240,9 +199,6 @@ if [ -f $SRCDIR/slack-required ]; then cat $SRCDIR/slack-required > $PKG/install/slack-required fi - -# --- BUILDING --- - # Build the package: cd $PKG makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz \ @@ -253,9 +209,6 @@ if [ -f $PKG/install/slack-required ]; then cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.dep fi - -# --- CLEANUP --- - # Clean up the extra stuff: if [ "$P1" = "--cleanup" ]; then rm -rf $TMP/tmp-$PRGNAM -- cgit v1.2.3-65-gdbad