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