diff options
author | B. Watson <yalhcru@gmail.com> | 2021-10-20 16:31:20 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-10-29 17:07:20 +0700 |
commit | 9c060af33789d7d7a204d94b4377515b9bccee18 (patch) | |
tree | 42f1772cc4a774a4c0ba64aa4b8ff9d51b35d7f7 /games/oblige/oblige.SlackBuild | |
parent | c11a44608267a4df27b7721533c42102d2ee953b (diff) |
games/oblige: Fix -current build.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/oblige/oblige.SlackBuild')
-rw-r--r-- | games/oblige/oblige.SlackBuild | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/games/oblige/oblige.SlackBuild b/games/oblige/oblige.SlackBuild index 8e9d2b491730f..e9deb08bd0088 100644 --- a/games/oblige/oblige.SlackBuild +++ b/games/oblige/oblige.SlackBuild @@ -6,6 +6,11 @@ # Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details. +# 20211020 bkw: BUILD=2 +# - fix -current build. +# - binary in /usr/games. +# - new-style icons. + # 20171220 bkw: # - update for 7.70. Upstream calls this the final release :( @@ -41,7 +46,7 @@ cd $(dirname $0) ; CWD=$(pwd) PRGNAM=oblige VERSION=${VERSION:-7.70} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} PKGTYPE=${PKGTYPE:-tgz} @@ -53,9 +58,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 @@ -84,6 +86,19 @@ set -e SRCVER=${VERSION//./} SRCNAM="Oblige" # grrrr! +if [ ! -e $CWD/swap.$VERSION.diff.gz ]; then + supported="$( echo $( /bin/ls $CWD/*.diff.gz | sed 's,.*/,,' | cut -d. -f2,3 ) )" + cat <<EOF + +*** Unsupported version of oblige: $VERSION. +*** Supported versions are: $supported. +*** The build will probably fail. Press ^C to abort, or wait +*** 10 seconds to continue. + +EOF + sleep 10 +fi + rm -rf $PKG mkdir -p $TMP $PKG/usr/bin $PKG/usr/share/$PRGNAM $OUTPUT cd $TMP @@ -99,32 +114,47 @@ fi cd ${SRCNAM}-${VERSION}-source 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 \ - \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ - -exec chmod 644 {} \; +find -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} \+ -o \ + \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} \+ + +# N.B. these diffs *must* be gzipped, they contain a mix of \n and +# \r\n line endings, git would strip the \r's. +zcat $CWD/swap.$VERSION.diff.gz | patch -p1 # 'make install' would install the .desktop and icon to /usr, not PREFIX. sed -i '/xdg-/d' Makefile # if there's no prefabs/ dir, don't try to install it. doing it this -# way allows this script to still build oblige 7.666, if needed. +# way would allow this script to still build oblige 7.666, if needed. if [ ! -d prefabs ]; then sed -i '/\/prefabs/d' Makefile fi make PREFIX=/usr OPTIMISE="$SLKCFLAGS" make install PREFIX=$PKG/usr +mv $PKG/usr/bin $PKG/usr/games # man page written for this build (based on --help output) mkdir -p $PKG/usr/man/man6 gzip -9c < $CWD/$PRGNAM.6 > $PKG/usr/man/man6/$PRGNAM.6.gz # Starting with 6.20, upstream includes a .desktop and icon. +# The icon's fugly though, see below. mkdir -p $PKG/usr/share/pixmaps $PKG/usr/share/applications -cat misc/icon_128x128.png > $PKG/usr/share/pixmaps/$PRGNAM.png -cat misc/$PRGNAM.desktop > $PKG/usr/share/applications/$PRGNAM.desktop +sed "s,Exec=,Exec=/usr/games/," \ + < misc/$PRGNAM.desktop \ + > $PKG/usr/share/applications/$PRGNAM.desktop + +# icons made from upstream's icon, by turning the background transparent. +for i in $CWD/icons/*.png; do + px=$( basename $i | cut -d. -f1 ) + size=${px}x${px} + dir=$PKG/usr/share/icons/hicolor/$size/apps + mkdir -p $dir + cat $i > $dir/$PRGNAM.png +done + +ln -s ../icons/hicolor/48x48/apps/$PRGNAM.png $PKG/usr/share/pixmaps/$PRGNAM.png mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION rm -f INSTALL.txt # don't need compile instruction in bin package |