summaryrefslogtreecommitdiffstats
path: root/system/trash-cli
diff options
context:
space:
mode:
Diffstat (limited to 'system/trash-cli')
-rw-r--r--system/trash-cli/README3
-rw-r--r--system/trash-cli/slack-desc12
-rw-r--r--system/trash-cli/trash-cli.SlackBuild53
-rw-r--r--system/trash-cli/trash-cli.info12
4 files changed, 43 insertions, 37 deletions
diff --git a/system/trash-cli/README b/system/trash-cli/README
index 3d1f4c8749..94d4c378b7 100644
--- a/system/trash-cli/README
+++ b/system/trash-cli/README
@@ -9,3 +9,6 @@ trash-empty : empty the trashcan(s).
trash-list : list trashed files.
trash-restore : restore a trashed file.
trash-rm : remove individual files from trash can.
+
+python3-shtab is additionally required for installing trash-cli with
+shell completion support.
diff --git a/system/trash-cli/slack-desc b/system/trash-cli/slack-desc
index 850ad04dee..1e01ec84e9 100644
--- a/system/trash-cli/slack-desc
+++ b/system/trash-cli/slack-desc
@@ -11,9 +11,9 @@ trash-cli:
trash-cli: trash-cli trashes files recording the original path, deletion date,
trash-cli: and permissions. It uses the same trashcan used by KDE, GNOME, and
trash-cli: XFCE, but you can invoke it from the command line (and scripts).
-trash-cli: It provides these commands:
-trash-cli: trash-put : trashes files and directories.
-trash-cli: trash-empty : empty the trashcan(s).
-trash-cli: trash-list : list trashed files.
-trash-cli: trash-restore : restore a trashed file.
-trash-cli: trash-rm : remove individual files from trash can.
+trash-cli:
+trash-cli:
+trash-cli:
+trash-cli:
+trash-cli:
+trash-cli:
diff --git a/system/trash-cli/trash-cli.SlackBuild b/system/trash-cli/trash-cli.SlackBuild
index a345343671..3f483b4c46 100644
--- a/system/trash-cli/trash-cli.SlackBuild
+++ b/system/trash-cli/trash-cli.SlackBuild
@@ -1,9 +1,10 @@
-#!/bin/sh
+#!/bin/bash
# Slackware build script for the trash-cli utils.
#
# Copyright 2010 Pierre Cazenave <pwcazenave {at} gmail [dot] com>
# Copyright 2017 Donald Cooley South Haven, IN USA
+# Copyright 2022-2024 Isaac Yu <isaacyu@protonmail.com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -24,10 +25,13 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+cd $(dirname $0) ; CWD=$(pwd)
+
PRGNAM=trash-cli
-VERSION=${VERSION:-0.17.1.14}
+VERSION=${VERSION:-0.24.5.26}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
+PKGTYPE=${PKGTYPE:-tgz}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -37,25 +41,15 @@ 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}
-if [ "$ARCH" = "i586" ]; then
- SLKCFLAGS="-O2 -march=i586 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "i686" ]; then
- SLKCFLAGS="-O2 -march=i686 -mtune=i686"
- LIBDIRSUFFIX=""
-elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
- LIBDIRSUFFIX="64"
-else
- SLKCFLAGS="-O2"
- LIBDIRSUFFIX=""
-fi
-
set -e
rm -rf $PKG
@@ -71,22 +65,31 @@ 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 {} \;
-python setup.py install --root=$PKG
+# Fix man path
+sed 's|share/man/|man/|' -i setup.cfg
+
+python3 setup.py install --root=$PKG
+
+# Add trash-cli shell completions (requires python3-shtab)
+# Reference: https://github.com/zsh-users/zsh-completions/pull/895
+if $(python3 -c 'import pkgutil; exit(not pkgutil.find_loader("shtab"))'); then
+ mkdir -p $PKG/usr/share/bash-completion/completions
+ mkdir -p $PKG/usr/share/zsh/site-functions
+ for CMD in trash-empty trash-list trash-restore trash-put trash; do
+ $CMD --print-completion bash > "$PKG/usr/share/bash-completion/completions/$CMD"
+ $CMD --print-completion zsh > "$PKG/usr/share/zsh/site-functions/_$CMD"
+ done
+fi
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 $PKG/usr/man
-mv $PKG/usr/share/man/ $PKG/usr/
-rmdir $PKG/usr/share
-
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
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a \
- COPYING CREDITS.txt DONE.txt HISTORY.txt README.rst TODO.txt \
- bugs.txt requirements-dev.txt docs \
+ COPYING CREDITS.txt HISTORY.txt README.rst requirements-dev.txt docs \
$PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
@@ -94,4 +97,4 @@ mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
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
diff --git a/system/trash-cli/trash-cli.info b/system/trash-cli/trash-cli.info
index 4e107d9bb4..9ab849adc1 100644
--- a/system/trash-cli/trash-cli.info
+++ b/system/trash-cli/trash-cli.info
@@ -1,10 +1,10 @@
PRGNAM="trash-cli"
-VERSION="0.17.1.14"
+VERSION="0.24.5.26"
HOMEPAGE="https://github.com/andreafrancia/trash-cli"
-DOWNLOAD="https://github.com/andreafrancia/trash-cli/archive/0.17.1.14/trash-cli-0.17.1.14.tar.gz"
-MD5SUM="75ccadb291fdef88cd7175d609fc6409"
+DOWNLOAD="https://github.com/andreafrancia/trash-cli/archive/0.24.5.26/trash-cli-0.24.5.26.tar.gz"
+MD5SUM="e3d0c09b2c411313ec64aa8cb00c4758"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES=""
-MAINTAINER="Donald Cooley"
-EMAIL="chytraeu@sdf.org"
+REQUIRES="python3-psutil"
+MAINTAINER="Isaac Yu"
+EMAIL="isaacyu@protonmail.com"