source: subversion/applications/editors/josm/debian/make_install_files.sh @ 5156

Last change on this file since 5156 was 5156, checked in by joerg, 12 years ago

josm compile(nsis/debian): reduce verbosity while compiling

  • Property svn:executable set to *
File size: 4.4 KB
Line 
1#!/bin/sh
2
3dst_path=$1
4
5if [ ! -n "$dst_path" ] ; then
6    echo "Please specify a Directory to use as Basedirectory"
7    echo "Usage:"
8    echo "     $0 <working-dir>"
9    exit -1
10fi
11
12echo "copying Files to '$dst_path'"
13package_name=openstreetmap-josm
14dst_path=${dst_path%/}
15
16jar_path="$dst_path/usr/local/share/josm"
17mkdir -p "$jar_path"
18
19bin_path="$dst_path/usr/bin"
20mkdir -p "$bin_path"
21
22#plugin_dir="$dst_path/usr/local/share/josm/plugins"
23plugin_dir="$dst_path/usr/lib/josm/plugins"
24mkdir -p "$plugin_dir"
25
26mkdir -p "$dst_path/usr/share/josm" 
27#( # map-icons to be symlinked
28#    cd  "$dst_path/usr/share/josm"
29#    ln -s ../map-icons/classic.small images
30#)
31mkdir -p "$dst_path/usr/lib/josm"
32
33# ------------------------------------------------------------------
34# Compile the Jar Files
35echo "Compile Josm"
36cd core
37ant -q clean
38ant -q compile || exit -1
39cd ..
40
41echo "Compile Josm Plugins"
42cd plugins
43ant -q clean
44ant -q dist|| exit -1
45cd ..
46
47
48# ------------------------------------------------------------------
49# Copy Jar Files
50
51cp ./core/dist/josm-custom.jar $jar_path/josm.jar || exit -1
52
53plugin_jars=`find plugins -name "*.jar"`
54for src_fn in $plugin_jars ; do 
55    fn="`basename ${src_fn}`"
56    dst_fn="$plugin_dir/$fn"
57    echo "cp $src_fn $dst_fn"
58    cp "$src_fn" "$dst_fn" || exit -1
59    plugin_name=${fn%.jar}
60    echo $plugin_name | grep -q -e plastic_laf -e lang && continue
61    plugins="$plugins$plugin_name,"
62done || exit -1
63
64# remove last empty plugin definition ,
65plugins=${plugins%,}
66
67echo "Activated Plugins:"
68echo "$plugins"
69
70#mkdir -p "$jar_path/speller"
71#cp ../utils/planet.osm/java/speller/words.cfg "$jar_path/speller/"
72
73# Maybe this has to be removed, since it is inside the plugin?
74#cp plugins/mappaint/styles/osmfeatures/elemstyles.xml "$jar_path/elemstyles.xml"
75#mkdir -p "$jar_path/plugins/mappaint/standard"
76#cp plugins/mappaint/styles/osmfeatures/elemstyles.xml "$jar_path/plugins/mappaint/standard/elemstyles.xml"
77# ------------------------------------------------------------------
78cat > "$bin_path/josm" <<EOF
79#!/bin/sh
80josm_dir="/usr/local/share/josm"
81josm_bin="\$josm_dir/josm.jar"
82
83test -d ~/.josm/plugins/ || mkdir -p ~/.josm/plugins/
84#for dir in mappaint osmarender validator tways-0.1; do
85for dir in ${plugins//,/ } ; do
86    test -d ~/.josm/plugins/\$dir || mkdir -p ~/.josm/plugins/\$dir
87done
88test -d ~/.josm/plugins/mappaint/standard || mkdir -p ~/.josm/plugins/mappaint/standard
89
90if ! [ -s ~/.josm/preferences ]; then
91     echo "Installing Preferences File"
92     cp "\$josm_dir/preferences"  ~/.josm/preferences
93fi
94
95if ! [ -s ~/.josm/bookmarks ]; then
96     echo "Installing Bookmarks File"
97     cp "\$josm_dir/bookmarks"  ~/.josm/bookmarks
98fi
99
100if ! [ -s ~/.josm/plugins/mappaint/standard/elemstyles.xml ]; then
101#     echo "Installing Elemstyles File"
102#     cp "\$josm_dir/elemstyles.xml"  ~/.josm/plugins/mappaint/standard/elemstyles.xml
103      true
104fi
105
106# ls -l "\$josm_bin"
107# unzip -p    \$josm_bin REVISION | grep "Last Changed"
108
109# proxy=" -Dhttp.proxyHost=gw-squid -Dhttp.proxyPort=8888 "
110
111java -Djosm.resource=/usr/share/map-icons/square.small \
112     -Xmx500m \
113     \$proxy \
114     -jar "\$josm_bin"\
115     "\$@"
116
117EOF
118
119
120cat > "$jar_path/preferences" <<EOF
121download.gps=false
122download.newlayer=false
123download.osm=true
124download.tab=1
125lakewalker.python=/usr/bin/python
126layerlist.visible=true
127osm-server.url=http://www.openstreetmap.org/api
128plugins=$plugins
129projection=org.openstreetmap.josm.data.projection.Epsg4326
130propertiesdialog.visible=true
131propertiesdialog.visible=true
132propertiesdialog.visible=true
133toolbar=download;upload;|;new;open;save;exportgpx;|;undo;redo;|;preference
134validator.SpellCheck.checkKeys=true
135validator.SpellCheck.checkKeysBeforeUpload=true
136validator.SpellCheck.checkValues=true
137validator.SpellCheck.checkValuesBeforeUpload=true
138validator.SpellCheck.sources=/usr/local/share/josm/speller/words.cfg
139ywms.firefox=firefox
140ywms.port=8000
141EOF
142
143cat > "$jar_path/bookmarks" <<EOF
144Muenchen+,47.983424415942416,11.402620097655612,48.36334800308583,12.002250823113542
145Muenchen-,48.05109190794662,11.447878885677385,48.246831966462025,11.703938333879364
146Kirchheim,48.14904045814527,11.728348604380155,48.18983784113904,11.79273346326812
147Muc_Altstadtring,48.125724515280666,11.553433712891074,48.15107325612488,11.596158188775085
148Mainz,49.58,8.14,49.6,8.16
149Erlangen,49.53530551899356,10.893663089997254,49.64013443292672,11.07554098888691
150Ingolstadt,48.615608086215175,11.232933428311759,48.893652866507985,11.728832483590338
151EOF
Note: See TracBrowser for help on using the repository browser.