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