slackbuilds_ponce/libraries/fltk2/fltk2.SlackBuild
Mikhail Zotov b936c8d0d1 libraries/fltk2: Updated for version 2.0.x_alpha_r8800.
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
2011-09-05 23:03:05 -05:00

95 lines
2.3 KiB
Bash

#!/bin/sh
#
# Slackware build script for fltk, version 2
#
# Maintainer of the script: Mikhail Zotov <mikhail dot ru@gmail dot com>
#
# The script is based on the build script for FLTK, version 1, by LukenShiro.
# The script has been fixed by the SlackBuilds.org team.
PRGNAM=fltk2
VERSION=2.0.x_alpha_r8800
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
SRC_PRGNAM=fltk
SRC_VERSION=$(printf $VERSION | tr _ -)
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi
CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
DOCFILES="CHANGES COPYING CREDITS README README.unix README_fltk1_to_fltk2.txt"
if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi
set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $SRC_PRGNAM-$SRC_VERSION
tar xvf $CWD/$SRC_PRGNAM-$SRC_VERSION.tar.bz2
cd $SRC_PRGNAM-$SRC_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 {} \;
# Fix linking when --libdir=/usr/lib64
sed -i \
-e '/RANLIB/s:$(libdir)/\(.*LIBNAME)\):$(libdir)/`basename \1`:g' \
src/Makefile || exit
# Make building more "verbose"
sed -i 's/\.SILENT://' makeinclude.in
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--mandir=/usr/man \
--enable-shared
make VERBOSE=1
make install DESTDIR=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
# Remove empty directories since no manual pages are installed
rm -rf $PKG/usr/man
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/
cp -a $DOCFILES $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}