2010-05-12 02:00:24 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for gtkdialog
|
|
|
|
# Written by slakmagik <jsun@freeshell.org>
|
|
|
|
# Released under the WTFPL
|
|
|
|
|
|
|
|
PRGNAM=gtkdialog
|
2010-05-13 06:24:44 +08:00
|
|
|
VERSION=${VERSION:-0.7.20}
|
|
|
|
BUILD=${BUILD:-3}
|
2010-05-12 02:00:24 +08:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 13:02:54 +08:00
|
|
|
# Automatically determine the architecture we're building on:
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
# Unless $ARCH is already set, use uname -m for all other archs:
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-12 02:00:24 +08:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
2010-05-13 06:24:44 +08:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 02:00:24 +08:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 06:24:44 +08:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 04:22:33 +08:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 06:24:44 +08:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 13:02:54 +08:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 02:00:24 +08:00
|
|
|
fi
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
|
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
|
|
|
find . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
|
|
|
-exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 \
|
|
|
|
-o -perm 400 \) -exec chmod 644 {} \;
|
|
|
|
|
2010-05-12 04:22:33 +08:00
|
|
|
# Fix an infinite loop caused by a pair of statements not being contained in
|
|
|
|
# braces. Thanks to David B. Cortarello
|
|
|
|
patch -p1 < $CWD/gtkdialog-0.7.20-variables-export-fix.patch
|
2010-05-13 06:24:44 +08:00
|
|
|
# Fix a redeclaration error/namespace issue
|
|
|
|
patch -p1 < $CWD/redeclaration.patch
|
2010-05-12 04:22:33 +08:00
|
|
|
|
2010-05-12 02:00:24 +08:00
|
|
|
CFLAGS="$SLKCFLAGS" CXXFLAGS="$SLKCFLAGS" ./configure --prefix=/usr
|
|
|
|
make
|
|
|
|
make DESTDIR=$PKG install-strip
|
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
# the NEWS and README files are empty, so this doesn't include them
|
|
|
|
cp -a [ACIT]* examples $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
find $PKG/usr/doc -name "Makefile*" -exec rm -f {} \;
|
|
|
|
find $PKG/usr/doc -type f -exec chmod 0644 {} \;
|
|
|
|
|
2010-05-13 06:24:44 +08:00
|
|
|
rm -f $PKG/usr/info/dir
|
2010-05-12 02:00:24 +08:00
|
|
|
gzip -9 $PKG/usr/info/$PRGNAM.info
|
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 06:24:44 +08:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|