#!/bin/sh

# Leaves output .bz2 files in c:/
# Assumes the proj-* directory is inside a directory named src for
# easy source packaging.

VER=4.6.0-3

SRCDIR=`pwd`
TGTDIR=/cygdrive/c/proj_release

nmake /f makefile.vc

rm -rf $TGTDIR

nmake /f makefile.vc install
nmake /f makefile.vc clean

# rename release/share to release/share/proj

mv $TGTDIR/share $TGTDIR/proj
mkdir $TGTDIR/share
mv $TGTDIR/proj $TGTDIR/share/proj

# We want to include the other.extra definitions in our epsg file

cat $TGTDIR/share/proj/other.extra >> $TGTDIR/share/proj/epsg

# OGDI needs the old projects.h

cp src/projects.h $TGTDIR/include

# No point in distributing the static library

rm $TGTDIR/lib/proj.lib

cd $TGTDIR
tar cjvf /cygdrive/c/proj-$VER.tar.bz2 bin lib share include

rm -rf $TGTDIR

cd $SRCDIR/../..

tar cjvf /cygdrive/c/proj-$VER-src.tar.bz2 src/proj*
