diff options
Diffstat (limited to 'graphics/wine-nine-standalone/wine-nine-standalone.SlackBuild')
-rw-r--r-- | graphics/wine-nine-standalone/wine-nine-standalone.SlackBuild | 65 |
1 files changed, 48 insertions, 17 deletions
diff --git a/graphics/wine-nine-standalone/wine-nine-standalone.SlackBuild b/graphics/wine-nine-standalone/wine-nine-standalone.SlackBuild index 7fe308d1fa..f9a9ca606e 100644 --- a/graphics/wine-nine-standalone/wine-nine-standalone.SlackBuild +++ b/graphics/wine-nine-standalone/wine-nine-standalone.SlackBuild @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Slackware build script for wine-nine-standalone @@ -22,10 +22,13 @@ # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +cd $(dirname $0) ; CWD=$(pwd) + PRGNAM=wine-nine-standalone -VERSION=${VERSION:-0.6} +VERSION=${VERSION:-0.8} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} +PKGTYPE=${PKGTYPE:-tgz} if [ -z "$ARCH" ]; then case "$( uname -m )" in @@ -35,7 +38,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} @@ -57,33 +67,54 @@ fi set -eu exists () { - v=1 + r=0; cwd="$(pwd)" while [ $# -gt 0 ]; do - arg="$1"; shift + v=1; arg="$1"; shift case "$arg" in ''|*/ ) : ;; - */* ) + /* ) if [ -f "$arg" ] && [ -x "$arg" ]; then printf %s\\n "$arg" v=0 fi ;; + ./* ) + if [ -f "$arg" ] && [ -x "$arg" ]; then + pre="$(cd -- "${arg%%/*}/" && pwd)" + printf %s\\n "${pre%/}/$arg" + v=0 + fi + ;; + */* ) + if [ -f "$arg" ] && [ -x "$arg" ]; then + printf %s\\n "$(cd -- "${arg%%/*}/.." && pwd)/$arg" + v=0 + fi + ;; * ) - p=":$PATH" - while [ "$p" != "${p#*:}" ]; do - p="${p#*:}"; d="${p%%:*}/$arg" - if [ -f "$d" ] && [ -x "$d" ]; then - printf %s\\n "$d" - v=0 - break - fi - done + if [ -n "${PATH+x}" ]; then + p=":${PATH:-$cwd}" + while [ "$p" != "${p#*:}" ] && [ -n "${p#*:}" ]; do + p="${p#*:}"; x="${p%%:*}"; z="${x:-$cwd}"; d="${z%/}/$arg" + if [ -f "$d" ] && [ -x "$d" ]; then + case "$d" in + /* ) : ;; + ./* ) pre="$(cd -- "${d%/*}/" && pwd)"; d="${pre%/}/$d" ;; + * ) d="$(cd -- "${d%/*}/" && pwd)/$arg" ;; + esac + printf %s\\n "$d" + v=0 + break + fi + done + fi ;; esac + [ $v = 0 ] || r=1 done - return $v + return $r } rm -rf $PKG @@ -168,4 +199,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 |