Blob Blame Raw
#!/bin/sh

# make sure if some of the commands fails, we will know about that
set -e

if [ $# -ne 1 ]
then
  echo Usage : ./josm-generate-tarball.sh JOSM_SVN_TAG
  exit 1
fi

NAME_VERSION=josm-0
NAME=josm
JOSM_SVN_TAG=$1

# to know svn revision for josm translation, check it in MANIFEST.MF provided by josm svn in trunk/lib/josm-tranlsation.jar

# removing old sources files if exists
rm -rf ${NAME_VERSION} 

# cheking out josm svn
svn -r ${JOSM_SVN_TAG} export https://josm.openstreetmap.de/svn/trunk/ ${NAME_VERSION}

# Delete org.apache.tools.bzip2, it can be found in buildrequires ant package
rm -r ${NAME_VERSION}/src/org/apache
# Delete org.glassfish.json, it can be found in buildrequires ant package
rm -r ${NAME_VERSION}/src/org/glassfish

# Add REVISION.XML to source files
svn -r ${JOSM_SVN_TAG} co https://josm.openstreetmap.de/svn/trunk/ temporary_dir
svn info --xml temporary_dir > ${NAME_VERSION}/REVISION.XML
rm -rf temporary_dir

# creating source tar
tar zcvf ${NAME_VERSION}.${JOSM_SVN_TAG}svn.tar.gz ${NAME_VERSION} #i18n plugins

# delete temporary directories
rm -rf ${NAME_VERSION} #i18n plugins