forked from OSGeo/gdal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
mkgdaldist.sh
executable file
·82 lines (63 loc) · 1.93 KB
/
mkgdaldist.sh
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
#!/bin/sh
if [ $# -lt 1 ] ; then
echo "Usage: mkgdaldist version [-date date] [-install] [-nologin]"
echo
echo "Example: mkgdaldist 1.1.4"
exit
fi
GDAL_VERSION=$1
COMPRESSED_VERSION=`echo $GDAL_VERSION | tr -d .`
if test "$GDAL_VERSION" != "`cat VERSION`" ; then
echo
echo "NOTE: local VERSION file (`cat VERSION`) does not match supplied version ($GDAL_VERSION)."
echo " Consider updating local VERSION file, and commiting to CVS."
echo
fi
if test "$2" = "-date" ; then
forcedate=$3
shift
shift
else
forcedate=no
fi
rm -rf dist_wrk
mkdir dist_wrk
cd dist_wrk
export CVSROOT=:pserver:[email protected]:/cvs/maptools/cvsroot
if test "$2" = "-nologin" -o "$3" = "-nologin" ; then
echo "Skipping login"
else
echo "Please type anonymous if prompted for a password."
cvs login
fi
cvs -Q checkout gdal
if [ \! -d gdal ] ; then
echo "cvs checkout reported an error ... abandoning mkgdaldist"
cd ..
rm -rf dist_wrk
exit
fi
if test "$forcedate" != "no" ; then
echo "Forcing Date To: $forcedate"
rm -f gdal/gcore/gdal_new.h
sed -e "/define GDAL_RELEASE_DATE/s/20[0-9][0-9][0-9][0-9][0-9][0-9]/$forcedate/" gdal/gcore/gdal.h > gdal/gcore/gdal_new.h
mv gdal/gcore/gdal_new.h gdal/gcore/gdal.h
fi
find gdal -name CVS -exec rm -rf {} \;
rm -rf gdal/viewer
rm -rf gdal/dist_docs
rm -f gdal/VERSION
echo $GDAL_VERSION > gdal/VERSION
mv gdal gdal-${GDAL_VERSION}
rm -f ../gdal-${GDAL_VERSION}.tar.gz ../gdal${COMPRESSED_VERSION}.zip
tar cf ../gdal-${GDAL_VERSION}.tar gdal-${GDAL_VERSION}
gzip -9 ../gdal-${GDAL_VERSION}.tar
zip -r ../gdal${COMPRESSED_VERSION}.zip gdal-${GDAL_VERSION}
cd ..
rm -rf dist_wrk
TARGETDIR=remotesensing.org:/ftp/remotesensing/pub/gdal
if test "$2" = "-install" ; then
echo "Installing: " $TARGETDIR/gdal-${GDAL_VERSION}.tar.gz
echo " and: " $TARGETDIR/gdal${COMPRESSED_VERSION}.zip
scp gdal-${GDAL_VERSION}.tar.gz $TARGETDIR/gdal${COMPRESSED_VERSION}.zip $TARGETDIR
fi