From ae9928fc788ce46e4e9664f2e037e8cc2eb996a0 Mon Sep 17 00:00:00 2001 From: Heinz Wiesinger Date: Sat, 3 Jul 2021 10:38:53 +0200 Subject: *.SlackBuild: Support $PRINT_PACKAGE_NAME env var Signed-off-by: Heinz Wiesinger --- python-template.SlackBuild | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'python-template.SlackBuild') diff --git a/python-template.SlackBuild b/python-template.SlackBuild index 53edbe1..ecf7492 100644 --- a/python-template.SlackBuild +++ b/python-template.SlackBuild @@ -54,6 +54,7 @@ PRGNAM=appname # replace with name of program VERSION=${VERSION:-1.4.1} # replace with version of program BUILD=${BUILD:-1} TAG=${TAG:-_SBo} # the "_SBo" is required +PKGTYPE=${PKGTYPE:-tgz} # Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then @@ -65,6 +66,14 @@ if [ -z "$ARCH" ]; then esac fi +# If the variable PRINT_PACKAGE_NAME is set, then this script will report what +# the name of the created package would be, and then exit. This information +# could be useful to other scripts. +if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then + echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE" + exit 0 +fi + TMP=${TMP:-/tmp/SBo} # For consistency's sake, use this PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} # Drop the package in /tmp @@ -136,4 +145,4 @@ cat $CWD/doinst.sh > $PKG/install/doinst.sh # your custom contents of doinst.sh runs, then add the -p switch to # the makepkg command below -- see makepkg(8) for details 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 -- cgit v1.2.3