summaryrefslogtreecommitdiffstats
path: root/system/sunflower/sunflower.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'system/sunflower/sunflower.SlackBuild')
-rw-r--r--system/sunflower/sunflower.SlackBuild56
1 files changed, 33 insertions, 23 deletions
diff --git a/system/sunflower/sunflower.SlackBuild b/system/sunflower/sunflower.SlackBuild
index a4d545f82a..3368022b3b 100644
--- a/system/sunflower/sunflower.SlackBuild
+++ b/system/sunflower/sunflower.SlackBuild
@@ -1,7 +1,7 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for sunflower
-# Copyright 2020 Isaac Yu <isaacyu1@isaacyu1.com>
+# Copyright 2020-2022 Isaac Yu <isaacyu1@isaacyu1.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -21,12 +21,18 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# 20220312 bkw: Modified by SlackBuilds.org: VERSION must be constant,
+# and match VERSION in the .info file. Also, do not install useless
+# INSTALL in documentation directory.
+
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=sunflower
-VERSION=${VERSION:-0.3}
+VERSION=${VERSION:-0.5_63}
+SRCVER="$( echo $VERSION | tr _ - )"
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
-
-COMMIT=61
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -36,7 +42,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}
@@ -61,33 +71,33 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf Sunflower
-tar xvf $CWD/$PRGNAM-$VERSION-$COMMIT.tgz
+tar xvf $CWD/$PRGNAM-$SRCVER.tgz
cd Sunflower
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 {} \;
-
-# Treat sunflower as an executable
-mkdir -p "$PKG/usr/bin"
-[ ! -f "$PKG/usr/bin/sunflower" ] \
- && echo -e '#!/bin/bash\nexec python /usr/share/sunflower/Sunflower.py "$@"' > "$PKG/usr/bin/sunflower"
-chmod 755 "$PKG/usr/bin/sunflower"
-
-# Copy other files
-mkdir -p "$PKG/usr/share/sunflower"
-cp -r Sunflower.py application images translations "$PKG/usr/share/sunflower/"
-install -Dm644 Sunflower.desktop "$PKG/usr/share/applications/sunflower.desktop"
-install -Dm644 images/sunflower.svg "$PKG/usr/share/pixmaps/sunflower.svg"
+ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \+
+
+python3 setup.py install --root=$PKG
+
+# Detect Python 3 version
+# Code taken from FabioLolix, at Arch Linux AUR:
+# https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=sunflower
+PYVER=$(python3 -c "from sys import version_info; print(\"%d.%d\" % (version_info[0],version_info[1]))")
+
+# Copy icons and translations
+install -Dm644 images/sunflower.svg "$PKG/usr/lib/python${PYVER}/site-packages/images/sunflower.svg"
install -Dm644 images/sunflower.png "$PKG/usr/share/pixmaps/sunflower.png"
+cp -r translations "$PKG/usr/share/locale/"
+rmdir $PKG/usr/share/sunflower/translations
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
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp AUTHORS CHANGES COPYING DEPENDS LICENSE README.md TODO $PKG/usr/doc/$PRGNAM-$VERSION
+cp AUTHORS CHANGES COPYING LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
@@ -95,4 +105,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