[5148] | 1 | #!/bin/bash
|
---|
| 2 |
|
---|
[5204] | 3 | # Creates an josm-setup-xy.exe File
|
---|
[5229] | 4 | #
|
---|
[5148] | 5 | # for working on a debian-unix system install the nsis package with
|
---|
| 6 | # apt-get install nsis
|
---|
[5164] | 7 | # replace the /usr/share/nsis/Plugins/System.dll with the Version from the nsis .zip File
|
---|
| 8 | # The one comming with the debian package is missing the Call:: Function
|
---|
| 9 | # See also /usr/share/doc/nsis/README.Debian
|
---|
| 10 | #
|
---|
| 11 | # Then download launch4j from http://launch4j.sourceforge.net/
|
---|
| 12 | # wget http://mesh.dl.sourceforge.net/sourceforge/launch4j/launch4j-3.0.0-pre2-linux.tgz
|
---|
| 13 | # and unpack it to /usr/share/launch4j
|
---|
[5148] | 14 |
|
---|
| 15 | ## settings ##
|
---|
| 16 |
|
---|
[14191] | 17 | # trying to find launch4j
|
---|
[14189] | 18 | if [ -s /cygdrive/c/Programme/Launch4j/launch4jc.exe ]; then
|
---|
[14191] | 19 | # Windows under cygwin
|
---|
| 20 | LAUNCH4J="/cygdrive/c/Programme/Launch4j/launch4jc.exe"
|
---|
| 21 | elif [ -s /usr/share/launch4j/launch4j.jar ]; then
|
---|
| 22 | # as described above
|
---|
| 23 | LAUNCH4J="java -jar /usr/share/launch4j/launch4j.jar"
|
---|
[17706] | 24 | elif [ -s ../launch4j/launch4j.jar ]; then
|
---|
| 25 | LAUNCH4J="java -jar ../launch4j/launch4j.jar"
|
---|
[29367] | 26 | elif [ -s $HOME/launch4j/launch4j.jar ]; then
|
---|
| 27 | LAUNCH4J="java -jar $HOME/launch4j/launch4j.jar"
|
---|
[14191] | 28 | else
|
---|
| 29 | # launch4j installed locally under this nsis folder
|
---|
| 30 | LAUNCH4J="java -jar ./launch4j/launch4j.jar"
|
---|
[14189] | 31 | fi
|
---|
[14191] | 32 | echo Using launch4j: $LAUNCH4J
|
---|
[14189] | 33 |
|
---|
[14191] | 34 | # trying to find makensis
|
---|
| 35 | if [ -s /cygdrive/c/Programme/nsis/makensis.exe ]; then
|
---|
| 36 | # Windows under cygwin
|
---|
| 37 | MAKENSIS="/cygdrive/c/Programme/nsis/makensis.exe"
|
---|
| 38 | else
|
---|
| 39 | # UNIX like
|
---|
[17706] | 40 | MAKENSIS=/usr/bin/makensis
|
---|
[14191] | 41 | fi
|
---|
| 42 | echo Using NSIS: $MAKENSIS
|
---|
[14189] | 43 |
|
---|
[17706] | 44 | if [ -n "$1" ]; then
|
---|
| 45 | export VERSION=$1
|
---|
| 46 | export JOSM_BUILD="no"
|
---|
| 47 | export WEBKIT_DOWNLAD="no"
|
---|
[24927] | 48 | export JOSM_FILE="/home/josm/www/download/josm-tested.jar"
|
---|
[17706] | 49 | else
|
---|
| 50 | svncorerevision=`svnversion ../core`
|
---|
| 51 | svnpluginsrevision=`svnversion ../plugins`
|
---|
| 52 | svnrevision="$svncorerevision-$svnpluginsrevision"
|
---|
[5148] | 53 |
|
---|
[17706] | 54 | export VERSION=custom-${svnrevision}
|
---|
| 55 | export JOSM_BUILD="yes"
|
---|
| 56 | export WEBKIT_DOWNLOAD="yes"
|
---|
[18004] | 57 | export JOSM_FILE="..\core\dist\josm-custom.jar"
|
---|
[17706] | 58 | fi
|
---|
[5157] | 59 |
|
---|
[5204] | 60 | echo "Creating Windows Installer for josm-$VERSION"
|
---|
[5157] | 61 |
|
---|
[14189] | 62 | echo
|
---|
| 63 | echo "##################################################################"
|
---|
| 64 | echo "### Download and unzip the webkit stuff"
|
---|
[17706] | 65 | if [ "x$WEBKIT_DOWNLOAD" == "xyes" ]; then
|
---|
| 66 | wget --continue --timestamping http://josm.openstreetmap.de/download/windows/webkit-image.zip
|
---|
| 67 | fi
|
---|
[14189] | 68 | mkdir -p webkit-image
|
---|
| 69 | cd webkit-image
|
---|
| 70 | unzip -o ../webkit-image.zip
|
---|
| 71 | cd ..
|
---|
| 72 |
|
---|
| 73 | echo
|
---|
| 74 | echo "##################################################################"
|
---|
| 75 | echo "### Build the Complete josm + Plugin Stuff"
|
---|
[17706] | 76 | if [ "x$JOSM_BUILD" == "xyes" ]; then
|
---|
[5149] | 77 | (
|
---|
| 78 | echo "Build the Complete josm Stuff"
|
---|
[5148] | 79 |
|
---|
[5149] | 80 | echo "Compile Josm"
|
---|
| 81 | cd ../core
|
---|
[5156] | 82 | ant -q clean
|
---|
| 83 | ant -q compile || exit -1
|
---|
[5149] | 84 | cd ..
|
---|
| 85 |
|
---|
| 86 | echo "Compile Josm Plugins"
|
---|
| 87 | cd plugins
|
---|
[5156] | 88 | ant -q clean
|
---|
| 89 | ant -q dist || exit -1
|
---|
[5149] | 90 | ) || exit -1
|
---|
[5148] | 91 | fi
|
---|
| 92 |
|
---|
[18004] | 93 | /bin/cp $JOSM_FILE josm-tested.jar
|
---|
[5149] | 94 | echo
|
---|
| 95 | echo "##################################################################"
|
---|
| 96 | echo "### convert jar to exe with launch4j"
|
---|
[5204] | 97 | # (an exe file makes attaching to file extensions a lot easier)
|
---|
[5148] | 98 | # launch4j - http://launch4j.sourceforge.net/
|
---|
[5229] | 99 | # delete old exe file first
|
---|
[17706] | 100 | /bin/rm -f josm.exe
|
---|
[14186] | 101 | $LAUNCH4J "launch4j.xml"
|
---|
[5148] | 102 |
|
---|
[5164] | 103 | if ! [ -s josm.exe ]; then
|
---|
| 104 | echo "NO Josm File Created"
|
---|
| 105 | exit -1
|
---|
| 106 | fi
|
---|
| 107 |
|
---|
[5149] | 108 | echo
|
---|
| 109 | echo "##################################################################"
|
---|
[11594] | 110 | echo "### create the josm-installer-${VERSION}.exe with makensis"
|
---|
[5148] | 111 | # NSIS - http://nsis.sourceforge.net/Main_Page
|
---|
| 112 | # apt-get install nsis
|
---|
[14186] | 113 | $MAKENSIS -V2 -DVERSION=$VERSION josm.nsi
|
---|
[5214] | 114 |
|
---|
[14186] | 115 | # keep the intermediate file, for debugging
|
---|
[17706] | 116 | /bin/rm josm-intermediate.exe 2>/dev/null >/dev/null
|
---|
[18004] | 117 | /bin/rm -f josm-tested.jar 2>/dev/null >/dev/null
|
---|
[17706] | 118 | /bin/mv josm.exe josm-intermediate.exe 2>/dev/null >/dev/null
|
---|