[4308] | 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"
|
---|
[4958] | 27 | #( # map-icons to be symlinked
|
---|
| 28 | # cd "$dst_path/usr/share/josm"
|
---|
| 29 | # ln -s ../map-icons/classic.small images
|
---|
| 30 | #)
|
---|
[4308] | 31 | mkdir -p "$dst_path/usr/lib/josm"
|
---|
[5126] | 32 |
|
---|
[4308] | 33 | # ------------------------------------------------------------------
|
---|
| 34 | # Compile the Jar Files
|
---|
| 35 | echo "Compile Josm"
|
---|
| 36 | cd core
|
---|
[5156] | 37 | ant -q clean
|
---|
| 38 | ant -q compile || exit -1
|
---|
[4308] | 39 | cd ..
|
---|
| 40 |
|
---|
| 41 | echo "Compile Josm Plugins"
|
---|
| 42 | cd plugins
|
---|
[5156] | 43 | ant -q clean
|
---|
| 44 | ant -q dist|| exit -1
|
---|
[4308] | 45 | cd ..
|
---|
| 46 |
|
---|
| 47 |
|
---|
| 48 | # ------------------------------------------------------------------
|
---|
| 49 | # Copy Jar Files
|
---|
| 50 |
|
---|
| 51 | cp ./core/dist/josm-custom.jar $jar_path/josm.jar || exit -1
|
---|
| 52 |
|
---|
[6101] | 53 | plugin_jars=`find dist -name "*.jar"`
|
---|
[4308] | 54 | for 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,"
|
---|
| 62 | done || exit -1
|
---|
| 63 |
|
---|
| 64 | # remove last empty plugin definition ,
|
---|
| 65 | plugins=${plugins%,}
|
---|
| 66 |
|
---|
| 67 | echo "Activated Plugins:"
|
---|
| 68 | echo "$plugins"
|
---|
| 69 |
|
---|
[5213] | 70 | mkdir -p "$jar_path/speller"
|
---|
| 71 | cp ../utils/planet.osm/java/speller/words.cfg "$jar_path/speller/"
|
---|
[4308] | 72 |
|
---|
| 73 | # ------------------------------------------------------------------
|
---|
[5213] | 74 | cp "debian/bin/josm.sh" "$bin_path/josm"
|
---|
[4308] | 75 |
|
---|
[5213] | 76 | sed "s/PLUGIN_LIST/$plugins/;" <debian/bin/preferences >"$jar_path/preferences"
|
---|
| 77 | cp nsis/bookmarks "$jar_path/bookmarks"
|
---|