File: mkbindist.sh

package info (click to toggle)
gdal 1.10.1+dfsg-8
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 84,320 kB
  • ctags: 74,726
  • sloc: cpp: 677,199; ansic: 162,820; python: 13,816; cs: 11,163; sh: 10,446; java: 5,279; perl: 4,429; php: 2,971; xml: 1,500; yacc: 934; makefile: 494; sql: 112
file content (86 lines) | stat: -rwxr-xr-x 1,779 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/sh

if [ $# -lt 2 ] ; then
  echo "Usage: mkbindist.sh [-dev] version platform [-install]"
  echo
  echo "Example: mkbindist.sh 1.1.5 linux"
  exit
fi

if [ $1 == "-dev" ] ; then
  STRIP_DEV=0
  shift
else
  STRIP_DEV=1
fi

VERSION=$1
PLATFORM=$2

#
# 	Process the version into a suitable format for overriding internal
#       information.
#
VERSION_NUM=`echo $VERSION | tr -c -d 0123456789`000
VERSION_NUM=${VERSION_NUM:0:4}
RELEASE_DATE=`date +%Y%m%d`

USER_DEFS="-DGDAL_VERSION_NUM=$VERSION_NUM -DGDAL_RELEASE_DATE=$RELEASE_DATE -DGDAL_RELEASE_NAME=\\\"$VERSION\\\""

#
#	Build and install.
#

DIST_DIR=gdal-${VERSION}-${PLATFORM}-bin
FULL_DIST_DIR=`pwd`/$DIST_DIR

rm -rf $DIST_DIR
mkdir $DIST_DIR

# ensure gdal_misc (with GDALVersionInfo()) is recompiled.

rm -f gcore/gdal_misc.o apps/gdal-config apps/gdal-config-inst
make 'prefix='$FULL_DIST_DIR 'INST_PYMOD='$FULL_DIST_DIR/pymod 'USER_DEFS='"$USER_DEFS" install
if test \! make ; then
  exit
fi									

#
#      Copy in other info of interest.
#

mkdir $DIST_DIR/html
cp html/* $DIST_DIR/html

cp dist_docs/README_UNX_BIN.TXT $DIST_DIR
cp dist_docs/install_unx.sh $DIST_DIR
cc -o $DIST_DIR/bin/burnpath dist_docs/burnpath.c

#
# Clean anything we don't want for non-developer releases.
#
if [ "$STRIP_DEV" == "1" ] ; then
  rm -f $DIST_DIR/html/class_*
  rm -f $DIST_DIR/html/struct_*
  rm -f $DIST_DIR/html/*-source.html
  rm -f $DIST_DIR/lib/*.a
  rm -rf $DIST_DIR/include
fi

#
# Pack up
#

rm -f ${DIST_DIR}.tar.gz
tar cf ${DIST_DIR}.tar ${DIST_DIR}

echo "Compressing ${DIST_DIR}.tar ... this may take a moment."
gzip -9 ${DIST_DIR}.tar

echo "Prepared: "${DIST_DIR}.tar.gz

TARGETDIR=remotesensing.org:/ftp/remotesensing/pub/gdal

if test "$3" = "-install" ; then
  scp ${DIST_DIR}.tar.gz $TARGETDIR
fi