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 | # ------------------------------------------------------------------
|
---|
34 | # Compile the Jar Files
|
---|
35 | echo "------------- Compile Josm"
|
---|
36 | cd core
|
---|
37 | ant -q clean
|
---|
38 | ant -q compile || exit -1
|
---|
39 | cd ..
|
---|
40 |
|
---|
41 | echo "------------- Compile Josm Plugins"
|
---|
42 | cd plugins
|
---|
43 | ant -q clean
|
---|
44 | ant -q dist|| exit -1
|
---|
45 | cd ..
|
---|
46 |
|
---|
47 | # Compile the Josm-ng Files
|
---|
48 | echo "------------- Compile Josm-ng"
|
---|
49 | cd ../josm-ng
|
---|
50 | ant -q clean
|
---|
51 | ant -q josm-ng-impl.jar || exit -1
|
---|
52 | cd ../josm
|
---|
53 |
|
---|
54 |
|
---|
55 | # ------------------------------------------------------------------
|
---|
56 | echo "------------- Copy Jar Files"
|
---|
57 |
|
---|
58 | cp ./core/dist/josm-custom.jar $jar_path/josm.jar || exit -1
|
---|
59 | cp ../josm-ng/dist/josm-ng.jar $jar_path/josm-ng.jar || exit -1
|
---|
60 |
|
---|
61 | plugin_jars=`find dist -name "*.jar"`
|
---|
62 | for src_fn in $plugin_jars ; do
|
---|
63 | fn="`basename ${src_fn}`"
|
---|
64 | dst_fn="$plugin_dir/$fn"
|
---|
65 | echo "cp $src_fn $dst_fn"
|
---|
66 | cp "$src_fn" "$dst_fn" || exit -1
|
---|
67 | plugin_name=${fn%.jar}
|
---|
68 | echo $plugin_name | grep -q -e plastic_laf -e lang && continue
|
---|
69 | plugins="$plugins$plugin_name,"
|
---|
70 | done || exit -1
|
---|
71 |
|
---|
72 | # remove last empty plugin definition ,
|
---|
73 | plugins=${plugins%,}
|
---|
74 |
|
---|
75 | echo "Activated Plugins:"
|
---|
76 | echo "$plugins"
|
---|
77 |
|
---|
78 | mkdir -p "$jar_path/speller"
|
---|
79 | cp ../utils/planet.osm/java/speller/words.cfg "$jar_path/speller/"
|
---|
80 |
|
---|
81 | # ------------------------------------------------------------------
|
---|
82 | cp "debian/bin/josm.sh" "$bin_path/josm"
|
---|
83 | cp "debian/bin/josm-ng.sh" "$bin_path/josm-ng"
|
---|
84 |
|
---|
85 | sed "s/PLUGIN_LIST/$plugins/;" <debian/bin/preferences >"$jar_path/preferences"
|
---|
86 | cp nsis/bookmarks "$jar_path/bookmarks"
|
---|