1 | #!/bin/sh
|
---|
2 |
|
---|
3 | dst_path=$1
|
---|
4 |
|
---|
5 | if [ ! -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
|
---|
10 | fi
|
---|
11 |
|
---|
12 | echo "copying Files to '$dst_path'"
|
---|
13 | package_name=openstreetmap-josm
|
---|
14 | dst_path=${dst_path%/}
|
---|
15 |
|
---|
16 | jar_path="$dst_path/usr/local/share/josm"
|
---|
17 | mkdir -p "$jar_path"
|
---|
18 |
|
---|
19 | bin_path="$dst_path/usr/bin"
|
---|
20 | mkdir -p "$bin_path"
|
---|
21 |
|
---|
22 | #plugin_dir="$dst_path/usr/local/share/josm/plugins"
|
---|
23 | plugin_dir="$dst_path/usr/lib/josm/plugins"
|
---|
24 | mkdir -p "$plugin_dir"
|
---|
25 |
|
---|
26 | mkdir -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 | )
|
---|
31 | mkdir -p "$dst_path/usr/lib/josm"
|
---|
32 | # ------------------------------------------------------------------
|
---|
33 | # Compile the Jar Files
|
---|
34 | echo "Compile Josm"
|
---|
35 | cd core
|
---|
36 | ant compile || exit -1
|
---|
37 | cd ..
|
---|
38 |
|
---|
39 | echo "Compile Josm Plugins"
|
---|
40 | cd plugins
|
---|
41 | ant build || exit -1
|
---|
42 | cd ..
|
---|
43 |
|
---|
44 |
|
---|
45 | # ------------------------------------------------------------------
|
---|
46 | # Copy Jar Files
|
---|
47 |
|
---|
48 | cp ./core/dist/josm-custom.jar $jar_path/josm.jar || exit -1
|
---|
49 |
|
---|
50 | plugin_jars=`find plugins -name "*.jar"`
|
---|
51 | for 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,"
|
---|
59 | done || exit -1
|
---|
60 |
|
---|
61 | # remove last empty plugin definition ,
|
---|
62 | plugins=${plugins%,}
|
---|
63 |
|
---|
64 | echo "Activated Plugins:"
|
---|
65 | echo "$plugins"
|
---|
66 |
|
---|
67 | mkdir -p "$jar_path/speller"
|
---|
68 | cp ../utils/planet.osm/java/speller/words.cfg "$jar_path/speller/"
|
---|
69 |
|
---|
70 | # Maybe this has to be removed, since it is inside the plugin?
|
---|
71 | cp plugins/mappaint/styles/osmfeatures/elemstyles.xml "$jar_path/elemstyles.xml"
|
---|
72 | mkdir -p "$jar_path/plugins/mappaint/standard"
|
---|
73 | cp plugins/mappaint/styles/osmfeatures/elemstyles.xml "$jar_path/plugins/mappaint/standard/elemstyles.xml"
|
---|
74 | # ------------------------------------------------------------------
|
---|
75 | cat > "$bin_path/josm" <<EOF
|
---|
76 | #!/bin/sh
|
---|
77 | josm_dir="/usr/local/share/josm"
|
---|
78 | josm_bin="\$josm_dir/josm.jar"
|
---|
79 |
|
---|
80 | test -d ~/.josm/plugins/ || mkdir -p ~/.josm/plugins/
|
---|
81 | #for dir in mappaint osmarender validator tways-0.1; do
|
---|
82 | for dir in ${plugins//,/ } ; do
|
---|
83 | test -d ~/.josm/plugins/\$dir || mkdir -p ~/.josm/plugins/\$dir
|
---|
84 | done
|
---|
85 | test -d ~/.josm/plugins/mappaint/standard || mkdir -p ~/.josm/plugins/mappaint/standard
|
---|
86 |
|
---|
87 | if ! [ -s ~/.josm/preferences ]; then
|
---|
88 | echo "Installing Preferences File"
|
---|
89 | cp "\$josm_dir/preferences" ~/.josm/preferences
|
---|
90 | fi
|
---|
91 |
|
---|
92 | if ! [ -s ~/.josm/bookmarks ]; then
|
---|
93 | echo "Installing Bookmarks File"
|
---|
94 | cp "\$josm_dir/bookmarks" ~/.josm/bookmarks
|
---|
95 | fi
|
---|
96 |
|
---|
97 | if ! [ -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
|
---|
101 | fi
|
---|
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 |
|
---|
108 | java -Djosm.resource=/usr/share/map-icons/square.small \
|
---|
109 | -Xmx500m \
|
---|
110 | \$proxy \
|
---|
111 | -jar "\$josm_bin"\
|
---|
112 | "\$@"
|
---|
113 |
|
---|
114 | EOF
|
---|
115 |
|
---|
116 |
|
---|
117 | cat > "$jar_path/preferences" <<EOF
|
---|
118 | download.gps=false
|
---|
119 | download.newlayer=false
|
---|
120 | download.osm=true
|
---|
121 | download.tab=1
|
---|
122 | lakewalker.python=/usr/bin/python
|
---|
123 | layerlist.visible=true
|
---|
124 | osm-server.url=http://www.openstreetmap.org/api
|
---|
125 | plugins=$plugins
|
---|
126 | projection=org.openstreetmap.josm.data.projection.Epsg4326
|
---|
127 | propertiesdialog.visible=true
|
---|
128 | propertiesdialog.visible=true
|
---|
129 | propertiesdialog.visible=true
|
---|
130 | toolbar=download;upload;|;new;open;save;exportgpx;|;undo;redo;|;preference
|
---|
131 | validator.SpellCheck.checkKeys=true
|
---|
132 | validator.SpellCheck.checkKeysBeforeUpload=true
|
---|
133 | validator.SpellCheck.checkValues=true
|
---|
134 | validator.SpellCheck.checkValuesBeforeUpload=true
|
---|
135 | validator.SpellCheck.sources=/usr/local/share/josm/speller/words.cfg
|
---|
136 | ywms.firefox=firefox
|
---|
137 | ywms.port=8000
|
---|
138 | EOF
|
---|
139 |
|
---|
140 | cat > "$jar_path/bookmarks" <<EOF
|
---|
141 | Muenchen+,47.983424415942416,11.402620097655612,48.36334800308583,12.002250823113542
|
---|
142 | Muenchen-,48.05109190794662,11.447878885677385,48.246831966462025,11.703938333879364
|
---|
143 | Kirchheim,48.14904045814527,11.728348604380155,48.18983784113904,11.79273346326812
|
---|
144 | Muc_Altstadtring,48.125724515280666,11.553433712891074,48.15107325612488,11.596158188775085
|
---|
145 | Mainz,49.58,8.14,49.6,8.16
|
---|
146 | Erlangen,49.53530551899356,10.893663089997254,49.64013443292672,11.07554098888691
|
---|
147 | Ingolstadt,48.615608086215175,11.232933428311759,48.893652866507985,11.728832483590338
|
---|
148 | EOF
|
---|