aboutsummaryrefslogtreecommitdiff
path: root/python/python3-pdfCropMargins/python3-pdfCropMargins.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'python/python3-pdfCropMargins/python3-pdfCropMargins.SlackBuild')
-rw-r--r--python/python3-pdfCropMargins/python3-pdfCropMargins.SlackBuild65
1 files changed, 31 insertions, 34 deletions
diff --git a/python/python3-pdfCropMargins/python3-pdfCropMargins.SlackBuild b/python/python3-pdfCropMargins/python3-pdfCropMargins.SlackBuild
index e1b0374428..f9d0cd03e3 100644
--- a/python/python3-pdfCropMargins/python3-pdfCropMargins.SlackBuild
+++ b/python/python3-pdfCropMargins/python3-pdfCropMargins.SlackBuild
@@ -2,30 +2,22 @@
# Slackware build script for python3-pdfCropMargins
-# Copyright 2023-2024, Alexander Verbovetsky, Moscow, Russia
-# 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.
+# Originally written by Alexander Verbovetsky.
+# Modified and now maintained by B. Watson (urchlay@slackware.uk).
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# 20251111 bkw:
+# - take over maintenance.
+# - relicense as WTFPL with permissions from Alexander.
+# - update for v2.2.1.
+# - remove python3-PySimpleGUI dep (source has it 'vendored').
+# - add LICENSE to doc dir.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=python3-pdfCropMargins
-VERSION=${VERSION:-2.1.4}
+VERSION=${VERSION:-2.2.1}
+SRCDIR=pdfCropMargins-release_$VERSION
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -52,27 +44,32 @@ set -e
rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
-rm -rf pdfCropMargins-release_$VERSION
-tar xvf $CWD/pdfCropMargins-release_$VERSION.tar.gz
-cd pdfCropMargins-release_$VERSION
+rm -rf $SRCDIR
+tar xvf $CWD/$SRCDIR.tar.gz
+cd $SRCDIR
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 640 -o -perm 600 -o -perm 444 \
- -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+find . ! -type l -a \
+ \( -perm /111 -a ! -perm 755 -a -exec chmod -f 755 {} + \) -o \
+ \( ! -perm /111 -a ! -perm 644 -a -exec chmod -f 644 {} + \)
-python3 setup.py install --root=$PKG
+PYVER=$(python3 -c 'import sys; print("%d.%d" % sys.version_info[:2])')
+export PYTHONPATH=/opt/python$PYVER/site-packages
-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
+python3 -m build --wheel --no-isolation
+python3 -m installer --destdir "$PKG" dist/*.whl
rm -f $PKG/usr/bin/pdf-crop-margins
ln -s pdfcropmargins $PKG/usr/bin/pdf-crop-margins
-mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a *.rst $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+# 20251111 bkw: use the newer pillow in /opt
+sed -i \
+ "/^import sys\$/asys.path.insert(0,'/opt/python3.9/site-packages')" \
+ $PKG/usr/bin/pdfcropmargins
+
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a LICENSE* *.rst $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc