summaryrefslogtreecommitdiffstats
path: root/id3lib
diff options
context:
space:
mode:
author Eric Hameleers <alien@slackware.com>2008-06-21 19:20:49 +0000
committer Eric Hameleers <alien@slackware.com>2008-06-21 19:20:49 +0000
commit5edbc5e86b9fabfb9bb15d6372dcab6e51c63237 (patch)
treec66024b768566bd6507dbba3e88ae8e75541f49c /id3lib
parent76d5bffc7f6f1403c10a51a5cd84053e0bc02f90 (diff)
downloadasb-5edbc5e86b9fabfb9bb15d6372dcab6e51c63237.tar.gz
asb-5edbc5e86b9fabfb9bb15d6372dcab6e51c63237.tar.xz
Add TAG=alien; better SRCDIR; add SlackBuild to docdir
Diffstat (limited to 'id3lib')
-rwxr-xr-xid3lib/build/id3lib.SlackBuild78
1 files changed, 33 insertions, 45 deletions
diff --git a/id3lib/build/id3lib.SlackBuild b/id3lib/build/id3lib.SlackBuild
index cd8e03a1..17873649 100755
--- a/id3lib/build/id3lib.SlackBuild
+++ b/id3lib/build/id3lib.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/sh
# $Id$
-# Copyright (c) 2007 Eric Hameleers <alien@slackware.com>
+# Copyright (c) 2007-2008 Eric Hameleers <alien@slackware.com>
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for
@@ -34,6 +34,8 @@
# * Initial build.
# 3.8.3-2: 28/May/2007 by Eric Hameleers <alien@slackware.com>
# * Revamped SlackBuild
+# 3.8.3-3: 21/jun/2008 by Eric Hameleers <alien@slackware.com>
+# * Revamped SlackBuild again
#
# Run 'sh id3lib.SlackBuild --cleanup' to build a Slackware package.
# The package (.tgz) plus descriptive .txt file are created in /tmp .
@@ -46,23 +48,21 @@
PRGNAM=id3lib
VERSION=${VERSION:-3.8.3}
ARCH=${ARCH:-i486}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
+TAG=${TAG:-alien}
DOCS="AUTHORS COPYING ChangeLog HISTORY NEWS README THANKS TODO doc/*"
# Where do we look for sources?
-CWD=`pwd`
-SRCDIR=`dirname $0`
-[ "${SRCDIR:0:1}" == "." ] && SRCDIR=${CWD}/${SRCDIR}
+SRCDIR=$(cd $(dirname $0); pwd)
# Place to build (TMP) package (PKG) and output (OUTPUT) the program:
TMP=${TMP:-/tmp/build}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-# Input URL: http://dl.sourceforge.net/id3lib/id3lib-3.8.3.tar.gz
SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.tar.gz"
-SRCURL="http://dl.sourceforge.net/${PRGNAM}/${PRGNAM}-${VERSION}.tar.gz"
+SRCURL="http://downloads.sourceforge.net/${PRGNAM}/${PRGNAM}-${VERSION}.tar.gz"
##
## --- with a little luck, you won't have to edit below this point --- ##
@@ -76,16 +76,13 @@ 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
+if [ $(gcc -dumpversion | tr -d '.' |cut -c 1-2) -gt 33 ]; then
MOPT=tune
else
MOPT=cpu
fi
case "$ARCH" in
- i386) SLKCFLAGS="-O2 -march=i386 -m${MOPT}=i686"
- SLKLDFLAGS=""; LIBDIRSUFFIX=""
- ;;
i486) SLKCFLAGS="-O2 -march=i486 -m${MOPT}=i686"
SLKLDFLAGS=""; LIBDIRSUFFIX=""
;;
@@ -104,40 +101,27 @@ case "$ARCH" in
esac
# Create working directories:
-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
+mkdir -p $OUTPUT # place for the package to be saved
+mkdir -p $TMP/tmp-$PRGNAM # location to build the source
+mkdir -p $PKG # place for the package to be built
+rm -rf $PKG/* # always erase old package's contents
+rm -rf $TMP/tmp-$PRGNAM/* # remove the remnants of previous build
# 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 --connect-timeout=30 -O "${SOURCE}" "${SRCURL}" || true
+ [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)"
+ echo "Source '$(basename ${SOURCE})' not available yet..."
+ echo "Will download file to $(dirname $SOURCE)"
+ wget -nv -T 30 -O "${SOURCE}" "${SRCURL}" || true
if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then
- echo "Downloading '`basename ${SOURCE}`' failed... aborting the build."
+ echo "Downloading '$(basename ${SOURCE})' failed... aborting the build."
mv -f "${SOURCE}" "${SOURCE}".FAIL
exit 1
fi
else
- echo "File '`basename ${SOURCE}`' not available... aborting the build."
+ echo "File '$(basename ${SOURCE})' not available... aborting the build."
exit 1
fi
fi
@@ -156,20 +140,24 @@ echo "++"
cd $TMP/tmp-$PRGNAM
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}
-elif `file ${SOURCE} | grep -q ": gzip"`; then
+elif $(file ${SOURCE} | grep -q ": gzip"); then
tar -xzvf ${SOURCE}
fi
chown -R root:root *
chmod -R u+w,go+r-w,a-s *
cd ${PRGNAM}-${VERSION}
-( cd doc && patch -p0 < $SRCDIR/${PRGNAM}_Doxyfile.patch )
+patch -p1 < $SRCDIR/${PRGNAM}_utf8.patch 2>&1 | tee $OUTPUT/patch-$PRGNAM.log
+( cd doc && patch -p0 < $SRCDIR/${PRGNAM}_Doxyfile.patch \
+ 2>&1 | tee -a $OUTPUT/patch-$PRGNAM.log
+)
echo Building ...
LDFLAGS="$SLKLDFLAGS" \
CFLAGS="$SLKCFLAGS" \
+CXXFLAGS="$SLKCFLAGS" \
./configure --prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--localstatedir=/var \
@@ -182,12 +170,10 @@ CFLAGS="$SLKCFLAGS" \
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
@@ -208,7 +194,9 @@ for i in doc/ examples/; do \
# 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/*
+cp -a $SRCDIR/$(basename $0) $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 {} \;
# Remove the massive amount of API docs
rm -rf $PKG/usr/doc/$PRGNAM-$VERSION/api
@@ -230,11 +218,11 @@ cat $SRCDIR/slack-desc > $PKG/install/slack-desc
# Build the package:
cd $PKG
-makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
+makepkg --linkadd y --chown n $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz 2>&1 | tee $OUTPUT/makepkg-${PRGNAM}.log
cd $OUTPUT
-md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.tgz.md5
+md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz > ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz.md5
cd -
-cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}.txt
+cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt
# Clean up the extra stuff:
if [ "$P1" = "--cleanup" ]; then