summaryrefslogtreecommitdiffstats
path: root/games/pybik/pybik.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/pybik/pybik.SlackBuild')
-rw-r--r--games/pybik/pybik.SlackBuild47
1 files changed, 40 insertions, 7 deletions
diff --git a/games/pybik/pybik.SlackBuild b/games/pybik/pybik.SlackBuild
index 8004c170d1..488b8202b8 100644
--- a/games/pybik/pybik.SlackBuild
+++ b/games/pybik/pybik.SlackBuild
@@ -1,4 +1,4 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for pybik
@@ -22,10 +22,20 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20220221 bkw: Modified by SlackBuilds.org:
+# - fix download URL
+# - binary in /usr/games
+# - abs paths in .desktop file
+# - use parallel build (unlike most python builds, this really benefits
+# from parallelism).
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=pybik
VERSION=${VERSION:-2.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -35,7 +45,11 @@ if [ -z "$ARCH" ]; then
esac
fi
-CWD=$(pwd)
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
@@ -65,20 +79,39 @@ cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
- -o -perm 511 \) -exec chmod 755 {} \; -o \
+ -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 {} \;
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
# Fix man page path
sed -i "s/share\/man/man/" setup.py
+# 20220221 bkw: 'generating models' takes a long time to run. it can be
+# made to run multiple jobs (like make -jN). For convenience, read
+# MAKEFLAGS from the environment, if set...
+JOBS="$( echo $MAKEFLAGS | sed 's,.*-j *\([0-9][0-9]*\)*.*,\1,' )"
+
+# ...or if no MAKEFLAGS, use number-of-cores minus 1...
+JOBS="${JOBS:-$(( $( nproc ) - 1 ))}"
+
+# ...or 1, if we really only have one core.
+[ "$JOBS" = "0" ] && JOBS=1
+
+# 20220221 bkw: Don't combine build and install in one step, because
+# install doesn't recognize the --parallel option.
+python3 setup.py build --parallel=$JOBS
python3 setup.py install --root=$PKG
+mv $PKG/usr/bin $PKG/usr/games
+
+sed -i -e '/^Exec/s,=,=/usr/games/,' \
+ -e '/^Icon/s,=.*,=/usr/share/pixmaps/pybik.png,' \
+ $PKG/usr/share/applications/*desktop
+
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
-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
+gzip $PKG/usr/man/man*/*
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a README COPYING NEWS $PKG/usr/doc/$PRGNAM-$VERSION
@@ -89,4 +122,4 @@ 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}
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE