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