c++/parameter-lister/nbproject/Package-Release.bash
author František Kučera <franta-hg@frantovo.cz>
Sun, 11 Sep 2016 00:00:55 +0200
changeset 27 f08e42c1efc0
parent 0 7399cb02184b
permissions -rw-r--r--
c++ Makefiles + java: .hgignore
franta-hg@0
     1
#!/bin/bash -x
franta-hg@0
     2
franta-hg@0
     3
#
franta-hg@0
     4
# Generated - do not edit!
franta-hg@0
     5
#
franta-hg@0
     6
franta-hg@0
     7
# Macros
franta-hg@0
     8
TOP=`pwd`
franta-hg@27
     9
CND_PLATFORM=GNU-Linux
franta-hg@0
    10
CND_CONF=Release
franta-hg@0
    11
CND_DISTDIR=dist
franta-hg@0
    12
CND_BUILDDIR=build
franta-hg@0
    13
CND_DLIB_EXT=so
franta-hg@0
    14
NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
franta-hg@0
    15
TMPDIRNAME=tmp-packaging
franta-hg@0
    16
OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/parameter-lister
franta-hg@0
    17
OUTPUT_BASENAME=parameter-lister
franta-hg@0
    18
PACKAGE_TOP_DIR=parameter-lister/
franta-hg@0
    19
franta-hg@0
    20
# Functions
franta-hg@0
    21
function checkReturnCode
franta-hg@0
    22
{
franta-hg@0
    23
    rc=$?
franta-hg@0
    24
    if [ $rc != 0 ]
franta-hg@0
    25
    then
franta-hg@0
    26
        exit $rc
franta-hg@0
    27
    fi
franta-hg@0
    28
}
franta-hg@0
    29
function makeDirectory
franta-hg@0
    30
# $1 directory path
franta-hg@0
    31
# $2 permission (optional)
franta-hg@0
    32
{
franta-hg@0
    33
    mkdir -p "$1"
franta-hg@0
    34
    checkReturnCode
franta-hg@0
    35
    if [ "$2" != "" ]
franta-hg@0
    36
    then
franta-hg@0
    37
      chmod $2 "$1"
franta-hg@0
    38
      checkReturnCode
franta-hg@0
    39
    fi
franta-hg@0
    40
}
franta-hg@0
    41
function copyFileToTmpDir
franta-hg@0
    42
# $1 from-file path
franta-hg@0
    43
# $2 to-file path
franta-hg@0
    44
# $3 permission
franta-hg@0
    45
{
franta-hg@0
    46
    cp "$1" "$2"
franta-hg@0
    47
    checkReturnCode
franta-hg@0
    48
    if [ "$3" != "" ]
franta-hg@0
    49
    then
franta-hg@0
    50
        chmod $3 "$2"
franta-hg@0
    51
        checkReturnCode
franta-hg@0
    52
    fi
franta-hg@0
    53
}
franta-hg@0
    54
franta-hg@0
    55
# Setup
franta-hg@0
    56
cd "${TOP}"
franta-hg@0
    57
mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
franta-hg@0
    58
rm -rf ${NBTMPDIR}
franta-hg@0
    59
mkdir -p ${NBTMPDIR}
franta-hg@0
    60
franta-hg@0
    61
# Copy files and create directories and links
franta-hg@0
    62
cd "${TOP}"
franta-hg@0
    63
makeDirectory "${NBTMPDIR}/parameter-lister/bin"
franta-hg@0
    64
copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}bin/${OUTPUT_BASENAME}" 0755
franta-hg@0
    65
franta-hg@0
    66
franta-hg@0
    67
# Generate tar file
franta-hg@0
    68
cd "${TOP}"
franta-hg@0
    69
rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/parameter-lister.tar
franta-hg@0
    70
cd ${NBTMPDIR}
franta-hg@0
    71
tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/parameter-lister.tar *
franta-hg@0
    72
checkReturnCode
franta-hg@0
    73
franta-hg@0
    74
# Cleanup
franta-hg@0
    75
cd "${TOP}"
franta-hg@0
    76
rm -rf ${NBTMPDIR}