aboutsummaryrefslogtreecommitdiff
path: root/graphics/aaphoto/aaphoto.SlackBuild
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/aaphoto/aaphoto.SlackBuild')
-rw-r--r--graphics/aaphoto/aaphoto.SlackBuild73
1 files changed, 38 insertions, 35 deletions
diff --git a/graphics/aaphoto/aaphoto.SlackBuild b/graphics/aaphoto/aaphoto.SlackBuild
index dfba6d20c9b3a..c7e27bf1a2052 100644
--- a/graphics/aaphoto/aaphoto.SlackBuild
+++ b/graphics/aaphoto/aaphoto.SlackBuild
@@ -2,32 +2,23 @@
# Slackware build script for aaphoto
-# Copyright 2020-2023, 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.
+# Original author: Alexander Verbovetsky, Moscow, Russia
+# Now maintained by B. Watson <urchlay@slackware.uk>.
+# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
+
+# 20241007 bkw: BUILD=2
+# - take over maintenance.
+# - make COMMIT overrideable in env (probably not worth doing).
+# - add man page.
+# - patch the code so it prints error messages for unsupported files.
+# - grammar fixes for README and slack-desc.
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=aaphoto
VERSION=${VERSION:-0.45}
-COMMIT="ad4fc3c04b9e25212d78c231e1507458dfea8909" # this is ver. 0.45
-BUILD=${BUILD:-1}
+COMMIT="${COMMIT:-ad4fc3c04b9e25212d78c231e1507458dfea8909}" # this is ver. 0.45
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -67,11 +58,15 @@ rm -rf $PRGNAM-$COMMIT
tar xvf $CWD/${PRGNAM}-${COMMIT}.tar.gz
cd $PRGNAM-$COMMIT
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 -L . -perm /111 -a \! -perm 755 -a -exec chmod 755 {} + -o \
+ \! -perm /111 -a \! -perm 644 -a -exec chmod 644 {} +
+
+# 20241007 bkw: patch makes it print an "image can't be loaded"
+# message for unsupported files (instead of just "done"). Avoids
+# confusing the user. It also makes aaphoto exit with error status if
+# all of the input files were unsupported (success = at least one file
+# was processed).
+patch -p1 < $CWD/err_unsupport_format.diff
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
@@ -80,15 +75,23 @@ CXXFLAGS="$SLKCFLAGS" \
--build=$ARCH-slackware-linux
make
-make install DESTDIR=$PKG
-
-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 -a AUTHORS COPYRIGHT ChangeLog NEWS README REMARKS TODO \
- $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
+make install-strip DESTDIR=$PKG
+
+# 20241007 bkw: man page came from Debian, but has been modified to
+# remove all references to .jp2 and jasper. This is because upstream
+# dropped jp2/jasper support, but forgot to update the man page. I
+# thought about re-adding jp2/jasper support, but it's a good bit of
+# work... and as upstream points out, nobody uses it anyway. I also
+# added some remarks about filename extensions, since aaphoto relies
+# entirely on the extension to determine file type; also documented
+# the exit status (due to the patch, above).
+mkdir -p $PKG/usr/man/man1
+gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
+
+PKGDOC=$PKG/usr/doc/$PRGNAM-$VERSION
+mkdir -p $PKGDOC
+cp -a AUTHORS COPYRIGHT ChangeLog NEWS README REMARKS TODO $PKGDOC
+cat $CWD/$PRGNAM.SlackBuild > $PKGDOC/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc