2010-09-13 00:17:26 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for darktable
|
|
|
|
# Written by David Spencer <baildon.research@googlemail.com>
|
|
|
|
# This script is dedicated to the public domain
|
|
|
|
|
|
|
|
PRGNAM=darktable
|
2011-05-09 11:22:40 +08:00
|
|
|
VERSION=${VERSION:-0.8}
|
|
|
|
BUILD=${BUILD:-1}
|
2010-09-13 00:17:26 +08:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2011-05-09 11:22:40 +08:00
|
|
|
# SSE2 instructions are *required* at runtime. That's a proper subset of i686, but
|
|
|
|
# hopefully forcing i686 in the package name will alert users of older cpus.
|
|
|
|
i?86) ARCH=i686 ;;
|
2010-09-13 00:17:26 +08:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2011-05-09 11:22:40 +08:00
|
|
|
if [ "$ARCH" = "i686" ]; then
|
2010-09-13 00:17:26 +08:00
|
|
|
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 $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 {} \;
|
|
|
|
|
2011-05-09 11:22:40 +08:00
|
|
|
mkdir -p build
|
|
|
|
cd build
|
|
|
|
cmake \
|
|
|
|
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
|
|
|
|
-DMAN_INSTALL_DIR=/usr/man \
|
|
|
|
-DBINARY_PACKAGE_BUILD=1 \
|
|
|
|
-DDONT_INSTALL_GCONF_SCHEMAS=On \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release ..
|
|
|
|
VERBOSE=1 make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
cd ..
|
2010-09-13 00:17:26 +08:00
|
|
|
|
|
|
|
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
|
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
|
|
|
|
2011-05-09 11:22:40 +08:00
|
|
|
# Install the gconf schema, suppressing warning messages
|
|
|
|
mkdir -p $PKG/etc/gconf/schemas
|
|
|
|
sed -e '/gettext_domain/d' \
|
|
|
|
< data/darktable.schemas \
|
|
|
|
> $PKG/etc/gconf/schemas/darktable.schemas
|
|
|
|
|
|
|
|
# MAN_INSTALL_DIR is currently ignored :-(
|
|
|
|
mv $PKG/usr/share/man $PKG/usr
|
2010-09-13 00:17:26 +08:00
|
|
|
find $PKG/usr/man -type f -exec gzip -9 {} \;
|
|
|
|
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
|
|
|
|
|
2011-05-09 11:22:40 +08:00
|
|
|
# Fix the doc location too
|
2010-09-13 00:17:26 +08:00
|
|
|
mv $PKG/usr/share/doc $PKG/usr
|
|
|
|
mv $PKG/usr/doc/$PRGNAM $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
# Add a few missed docs
|
2011-05-09 11:22:40 +08:00
|
|
|
cp -a doc/ChangeLog doc/NEWS doc/TODO $PKG/usr/doc/$PRGNAM-$VERSION
|
2010-09-13 00:17:26 +08:00
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
2011-05-09 11:22:40 +08:00
|
|
|
( cd $PKG/usr/doc ; ln -s $PRGNAM-$VERSION $VERSION )
|
2010-09-13 00:17:26 +08:00
|
|
|
|
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|