From 68bc4771ab14123285444d31b05922dab4ce52e6 Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Thu, 16 May 2013 20:18:13 +0000 Subject: Update to git snapshot cfde287_20121007git to accompany openbox-3.5.0 --- obconf/build/obconf.SlackBuild | 107 +++++++++++++++++++++++------------------ 1 file changed, 61 insertions(+), 46 deletions(-) (limited to 'obconf/build') diff --git a/obconf/build/obconf.SlackBuild b/obconf/build/obconf.SlackBuild index d58af010..7a7f41b2 100755 --- a/obconf/build/obconf.SlackBuild +++ b/obconf/build/obconf.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh # $Id$ -# Copyright (c) 2008-2009 Eric Hameleers, Eindhoven, NL +# Copyright 2008, 2009, 2013 Eric Hameleers, Eindhoven, NL # All rights reserved. # # Permission to use, copy, modify, and distribute this software for @@ -27,11 +27,15 @@ # By: Eric Hameleers # For: obconf # Descr: Openbox configuration tool -# URL: http://icculus.org/openbox/index.php/ObConf:About +# URL: http://openbox.org/wiki/ObConf:About # Needs: openbox # Changelog: # 2.0.3-1: 05/Aug/2008 by Eric Hameleers # * Initial build. +# cfde287_20121007git-1: +# 16/may/2013 by Eric Hameleers +# * Update to accompany the openbox-3.5.0 package. Use a git +# snapshot because the latest release tarball is way too old. # # Run 'sh obconf.SlackBuild' to build a Slackware package. # The package (.tgz) plus descriptive .txt file are created in /tmp . @@ -39,11 +43,8 @@ # # ----------------------------------------------------------------------------- -# Set initial variables: - PRGNAM=obconf -VERSION=${VERSION:-2.0.3} -ARCH=${ARCH:-i486} +VERSION=${VERSION:-cfde287_20121007git} BUILD=${BUILD:-1} TAG=${TAG:-alien} @@ -64,41 +65,69 @@ SRCURL="http://icculus.org/openbox/${PRGNAM}/${PRGNAM}-${VERSION}.tar.gz" ## --- with a little luck, you won't have to edit below this point --- ## ## -# Exit the script on errors: -set -e -trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR -# Catch unitialized variables: -set -u -P1=${1:-1} +# Automatically determine the architecture we're building on: +MARCH=$( uname -m ) +if [ -z "$ARCH" ]; then + case "$MARCH" in + i?86) export ARCH=i486 ;; + armv7hl) export ARCH=$MARCH ;; + armv6hl) export ARCH=$MARCH ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$MARCH ;; + esac +fi case "$ARCH" in i486) SLKCFLAGS="-O2 -march=i486 -mtune=i686" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; - s390) SLKCFLAGS="-O2" + x86_64) SLKCFLAGS="-O2 -fPIC" + SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" + ;; + armv7hl) SLKCFLAGS="-O2 -march=armv7-a -mfpu=vfpv3-d16" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; - powerpc) SLKCFLAGS="-O2" + armv6hl) SLKCFLAGS="-O2 -march=armv6 -mfpu=vfp -mfloat-abi=hard" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; - x86_64) SLKCFLAGS="-O2 -fPIC" - SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" + *) SLKCFLAGS=${SLKCFLAGS:-"O2"} + SLKLDFLAGS=${SLKLDFLAGS:-""}; LIBDIRSUFFIX=${LIBDIRSUFFIX:-""} ;; esac +case "$ARCH" in + arm*) TARGET=$ARCH-slackware-linux-gnueabi ;; + *) TARGET=$ARCH-slackware-linux ;; +esac + +# Exit the script on errors: +set -e +trap 'echo "$0 FAILED at line ${LINENO}" | tee $OUTPUT/error-${PRGNAM}.log' ERR +# Catch unitialized variables: +set -u +P1=${1:-1} + +# Save old umask and set to 0022: +_UMASK_=$(umask) +umask 0022 + # 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 +rm -rf $OUTPUT/{configure,make,install,error,makepkg}-$PRGNAM.log + # remove old log files # Source file availability: if ! [ -f ${SOURCE} ]; then + echo "Source '$(basename ${SOURCE})' not available yet..." + # Check if the $SRCDIR is writable at all - if not, download to $OUTPUT + [ -w "$SRCDIR" ] || SOURCE="$OUTPUT/$(basename $SOURCE)" + if [ -f ${SOURCE} ]; then echo "Ah, found it!"; continue; fi 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 -T 20 -O "${SOURCE}" "${SRCURL}" || true if [ $? -ne 0 -o ! -s "${SOURCE}" ]; then @@ -128,7 +157,11 @@ echo "Extracting the source archive(s) for $PRGNAM..." tar -xvf ${SOURCE} cd ${PRGNAM}-${VERSION} chown -R root:root . -chmod -R u+w,go+r-w,a-s . +chmod -R u+w,go+r-w,a+X-s . + +# Include a patch by Andrew Rowland to fix build errors: +cat $SRCDIR/obconf_git_preview.patch | patch -p1 --verbose \ + 2>&1 | tee $OUTPUT/patch-$PRGNAM.log echo Building ... LDFLAGS="$SLKLDFLAGS" \ @@ -141,21 +174,13 @@ CFLAGS="$SLKCFLAGS" \ --sysconfdir=/etc \ --program-prefix= \ --program-suffix= \ - --build=$ARCH-slackware-linux \ + --build=$TARGET \ 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 - installwatch -o $OUTPUT/install-${PRGNAM}.log make DESTDIR=$PKG install -else - make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log -fi +make DESTDIR=$PKG install 2>&1 |tee $OUTPUT/install-${PRGNAM}.log # Add this to the doinst.sh: -! [ -d $PKG/install ] && mkdir -p $PKG/install +mkdir -p $PKG/install cat <> $PKG/install/doinst.sh # Update the desktop database: if [ -x usr/bin/update-desktop-database ]; then @@ -171,11 +196,7 @@ EOT # Add documentation: mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION || true -cat $SRCDIR/$(basename $0) | sed \ - -e "/^VERSION=/s/:-.*}/:-$VERSION}/" \ - -e "/^ARCH=/s/:-.*}/:-$ARCH}/" \ - -e "/^BUILD=/s/:-.*}/:-$BUILD}/" \ - > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +cat $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 {} \; @@ -185,13 +206,9 @@ find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ # Add a package description: mkdir -p $PKG/install -cat $SRCDIR/slack-desc.${PRGNAM} > $PKG/install/slack-desc -if [ -f $SRCDIR/doinst.sh.${PRGNAM} ]; then - cat $SRCDIR/doinst.sh.${PRGNAM} >> $PKG/install/doinst.sh -fi -if [ -f $SRCDIR/slack-required.${PRGNAM} ]; then - cat $SRCDIR/slack-required.${PRGNAM} > $PKG/install/slack-required -fi +cat $SRCDIR/slack-desc > $PKG/install/slack-desc +#cat $SRCDIR/doinst.sh >> $PKG/install/doinst.sh +cat $SRCDIR/slack-required > $PKG/install/slack-required # Build the package: cd $PKG @@ -200,7 +217,5 @@ cd $OUTPUT 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}${TAG}.txt -if [ -f $PKG/install/slack-required ]; then - cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.dep -fi +cat $PKG/install/slack-required > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.dep -- cgit v1.2.3-65-gdbad