#!/bin/sh
# CUPS build script by volkerdi@slackware.com.

# Set initial variables:
CWD=`pwd`
if [ "$TMP" = "" ]; then
  TMP=/tmp
fi
PKGTMP=$TMP/package-cups32
PKG=$TMP/package-aaa_elflibs32

VERSION=1.3.7
ARCH=${ARCH:-x86_64}
BUILD=${BUILD:-1}

if [ ! -d $TMP ]; then
  mkdir -p $TMP # location to build the source
fi
mkdir -p $PKG

cd $TMP
rm -rf cups-$VERSION
tar xjvf $CWD/cups-$VERSION-source.tar.bz2
cd cups-$VERSION
(
#. /etc/profile.d/32dev.sh
#linux32 
LDFLAGS="-L/usr/lib" \
./configure \
	--libdir=/usr/lib \
	--enable-32bit \
	--without-php \
	--without-perl \
	--without-python \
	--without-java \
  --disable-pam
make -j3 || exit 1
make BUILDROOT=$PKGTMP install
)

mkdir -p $PKG/usr/lib
mv $PKGTMP/usr/lib/libcups*.so.* $PKG/usr/lib
#(
#	cd $PKG/usr/lib
#	ln -s libcups.so.2 libcups.so
#	ln -s libcupsimage.so.2 libcupsimage.so
#)
