source: osm/applications/editors/josm/nsis/josm-setup-unix.sh@ 30066

Last change on this file since 30066 was 29984, checked in by stoecker, 11 years ago

update nsis build to current server state

  • Property svn:executable set to *
File size: 3.6 KB
Line 
1#!/bin/bash
2
3# Creates an josm-setup-xy.exe File
4#
5# for working on a debian-unix system install the nsis package with
6# apt-get install nsis
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
14
15## settings ##
16
17# trying to find launch4j
18if [ -s /cygdrive/c/Programme/Launch4j/launch4jc.exe ]; then
19 # Windows under cygwin
20 LAUNCH4J="/cygdrive/c/Programme/Launch4j/launch4jc.exe"
21elif [ -s /usr/share/launch4j/launch4j.jar ]; then
22 # as described above
23 LAUNCH4J="java -jar /usr/share/launch4j/launch4j.jar"
24elif [ -s ../launch4j/launch4j.jar ]; then
25 LAUNCH4J="java -jar ../launch4j/launch4j.jar"
26elif [ -s $HOME/launch4j/launch4j.jar ]; then
27 LAUNCH4J="java -jar $HOME/launch4j/launch4j.jar"
28else
29 # launch4j installed locally under this nsis folder
30 LAUNCH4J="java -jar ./launch4j/launch4j.jar"
31fi
32echo Using launch4j: $LAUNCH4J
33
34# trying to find makensis
35if [ -s /cygdrive/c/Programme/nsis/makensis.exe ]; then
36 # Windows under cygwin
37 MAKENSIS="/cygdrive/c/Programme/nsis/makensis.exe"
38else
39 # UNIX like
40 MAKENSIS=/usr/bin/makensis
41fi
42echo Using NSIS: $MAKENSIS
43
44if [ -n "$1" ]; then
45 export VERSION=$1
46 export JOSM_BUILD="no"
47 export WEBKIT_DOWNLAD="no"
48 export JOSM_FILE="/home/josm/www/download/josm-tested.jar"
49else
50 svncorerevision=`svnversion ../core`
51 svnpluginsrevision=`svnversion ../plugins`
52 svnrevision="$svncorerevision-$svnpluginsrevision"
53
54 export VERSION=custom-${svnrevision}
55 export JOSM_BUILD="yes"
56 export WEBKIT_DOWNLOAD="yes"
57 export JOSM_FILE="..\core\dist\josm-custom.jar"
58fi
59
60echo "Creating Windows Installer for josm-$VERSION"
61
62echo
63echo "##################################################################"
64echo "### Download and unzip the webkit stuff"
65if [ "x$WEBKIT_DOWNLOAD" == "xyes" ]; then
66 wget --continue --timestamping http://josm.openstreetmap.de/download/windows/webkit-image.zip
67else
68 if ! [ -f webkit-image.zip ]; then
69 ln -s /home/josm/www/download/windows/webkit-image.zip .
70 fi
71fi
72#mkdir -p webkit-image
73#cd webkit-image
74unzip -o webkit-image.zip
75#cd ..
76
77echo
78echo "##################################################################"
79echo "### Build the Complete josm + Plugin Stuff"
80if [ "x$JOSM_BUILD" == "xyes" ]; then
81 (
82 echo "Build the Complete josm Stuff"
83
84 echo "Compile Josm"
85 cd ../core
86 ant -q clean
87 ant -q compile || exit -1
88 cd ..
89
90 echo "Compile Josm Plugins"
91 cd plugins
92 ant -q clean
93 ant -q dist || exit -1
94 ) || exit -1
95fi
96
97/bin/cp $JOSM_FILE josm-tested.jar
98echo
99echo "##################################################################"
100echo "### convert jar to exe with launch4j"
101# (an exe file makes attaching to file extensions a lot easier)
102# launch4j - http://launch4j.sourceforge.net/
103# delete old exe file first
104/bin/rm -f josm.exe
105$LAUNCH4J "launch4j.xml"
106
107if ! [ -s josm.exe ]; then
108 echo "NO Josm File Created"
109 exit -1
110fi
111
112echo
113echo "##################################################################"
114echo "### create the josm-installer-${VERSION}.exe with makensis"
115# NSIS - http://nsis.sourceforge.net/Main_Page
116# apt-get install nsis
117$MAKENSIS -V2 -DVERSION=$VERSION josm.nsi
118
119# keep the intermediate file, for debugging
120/bin/rm josm-intermediate.exe 2>/dev/null >/dev/null
121/bin/rm -f josm-tested.jar 2>/dev/null >/dev/null
122/bin/mv josm.exe josm-intermediate.exe 2>/dev/null >/dev/null
Note: See TracBrowser for help on using the repository browser.