2021-07-03 19:48:15 +02:00
|
|
|
#!/bin/bash
|
2010-05-13 00:59:40 +02:00
|
|
|
|
|
|
|
# Slackware build script for <gigedit>
|
|
|
|
# Written by Michales Michaloudes korgie@gmail.com
|
|
|
|
|
2021-07-04 11:41:06 +02:00
|
|
|
cd $(dirname $0) ; CWD=$(pwd)
|
|
|
|
|
2010-05-13 00:59:40 +02:00
|
|
|
PRGNAM=gigedit
|
|
|
|
VERSION=${VERSION:-0.2.0}
|
2012-09-17 21:12:36 +02:00
|
|
|
BUILD=${BUILD:-2}
|
2010-05-13 00:59:40 +02:00
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
2010-06-04 07:11:36 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
|
|
|
i?86) ARCH=i486 ;;
|
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2013-11-22 08:34:22 +01:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
2010-05-13 00:59:40 +02:00
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
|
|
|
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"
|
2010-06-04 07:11:36 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 00:59:40 +02: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 .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 -o -perm 511 \) \
|
2010-05-13 00:59:40 +02:00
|
|
|
-exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
|
|
|
-exec chmod 644 {} \;
|
|
|
|
|
2012-09-17 21:12:36 +02:00
|
|
|
LDFLAGS="-lsigc-2.0" \
|
2010-05-13 00:59:40 +02:00
|
|
|
CFLAGS="$SLKCFLAGS" \
|
2015-12-04 18:26:39 +01:00
|
|
|
CXXFLAGS="$SLKCFLAGS -std=c++11" \
|
2010-05-13 00:59:40 +02:00
|
|
|
./configure \
|
|
|
|
--prefix=/usr \
|
|
|
|
--libdir=/usr/lib${LIBDIRSUFFIX} \
|
|
|
|
--sysconfdir=/etc \
|
|
|
|
--localstatedir=/var \
|
|
|
|
--mandir=/usr/man \
|
|
|
|
--docdir=/usr/doc/$PRGNAM-$VERSION \
|
|
|
|
--disable-static \
|
|
|
|
--build=$ARCH-slackware-linux
|
|
|
|
|
|
|
|
# doc/quickstart/Makefile has docdir hardcoded to /usr/share/doc/gigedit
|
2012-09-17 21:12:36 +02:00
|
|
|
make docdir=/usr/doc/$PRGNAM-$VERSION -j1
|
2010-05-13 00:59:40 +02:00
|
|
|
make docdir=/usr/doc/$PRGNAM-$VERSION install DESTDIR=$PKG
|
|
|
|
|
2010-05-19 08:40:44 +02: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
|
2010-05-13 00:59:40 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cp -a \
|
|
|
|
AUTHORS COPYING ChangeLog INSTALL NEWS README \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
find $PKG/usr/doc -type f -exec chmod 0644 {} \;
|
|
|
|
|
|
|
|
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}
|