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