summaryrefslogtreecommitdiffstats
path: root/system/sunflower/sunflower.SlackBuild
diff options
context:
space:
mode:
author Isaac Yu <isaacyu1@isaacyu1.com>2022-03-05 20:57:04 -0800
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2022-03-07 08:38:02 +0700
commit98766ef8be70b373b52a29d53d8d9e8262c60a2e (patch)
treeafe55fd4cd6c2f63c6ff01d1a6e2b71fee063486 /system/sunflower/sunflower.SlackBuild
parentc952507e7f591796d2986112ec6e3633d91144fd (diff)
downloadslackbuilds-98766ef8be70b373b52a29d53d8d9e8262c60a2e.tar.gz
slackbuilds-98766ef8be70b373b52a29d53d8d9e8262c60a2e.tar.xz
system/sunflower: Update for 0.5.63
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system/sunflower/sunflower.SlackBuild')
-rw-r--r--system/sunflower/sunflower.SlackBuild33
1 files changed, 16 insertions, 17 deletions
diff --git a/system/sunflower/sunflower.SlackBuild b/system/sunflower/sunflower.SlackBuild
index 11cdd289f5..e12ecbfb12 100644
--- a/system/sunflower/sunflower.SlackBuild
+++ b/system/sunflower/sunflower.SlackBuild
@@ -1,7 +1,7 @@
#!/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
@@ -24,13 +24,12 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=sunflower
-VERSION=${VERSION:-0.3}
+SRCVER=${SRCVER:-0.5-63}
+VERSION=${VERSION:-$(echo $SRCVER | sed 's/-/\./g')}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
-COMMIT=61
-
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i586 ;;
@@ -71,7 +70,7 @@ 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 . \
@@ -80,24 +79,24 @@ find -L . \
\( -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"
+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 INSTALL LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install