diff options
author | Eric Hameleers <alien@slackware.com> | 2008-06-13 14:36:54 +0000 |
---|---|---|
committer | Eric Hameleers <alien@slackware.com> | 2008-06-13 14:36:54 +0000 |
commit | 77ce0b735004a16766d7c4a5b3154909646293c2 (patch) | |
tree | a5f1d550a3989729c8f2e28897db793fb9e6f738 /vlc-skins | |
parent | b79d90f04dd4279d1d23d2c4552104f24e164aaa (diff) | |
download | asb-77ce0b735004a16766d7c4a5b3154909646293c2.tar.gz asb-77ce0b735004a16766d7c4a5b3154909646293c2.tar.xz |
Updated - use date stamp, not VLC version number
Diffstat (limited to 'vlc-skins')
-rwxr-xr-x | vlc-skins/build/vlc-skins.SlackBuild | 123 |
1 files changed, 49 insertions, 74 deletions
diff --git a/vlc-skins/build/vlc-skins.SlackBuild b/vlc-skins/build/vlc-skins.SlackBuild index 6c2e4fdc..d5a684f8 100755 --- a/vlc-skins/build/vlc-skins.SlackBuild +++ b/vlc-skins/build/vlc-skins.SlackBuild @@ -1,6 +1,7 @@ #!/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 # any purpose with or without fee is hereby granted, provided that @@ -23,16 +24,18 @@ # # Slackware SlackBuild script # =========================== -# By: Eric Hameleers <alien@slackware.com> -# For: vlc-skins -# Descr: skins for videolan client -# URL: http://www.videolan.org/vlc/ -# Needs: -# Changelog: -# 0.8.6a-1: 16/Mar/2007 by Eric Hameleers <alien@slackware.com> -# * Initial build. -# 0.8.6c-1: 05/sep/2007 by Eric Hameleers <alien@slackware.com> -# * New skin package. +# By: Eric Hameleers <alien@slackware.com> +# For: vlc-skins +# Descr: skins for videolan client +# URL: http://www.videolan.org/vlc/ +# Needs: +# Changelog: +# 0.8.6a-1: 16/Mar/2007 by Eric Hameleers <alien@slackware.com> +# * Initial build. +# 0.8.6c-1: 05/sep/2007 by Eric Hameleers <alien@slackware.com> +# * New skin package. +# 20080613-1: 13/Jun/2008 by Eric Hameleers <alien@slackware.com> +# * New skin package # # Run 'sh vlc-skins.SlackBuild --cleanup' to build a Slackware package. # The package (.tgz) plus descriptive .txt file are created in /tmp . @@ -40,21 +43,16 @@ # # ----------------------------------------------------------------------------- -# --- INIT --- # Set initial variables: -# The VERSION is a bit arbitrary - I let it match the version of VLC, -# although I guess the skins work for older versions just as well. - PRGNAM=vlc-skins -VERSION=${VERSION:-0.8.6c} -ARCH=${ARCH:-noarch} +VERSION=${VERSION:-20080613} +ARCH=noarch BUILD=${BUILD:-1} +TAG=${TAG:-alien} # 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} @@ -62,7 +60,7 @@ PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} # Input URL: http://www.videolan.org/vlc/skins2/vlc-skins.zip -SOURCE="$SRCDIR/${PRGNAM}.zip" +SOURCE="$SRCDIR/${PRGNAM}-${VERSION}.zip" SRCURL="http://www.videolan.org/vlc/skins2/${PRGNAM}.zip" ## @@ -71,47 +69,33 @@ SRCURL="http://www.videolan.org/vlc/skins2/${PRGNAM}.zip" # Exit the script on errors: set -e -trap 'echo "$0 FAILED at line $LINENO!" | tee $OUTPUT/error-${PRGNAM}.log' ERR +trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR # Catch unitialized variables: set -u P1=${1:-1} -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 $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 -O "${SOURCE}" "${SRCURL}" || true - if [ $? -ne 0 ]; then - echo "Downloading '`basename ${SOURCE}`' failed... aborting the build." + [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)" + echo "Source '$(basename ${SOURCE})' not available yet..." + echo "Will download file to $(dirname $SOURCE)" + 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 fi else - echo "File '`basename ${SOURCE}`' not available... aborting the build." + echo "File '$(basename ${SOURCE})' not available... aborting the build." exit 1 fi fi @@ -129,47 +113,38 @@ 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} -elif `file ${SOURCE} | grep -iq ": zip"`; then +elif $(file ${SOURCE} | grep -qi ": zip"); then unzip ${SOURCE} fi -chown -R root:root * -chmod -R u+w,go+r-w,a-s * +cd ${PRGNAM}-${VERSION} +chown -R root:root . +chmod -R u+w,go+r-w,a-s . # Install to the package dir mkdir -p $PKG/usr/share/vlc/skins2 mv * $PKG/usr/share/vlc/skins2 +# Add documentation: +mkdir -p $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 {} \; -# --- 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 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 - - -# --- CLEANUP --- +cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt # Clean up the extra stuff: if [ "$P1" = "--cleanup" ]; then |