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