summaryrefslogtreecommitdiffstats
path: root/source/d/poke/poke.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'source/d/poke/poke.SlackBuild')
-rwxr-xr-xsource/d/poke/poke.SlackBuild87
1 files changed, 66 insertions, 21 deletions
diff --git a/source/d/poke/poke.SlackBuild b/source/d/poke/poke.SlackBuild
index 200157a60..75a172768 100755
--- a/source/d/poke/poke.SlackBuild
+++ b/source/d/poke/poke.SlackBuild
@@ -1,6 +1,6 @@
#!/bin/bash
-# Copyright 2021 Patrick J. Volkerding, Sebeka, Minnesota, USA
+# Copyright 2021, 2024 Patrick J. Volkerding, Sebeka, Minnesota, USA
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,14 +23,17 @@
cd $(dirname $0) ; CWD=$(pwd)
PKGNAM=poke
-VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
-BUILD=${BUILD:-1}
+VERSION=${VERSION:-$(echo $PKGNAM-*.tar.?z | cut -f 1 -d " " | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+BUILD=${BUILD:-2}
+
+# Bundle poke-elf?
+WITHPOKEELF=${WITHPOKEELF:-TRUE}
# Automatically determine the architecture we're building on:
if [ -z "$ARCH" ]; then
case "$(uname -m)" in
i?86) ARCH=i586 ;;
- arm*) readelf /usr/bin/file -A | egrep -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
+ arm*) readelf /usr/bin/file -A | grep -E -q "Tag_CPU.*[4,5]" && ARCH=arm || ARCH=armv7hl ;;
# Unless $ARCH is already set, use uname -m for all other archs:
*) ARCH=$(uname -m) ;;
esac
@@ -108,6 +111,65 @@ CXXFLAGS="$SLKCFLAGS" \
make $NUMJOBS || make || exit 1
make install DESTDIR=$PKG || exit 1
+# Add a documentation directory:
+mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
+cp -a \
+ AUTHORS* ChangeLog COPYING* DEPENDENCIES* LICENSE* NEWS* README* THANKS* TODO* \
+ $PKG/usr/doc/${PKGNAM}-$VERSION
+
+# If there's a ChangeLog, installing at least part of the recent history
+# is useful, but don't let it get totally out of control:
+if [ -r ChangeLog ]; then
+ DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
+ cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
+ touch -r ChangeLog $DOCSDIR/ChangeLog
+fi
+
+mkdir -p $PKG/install
+cat $CWD/slack-desc > $PKG/install/slack-desc
+
+if [ "$WITHPOKEELF" = "TRUE" ]; then
+ cd $CWD
+ # Add in poke-elf:
+ POKEELFVER=${POKEELFVER:-$(echo poke-elf-*.tar.?z | rev | cut -f 3- -d . | cut -f 1 -d - | rev)}
+ cd $TMP
+ rm -rf poke-elf-$POKEELFVER
+ tar xvf $CWD/poke-elf-$POKEELFVER.tar.?z || exit 1
+ cd poke-elf-$POKEELFVER || exit 1
+ 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 {} \+
+ if [ ! -r configure ]; then
+ if [ -x ./autogen.sh ]; then
+ NOCONFIGURE=1 ./autogen.sh
+ else
+ autoreconf -vif
+ fi
+ fi
+ CFLAGS="$SLKCFLAGS" \
+ CXXFLAGS="$SLKCFLAGS" \
+ ./configure \
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --docdir=/usr/doc/poke-elf-$POKEELFVER \
+ --mandir=/usr/man \
+ --infodir=/usr/info \
+ --disable-static \
+ --build=$ARCH-slackware-linux || exit 1
+ make $NUMJOBS || make || exit 1
+ make install DESTDIR=$PKG || exit 1
+ # Add a documentation directory:
+ mkdir -p $PKG/usr/doc/poke-elf-$POKEELFVER
+ cp -a \
+ AUTHORS* COPYING* README* \
+ $PKG/usr/doc/poke-elf-$POKEELFVER
+fi
+
# Don't ship .la files:
rm -f $PKG/{,usr/}lib${LIBDIRSUFFIX}/*.la
@@ -129,22 +191,5 @@ if [ -d $PKG/usr/info ]; then
)
fi
-# Add a documentation directory:
-mkdir -p $PKG/usr/doc/${PKGNAM}-$VERSION
-cp -a \
- AUTHORS* ChangeLog COPYING* DEPENDENCIES* LICENSE* NEWS* README* THANKS* TODO* \
- $PKG/usr/doc/${PKGNAM}-$VERSION
-
-# If there's a ChangeLog, installing at least part of the recent history
-# is useful, but don't let it get totally out of control:
-if [ -r ChangeLog ]; then
- DOCSDIR=$(echo $PKG/usr/doc/${PKGNAM}-$VERSION)
- cat ChangeLog | head -n 1000 > $DOCSDIR/ChangeLog
- touch -r ChangeLog $DOCSDIR/ChangeLog
-fi
-
-mkdir -p $PKG/install
-cat $CWD/slack-desc > $PKG/install/slack-desc
-
cd $PKG
/sbin/makepkg -l y -c n $TMP/$PKGNAM-$VERSION-$ARCH-$BUILD.txz