From 815581933db23382359783f2cd46316ab6396d7d Mon Sep 17 00:00:00 2001 From: Eric Hameleers Date: Thu, 12 May 2011 15:17:09 +0000 Subject: Fix lib64 path on x86_64 --- openmotif/build/openmotif.SlackBuild | 61 +++++++++++++++++++++++------------- 1 file changed, 40 insertions(+), 21 deletions(-) (limited to 'openmotif') diff --git a/openmotif/build/openmotif.SlackBuild b/openmotif/build/openmotif.SlackBuild index 085e2385..d1c91af4 100755 --- a/openmotif/build/openmotif.SlackBuild +++ b/openmotif/build/openmotif.SlackBuild @@ -1,6 +1,6 @@ #!/bin/sh # $Id$ -# Copyright (c) 2009 Eric Hameleers +# Copyright 2009, 2010, 2011 Eric Hameleers, Eindhoven, NL # All rights reserved. # # Permission to use, copy, modify, and distribute this software for @@ -33,6 +33,10 @@ # Changelog: # 2.3.2-1: 31/Jul/2009 by Eric Hameleers # * Initial build. +# 2.3.3-1: 04/jul/2010 by Eric Hameleers +# * Update. +# 2.3.3-2: 12/may/2011 by Eric Hameleers +# * Fix library path on x86_64 platform. # # Run 'sh openmotif.SlackBuild' to build a Slackware package. # The package (.tgz) and .txt file as well as build logs are created in /tmp . @@ -43,10 +47,9 @@ # Set initial variables: PRGNAM=openmotif -VERSION=${VERSION:-2.3.2} +VERSION=${VERSION:-2.3.3} MAJVER=$( echo ${VERSION} | cut -d. -f1,2 ) -ARCH=${ARCH:-i486} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-alien} DOCS="COPYRIGHT* INSTALL* BUGREPORT ChangeLog LICENSE README RELNOTES RELEASE" @@ -66,28 +69,41 @@ SRCURL="http://www.motifzone.net/files/public_downloads/${PRGNAM}/${MAJVER}/${VE ## --- 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: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) export ARCH=i486 ;; + arm*) export ARCH=arm ;; + # Unless $ARCH is already set, use uname -m for all other archs: + *) export ARCH=$( uname -m ) ;; + 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" + SLKCFLAGS="-O2" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; - powerpc) SLKCFLAGS="-O2" + *) SLKCFLAGS="-O2" SLKLDFLAGS=""; LIBDIRSUFFIX="" ;; - x86_64) SLKCFLAGS="-O2 -fPIC" - SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" - ;; 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 @@ -131,8 +147,12 @@ cd $TMP/tmp-$PRGNAM echo "Extracting the source archive(s) for $PRGNAM..." tar -xvf ${SOURCE} cd ${PRGNAM}-${VERSION} + +# Fix for x86_64 architecture: +sed -i -e "/UsrLibDir/s,/lib,/lib${LIBDIRSUFFIX},g" config/cf/Imake.tmpl + chown -R root:root . -chmod -R u+w,go+r-w,a-s . +chmod -R u+w,go+r-w,a+X-s . echo Building ... LDFLAGS="$SLKLDFLAGS" \ @@ -171,11 +191,7 @@ mv $PKG/usr/lib${LIBDIRSUFFIX}/X11/* $PKG/etc/X11/mwm # 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 {} \; @@ -207,3 +223,6 @@ md5sum ${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.tgz > ${PRGNAM}-${VERSION}-${ cd - cat $PKG/install/slack-desc | grep "^${PRGNAM}" > $OUTPUT/${PRGNAM}-${VERSION}-${ARCH}-${BUILD}${TAG}.txt +# Restore the original umask: +umask ${_UMASK_} + -- cgit v1.2.3