[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"
|
---|
[14191] | 26 | else
|
---|
| 27 | # launch4j installed locally under this nsis folder
|
---|
| 28 | LAUNCH4J="java -jar ./launch4j/launch4j.jar"
|
---|
[14189] | 29 | fi
|
---|
[14191] | 30 | echo Using launch4j: $LAUNCH4J
|
---|
[14189] | 31 |
|
---|
[14191] | 32 | # trying to find makensis
|
---|
| 33 | if [ -s /cygdrive/c/Programme/nsis/makensis.exe ]; then
|
---|
| 34 | # Windows under cygwin
|
---|
| 35 | MAKENSIS="/cygdrive/c/Programme/nsis/makensis.exe"
|
---|
| 36 | else
|
---|
| 37 | # UNIX like
|
---|
[17706] | 38 | MAKENSIS=/usr/bin/makensis
|
---|
[14191] | 39 | fi
|
---|
| 40 | echo Using NSIS: $MAKENSIS
|
---|
[14189] | 41 |
|
---|
[17706] | 42 | if [ -n "$1" ]; then
|
---|
| 43 | export VERSION=$1
|
---|
| 44 | export JOSM_BUILD="no"
|
---|
| 45 | export WEBKIT_DOWNLAD="no"
|
---|
[18004] | 46 | export JOSM_FILE="/var/www/josm.openstreetmap.de/download/josm-tested.jar"
|
---|
[17706] | 47 | else
|
---|
| 48 | svncorerevision=`svnversion ../core`
|
---|
| 49 | svnpluginsrevision=`svnversion ../plugins`
|
---|
| 50 | svnrevision="$svncorerevision-$svnpluginsrevision"
|
---|
[5148] | 51 |
|
---|
[17706] | 52 | export VERSION=custom-${svnrevision}
|
---|
| 53 | export JOSM_BUILD="yes"
|
---|
| 54 | export WEBKIT_DOWNLOAD="yes"
|
---|
[18004] | 55 | export JOSM_FILE="..\core\dist\josm-custom.jar"
|
---|
[17706] | 56 | fi
|
---|
[5157] | 57 |
|
---|
[5204] | 58 | echo "Creating Windows Installer for josm-$VERSION"
|
---|
[5157] | 59 |
|
---|
[14189] | 60 | echo
|
---|
| 61 | echo "##################################################################"
|
---|
| 62 | echo "### Download and unzip the webkit stuff"
|
---|
[17706] | 63 | if [ "x$WEBKIT_DOWNLOAD" == "xyes" ]; then
|
---|
| 64 | wget --continue --timestamping http://josm.openstreetmap.de/download/windows/webkit-image.zip
|
---|
| 65 | fi
|
---|
[14189] | 66 | mkdir -p webkit-image
|
---|
| 67 | cd webkit-image
|
---|
| 68 | unzip -o ../webkit-image.zip
|
---|
| 69 | cd ..
|
---|
| 70 |
|
---|
| 71 | echo
|
---|
| 72 | echo "##################################################################"
|
---|
| 73 | echo "### Build the Complete josm + Plugin Stuff"
|
---|
[17706] | 74 | if [ "x$JOSM_BUILD" == "xyes" ]; then
|
---|
[5149] | 75 | (
|
---|
| 76 | echo "Build the Complete josm Stuff"
|
---|
[5148] | 77 |
|
---|
[5149] | 78 | echo "Compile Josm"
|
---|
| 79 | cd ../core
|
---|
[5156] | 80 | ant -q clean
|
---|
| 81 | ant -q compile || exit -1
|
---|
[5149] | 82 | cd ..
|
---|
| 83 |
|
---|
| 84 | echo "Compile Josm Plugins"
|
---|
| 85 | cd plugins
|
---|
[5156] | 86 | ant -q clean
|
---|
| 87 | ant -q dist || exit -1
|
---|
[5149] | 88 | ) || exit -1
|
---|
[5148] | 89 | fi
|
---|
| 90 |
|
---|
[18004] | 91 | /bin/cp $JOSM_FILE josm-tested.jar
|
---|
[5149] | 92 | echo
|
---|
| 93 | echo "##################################################################"
|
---|
| 94 | echo "### convert jar to exe with launch4j"
|
---|
[5204] | 95 | # (an exe file makes attaching to file extensions a lot easier)
|
---|
[5148] | 96 | # launch4j - http://launch4j.sourceforge.net/
|
---|
[5229] | 97 | # delete old exe file first
|
---|
[17706] | 98 | /bin/rm -f josm.exe
|
---|
[14186] | 99 | $LAUNCH4J "launch4j.xml"
|
---|
[5148] | 100 |
|
---|
[5164] | 101 | if ! [ -s josm.exe ]; then
|
---|
| 102 | echo "NO Josm File Created"
|
---|
| 103 | exit -1
|
---|
| 104 | fi
|
---|
| 105 |
|
---|
[5149] | 106 | echo
|
---|
| 107 | echo "##################################################################"
|
---|
[11594] | 108 | echo "### create the josm-installer-${VERSION}.exe with makensis"
|
---|
[5148] | 109 | # NSIS - http://nsis.sourceforge.net/Main_Page
|
---|
| 110 | # apt-get install nsis
|
---|
[14186] | 111 | $MAKENSIS -V2 -DVERSION=$VERSION josm.nsi
|
---|
[5214] | 112 |
|
---|
[14186] | 113 | # keep the intermediate file, for debugging
|
---|
[17706] | 114 | /bin/rm josm-intermediate.exe 2>/dev/null >/dev/null
|
---|
[18004] | 115 | /bin/rm -f josm-tested.jar 2>/dev/null >/dev/null
|
---|
[17706] | 116 | /bin/mv josm.exe josm-intermediate.exe 2>/dev/null >/dev/null
|
---|