diff --git a/slackbuild/slpkg.SlackBuild b/slackbuild/slpkg.SlackBuild index cfdf8442..67e8a27b 100755 --- a/slackbuild/slpkg.SlackBuild +++ b/slackbuild/slpkg.SlackBuild @@ -28,10 +28,13 @@ cat ../slpkg/__metadata__.py | grep "__version_info__ = (" \ | tr -d [[:space:]] | cut -c19-23 | tr , . } +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=slpkg VERSION=${VERSION:-$(__version)} BUILD=${BUILD:-1} TAG=${TAG:-_dsw} +PKGTYPE=${PKGTYPE:-txz} INSTALL="upgradepkg --install-new" if [ -z "$ARCH" ]; then @@ -42,7 +45,14 @@ if [ -z "$ARCH" ]; then esac fi -CWD=$(pwd) +# 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} PKG=$TMP/package-$PRGNAM OUTPUT=${OUTPUT:-/tmp} @@ -107,6 +117,6 @@ cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/doinst.sh > $PKG/install/doinst.sh cd $PKG -/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE $INSTALL $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.txz