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 || {
|
---|
52 | echo "!!!!!!!!!!!!!!!!! WARNING Josm-NG is not included into the package"
|
---|
53 | #exit -1
|
---|
54 | }
|
---|
55 | cd ../josm
|
---|
56 |
|
---|
57 |
|
---|
58 | # ------------------------------------------------------------------
|
---|
59 | echo "------------- Copy Jar Files"
|
---|
60 |
|
---|
61 | cp ./core/dist/josm-custom.jar $jar_path/josm.jar || exit -1
|
---|
62 | cp ../josm-ng/dist/josm-ng.jar $jar_path/josm-ng.jar || {
|
---|
63 | echo "!!!!!!!!!!!!!!!!! WARNING Josm-NG is not included into the package"
|
---|
64 | #exit -1
|
---|
65 | }
|
---|
66 |
|
---|
67 | plugin_jars=`find dist -name "*.jar"`
|
---|
68 | for src_fn in $plugin_jars ; do
|
---|
69 | fn="`basename ${src_fn}`"
|
---|
70 | dst_fn="$plugin_dir/$fn"
|
---|
71 | echo "cp $src_fn $dst_fn"
|
---|
72 | cp "$src_fn" "$dst_fn" || exit -1
|
---|
73 | plugin_name=${fn%.jar}
|
---|
74 | echo $plugin_name | grep -q -e plastic_laf -e lang && continue
|
---|
75 | plugins="$plugins$plugin_name,"
|
---|
76 | done || exit -1
|
---|
77 |
|
---|
78 | # remove last empty plugin definition ,
|
---|
79 | plugins=${plugins%,}
|
---|
80 |
|
---|
81 | echo "Activated Plugins:"
|
---|
82 | echo "$plugins"
|
---|
83 |
|
---|
84 | mkdir -p "$jar_path/speller"
|
---|
85 | cp ../../utils/planet.osm/java/speller/words.cfg "$jar_path/speller/"
|
---|
86 |
|
---|
87 | # ------------------------------------------------------------------
|
---|
88 | cp "debian/bin/josm.sh" "$bin_path/josm" || exit -1
|
---|
89 | cp "debian/bin/josm-ng.sh" "$bin_path/josm-ng" || {
|
---|
90 | echo "!!!!!!!!!!!!!!!!! WARNING Josm-NG is not included into the package"
|
---|
91 | #exit -1
|
---|
92 | }
|
---|
93 |
|
---|
94 | sed "s/PLUGIN_LIST/$plugins/;" <debian/bin/preferences >"$jar_path/preferences"
|
---|
95 | cp nsis/bookmarks "$jar_path/bookmarks"
|
---|