summaryrefslogtreecommitdiffstats
path: root/games/pysolfc/pysolfc.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'games/pysolfc/pysolfc.SlackBuild')
-rw-r--r--games/pysolfc/pysolfc.SlackBuild115
1 files changed, 54 insertions, 61 deletions
diff --git a/games/pysolfc/pysolfc.SlackBuild b/games/pysolfc/pysolfc.SlackBuild
index 7bfc1d74c0..50886fe3dd 100644
--- a/games/pysolfc/pysolfc.SlackBuild
+++ b/games/pysolfc/pysolfc.SlackBuild
@@ -2,27 +2,22 @@
# Slackware build script for pysolfc
-# Copyright 2009 Matthew "mfillpot" Fillpot
-# All rights reserved.
-#
-# Redistribution and use of this script, with or without modification, is
-# permitted provided that the following conditions are met:
-#
-# 1. Redistributions of this script must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
-# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
-# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
-# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
-# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
-# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
-# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
-# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-# Now maintained by B. Watson <yalhcru@gmail.com>
+# Originally written by Matthew "mfillpot" Fillpot.
+
+# Now maintained by B. Watson <urchlay@slackware.uk>
+
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# 20231216 bkw: update for v2.21.0 (and cardset-minimal 2.2.0),
+# fix broken permissions for cardsets.
+
+# 20230111 bkw: update for v2.18.0 (and cardset-minimal 2.1.0).
+
+# 20211228 bkw: update for v2.14.1.
+# - relicensed as WTFPL with permission from Matthew.
+# - we now use python3 and -current's python-pillow, no need for
+# pillow6 patch, six, etc.
+# - document optional dep pygame in README.
# 20181206 bkw:
# - Add missing 'six' dependency. Thanks to Carsten Boysen Jensen for
@@ -42,16 +37,16 @@
# - Include all_games.html in the docdir (with fixed paths for the links).
# - Update README and slack-desc.
-SRCNAM=PySolFC
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=pysolfc
-VERSION=${VERSION:-2.4.0}
-BUILD=${BUILD:-2}
+SRCNAM=PySolFC
+VERSION=${VERSION:-2.21.0}
+BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
-CARDSETVER=${CARDSETVER:-2.0}
+CARDSETVER=${CARDSETVER:-2.2.0}
CARDSETS=$SRCNAM-Cardsets--Minimal-$CARDSETVER
if [ -z "$ARCH" ]; then
@@ -62,9 +57,6 @@ if [ -z "$ARCH" ]; then
esac
fi
-# 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
@@ -76,36 +68,35 @@ OUTPUT=${OUTPUT:-/tmp}
set -e
+# 20230111 bkw: upstream starting using "pysol-x.x.x" for the tag.
+# handle either name for the tarball, because I probably want to keep
+# running the old version.
+TARBALL=$CWD/$SRCNAM-$PRGNAM-$VERSION.tar.gz
+[ -e $TARBALL ] || TARBALL=$CWD/$SRCNAM-$VERSION.tar.gz
+TARDIR=$( basename $TARBALL .tar.gz )
+
+fixperms() {
+ chown -R root:root $1
+ find -L $1 -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
+}
+
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf $SRCNAM-$VERSION
-tar xvf $CWD/$SRCNAM-$VERSION.tar.xz
-cd $SRCNAM-$VERSION
-chown -R root:root .
-find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \
- \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+
-
-patch -p1 < $CWD/pillow6.patch
-
-# 20181012 bkw: Slightly dirty hack, to combat a dirty hack from upstream.
-# Begin rant:
-# Basically, the old versions of pysol used the python 'random' library,
-# which ships with python2 (included in Slackware). With 2.4.0, they've
-# ported the code so it's python3-compatible (though it still works
-# with python2). The python3 random library is API-incompatible with
-# the python2 one... so someone ported the python2 random to python3
-# and named it 'random2'. random2 is also python2-compatible... so the
-# PySolFC devs changed their code to require random2, even on python
-# 2. So I'm changing it back, to avoid adding an extra (redundant) dependency.
-# The reason for going into such detail about it here, is that maintainers
-# of other python-based packages might run into the same issue someday.
-# I'll have a handy URL to point them to with the fix.
-# Here endeth the rant.
-
-sed -i 's,\<random2\>,random,' pysollib/pysolrandom.py
-
-python setup.py install --root $PKG
+rm -rf $TARDIR
+tar xvf $TARBALL
+cd $TARDIR
+fixperms .
+
+# do not use 'make install', it has no way to pass --root to setup.py.
+# "mo" creates the UI translations. "rules" and "all_games_html" make
+# the docs. setup.py will install the docs & translations if they
+# exist.
+make mo
+make rules
+make all_games_html
+python3 setup.py install --root $PKG
mkdir -p $PKG/usr/man/man6
gzip -9c < docs/$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz
@@ -117,14 +108,16 @@ ln -s $PRGNAM.6.gz $PKG/usr/man/man6/pysol.py.6
# The minimal cardsets are now required, since the source tarball
# has none. Extract directly to $PKG instead of extracting and copying.
tar xvf $CWD/$CARDSETS.tar.xz -C $PKG/usr/share/$SRCNAM/ --strip-components=1
+fixperms $PKG/usr/share/$SRCNAM
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a README.md COPYING docs/README $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+# old-style icon, in case something needs it.
+mkdir -p $PKG/usr/share/pixmaps
+ln -s ../icons/hicolor/48x48/apps/pysol.png $PKG/usr/share/pixmaps/pysol.png
-# Handy HTML list of all the games, but with hardcoded (wrong) paths.
-sed '/href=/s,"[^"]*/data,"/usr/share/'$SRCNAM, docs/all_games.html > \
- $PKG/usr/doc/$PRGNAM-$VERSION/all_games.html
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a contrib/*.asciidoc *.md NEWS.* COPYING docs/README $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc