nbproject/Package-Debug.bash
branchv_0
changeset 0 ea747b9d46d0
equal deleted inserted replaced
-1:000000000000 0:ea747b9d46d0
       
     1 #!/bin/bash -x
       
     2 
       
     3 #
       
     4 # Generated - do not edit!
       
     5 #
       
     6 
       
     7 # Macros
       
     8 TOP=`pwd`
       
     9 CND_PLATFORM=GNU-Linux
       
    10 CND_CONF=Debug
       
    11 CND_DISTDIR=dist
       
    12 CND_BUILDDIR=build
       
    13 CND_DLIB_EXT=so
       
    14 NBTMPDIR=${CND_BUILDDIR}/${CND_CONF}/${CND_PLATFORM}/tmp-packaging
       
    15 TMPDIRNAME=tmp-packaging
       
    16 OUTPUT_PATH=${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/librelpipe-lib-writer.cpp.${CND_DLIB_EXT}
       
    17 OUTPUT_BASENAME=librelpipe-lib-writer.cpp.${CND_DLIB_EXT}
       
    18 PACKAGE_TOP_DIR=librelpipe-lib-writer.cpp.so/
       
    19 
       
    20 # Functions
       
    21 function checkReturnCode
       
    22 {
       
    23     rc=$?
       
    24     if [ $rc != 0 ]
       
    25     then
       
    26         exit $rc
       
    27     fi
       
    28 }
       
    29 function makeDirectory
       
    30 # $1 directory path
       
    31 # $2 permission (optional)
       
    32 {
       
    33     mkdir -p "$1"
       
    34     checkReturnCode
       
    35     if [ "$2" != "" ]
       
    36     then
       
    37       chmod $2 "$1"
       
    38       checkReturnCode
       
    39     fi
       
    40 }
       
    41 function copyFileToTmpDir
       
    42 # $1 from-file path
       
    43 # $2 to-file path
       
    44 # $3 permission
       
    45 {
       
    46     cp "$1" "$2"
       
    47     checkReturnCode
       
    48     if [ "$3" != "" ]
       
    49     then
       
    50         chmod $3 "$2"
       
    51         checkReturnCode
       
    52     fi
       
    53 }
       
    54 
       
    55 # Setup
       
    56 cd "${TOP}"
       
    57 mkdir -p ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package
       
    58 rm -rf ${NBTMPDIR}
       
    59 mkdir -p ${NBTMPDIR}
       
    60 
       
    61 # Copy files and create directories and links
       
    62 cd "${TOP}"
       
    63 makeDirectory "${NBTMPDIR}/librelpipe-lib-writer.cpp.so/lib"
       
    64 copyFileToTmpDir "${OUTPUT_PATH}" "${NBTMPDIR}/${PACKAGE_TOP_DIR}lib/${OUTPUT_BASENAME}" 0644
       
    65 
       
    66 
       
    67 # Generate tar file
       
    68 cd "${TOP}"
       
    69 rm -f ${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/librelpipe-lib-writer.cpp.so.tar
       
    70 cd ${NBTMPDIR}
       
    71 tar -vcf ../../../../${CND_DISTDIR}/${CND_CONF}/${CND_PLATFORM}/package/librelpipe-lib-writer.cpp.so.tar *
       
    72 checkReturnCode
       
    73 
       
    74 # Cleanup
       
    75 cd "${TOP}"
       
    76 rm -rf ${NBTMPDIR}