2010-05-13 05:29:43 +08:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# Slackware build script for kphotoalbum
|
2010-05-13 06:28:03 +08:00
|
|
|
# By default the demo pictures and movie are packaged.
|
2010-05-13 05:29:43 +08:00
|
|
|
|
|
|
|
PRGNAM=kphotoalbum
|
2016-04-20 17:10:36 +08:00
|
|
|
VERSION=${VERSION:-4.7.1}
|
2012-12-10 18:00:04 +08:00
|
|
|
BUILD=${BUILD:-1}
|
2010-05-13 05:29:43 +08:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 13:05:26 +08:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-13 05:29:43 +08:00
|
|
|
CWD=$(pwd)
|
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2010-05-13 06:28:03 +08:00
|
|
|
# Default is to package the demo pictures and movie,
|
|
|
|
# set DEMO to no to omit them.
|
2012-04-23 00:27:08 +08:00
|
|
|
DEMO=${DEMO:-yes}
|
|
|
|
|
2010-05-13 05:29:43 +08:00
|
|
|
if [ "$ARCH" = "i486" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
|
2010-05-13 06:28:03 +08:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 05:29:43 +08:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 06:28:03 +08:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 05:29:43 +08:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 06:28:03 +08:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 13:05:26 +08:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 05:29:43 +08:00
|
|
|
fi
|
|
|
|
|
2015-02-03 15:48:28 +08:00
|
|
|
set -e
|
2010-05-13 05:29:43 +08:00
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
2010-05-13 06:28:03 +08:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
2014-07-22 20:39:15 +08:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
|
2010-05-13 05:29:43 +08:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 15:37:19 +08:00
|
|
|
find -L . \
|
2016-04-20 17:10:36 +08:00
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
2010-05-13 05:29:43 +08:00
|
|
|
|
2010-05-13 06:28:03 +08:00
|
|
|
mkdir build && cd build
|
|
|
|
cmake \
|
|
|
|
-DCMAKE_C_FLAGS="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
|
|
|
|
-DLIB_SUFFIX=${LIBDIRSUFFIX} \
|
|
|
|
-DLIB_INSTALL_DIR:PATH=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
..
|
2015-11-16 01:32:14 +08:00
|
|
|
make -j1
|
2010-05-13 06:28:03 +08:00
|
|
|
make install DESTDIR=$PKG
|
|
|
|
cd -
|
2010-05-13 05:29:43 +08:00
|
|
|
|
2012-04-23 00:27:08 +08:00
|
|
|
if [ "$DEMO" = "no" ]; then
|
2010-05-13 06:28:03 +08:00
|
|
|
rm -r /$PKG/usr/share/apps/$PRGNAM/demo
|
|
|
|
fi
|
2010-05-13 05:29:43 +08:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2014-07-22 20:39:15 +08:00
|
|
|
cp -a COPYING ChangeLog tips README \
|
2010-05-13 05:29:43 +08:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
2016-04-20 17:10:36 +08:00
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
2010-05-19 14:35:02 +08:00
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-13 06:28:03 +08:00
|
|
|
|
2010-05-13 05:29:43 +08:00
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2010-05-13 06:28:03 +08:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|