source: subversion/applications/utils/debian/make_install_files.sh @ 4275

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

update dependencies
expand starting script
add default settings
exit build on errors

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