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