2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2010-05-12 23:29:43 +02:00
|
|
|
|
|
|
|
# Slackware build script for kphotoalbum
|
2010-05-13 00:28:03 +02:00
|
|
|
# By default the demo pictures and movie are packaged.
|
2010-05-12 23:29:43 +02:00
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2010-05-12 23:29:43 +02:00
|
|
|
PRGNAM=kphotoalbum
|
2020-12-09 18:57:35 +01:00
|
|
|
VERSION=${VERSION:-5.7.0}
|
2012-12-10 11:00:04 +01:00
|
|
|
BUILD=${BUILD:-1}
|
2010-05-12 23:29:43 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
2021-07-04 12:23:38 +02:00
|
|
|
PKGTYPE=${PKGTYPE:-tgz}
|
2010-05-12 23:29:43 +02:00
|
|
|
|
2010-06-04 07:05:26 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2020-12-09 18:57:35 +01:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 07:05:26 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2021-07-04 12:23:38 +02:00
|
|
|
# If the variable PRINT_PACKAGE_NAME is set, then this script will report what
|
|
|
|
# the name of the created package would be, and then exit. This information
|
|
|
|
# could be useful to other scripts.
|
|
|
|
if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
|
|
|
|
echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2010-05-12 23:29:43 +02:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2010-05-13 00:28:03 +02:00
|
|
|
# Default is to package the demo pictures and movie,
|
|
|
|
# set DEMO to no to omit them.
|
2012-04-22 18:27:08 +02:00
|
|
|
DEMO=${DEMO:-yes}
|
|
|
|
|
2020-12-09 18:57:35 +01:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-05-13 00:28:03 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 23:29:43 +02:00
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
2010-05-13 00:28:03 +02:00
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 23:29:43 +02:00
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
2010-05-13 00:28:03 +02:00
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:05:26 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-12 23:29:43 +02:00
|
|
|
fi
|
|
|
|
|
2015-02-03 08:48:28 +01:00
|
|
|
set -e
|
2010-05-12 23:29:43 +02:00
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
2010-05-13 00:28:03 +02:00
|
|
|
rm -rf $PRGNAM-$VERSION
|
2014-07-22 14:39:15 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.xz
|
2010-05-12 23:29:43 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
2016-04-20 11:10:36 +02: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-12 23:29:43 +02:00
|
|
|
|
2010-05-13 00:28:03 +02:00
|
|
|
mkdir build && cd build
|
|
|
|
cmake \
|
|
|
|
-DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
|
2020-12-09 18:57:35 +01:00
|
|
|
-DKDE_INSTALL_LIBDIR=lib$LIBDIRSUFFIX \
|
2010-05-13 00:28:03 +02:00
|
|
|
-DLIB_INSTALL_DIR:PATH=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
..
|
2020-12-09 18:57:35 +01:00
|
|
|
make
|
2010-05-13 00:28:03 +02:00
|
|
|
make install DESTDIR=$PKG
|
|
|
|
cd -
|
2010-05-12 23:29:43 +02:00
|
|
|
|
2012-04-22 18:27:08 +02:00
|
|
|
if [ "$DEMO" = "no" ]; then
|
2010-05-13 00:28:03 +02:00
|
|
|
rm -r /$PKG/usr/share/apps/$PRGNAM/demo
|
|
|
|
fi
|
2010-05-12 23:29:43 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
2020-12-09 18:57:35 +01:00
|
|
|
cp -a COPYING ChangeLog tips README.md \
|
2010-05-12 23:29:43 +02:00
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
2016-04-20 11:10:36 +02:00
|
|
|
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
|
2010-05-19 08:35:02 +02:00
|
|
|
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
|
2010-05-13 00:28:03 +02:00
|
|
|
|
2010-05-12 23:29:43 +02:00
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
2021-07-04 12:23:38 +02:00
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE
|