c++/jvm-jni-starter/nbproject/Package-Release.bash
changeset 55 2fbf53cf0782
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/c++/jvm-jni-starter/nbproject/Package-Release.bash	Sat Jan 20 21:44:45 2018 +0100
     1.3 @@ -0,0 +1,76 @@
     1.4 +#!/bin/bash -x
     1.5 +
     1.6 +#
     1.7 +# Generated - do not edit!
     1.8 +#
     1.9 +
    1.10 +# Macros
    1.11 +TOP=`pwd`
    1.12 +CND_PLATFORM=GNU-Linux
    1.13 +CND_CONF=Release
    1.14 +CND_DISTDIR=dist
    1.15 +CND_BUILDDIR=build
    1.16 +CND_DLIB_EXT=so
    1.17 +NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
    1.18 +TMPDIRNAME=tmp-packaging
    1.19 +OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/jvm-jni-starter
    1.20 +OUTPUT_BASENAME=jvm-jni-starter
    1.21 +PACKAGE_TOP_DIR=jvm-jni-starter/
    1.22 +
    1.23 +# Functions
    1.24 +function checkReturnCode
    1.25 +{
    1.26 +    rc=$?
    1.27 +    if [ $rc != 0 ]
    1.28 +    then
    1.29 +        exit $rc
    1.30 +    fi
    1.31 +}
    1.32 +function makeDirectory
    1.33 +# $1 directory path
    1.34 +# $2 permission (optional)
    1.35 +{
    1.36 +    mkdir -p "$1"
    1.37 +    checkReturnCode
    1.38 +    if [ "$2" != "" ]
    1.39 +    then
    1.40 +      chmod $2 "$1"
    1.41 +      checkReturnCode
    1.42 +    fi
    1.43 +}
    1.44 +function copyFileToTmpDir
    1.45 +# $1 from-file path
    1.46 +# $2 to-file path
    1.47 +# $3 permission
    1.48 +{
    1.49 +    cp "$1" "$2"
    1.50 +    checkReturnCode
    1.51 +    if [ "$3" != "" ]
    1.52 +    then
    1.53 +        chmod $3 "$2"
    1.54 +        checkReturnCode
    1.55 +    fi
    1.56 +}
    1.57 +
    1.58 +# Setup
    1.59 +cd "${TOP}"
    1.60 +mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
    1.61 +rm -rf ${NBTMPDIR}
    1.62 +mkdir -p ${NBTMPDIR}
    1.63 +
    1.64 +# Copy files and create directories and links
    1.65 +cd "${TOP}"
    1.66 +makeDirectory "${NBTMPDIR}/jvm-jni-starter/bin"
    1.67 +copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
    1.68 +
    1.69 +
    1.70 +# Generate tar file
    1.71 +cd "${TOP}"
    1.72 +rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/jvm-jni-starter.tar
    1.73 +cd ${NBTMPDIR}
    1.74 +tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/jvm-jni-starter.tar *
    1.75 +checkReturnCode
    1.76 +
    1.77 +# Cleanup
    1.78 +cd "${TOP}"
    1.79 +rm -rf ${NBTMPDIR}