dist/install.sh

changeset 20
2d3fe2c44163
parent 18
0df7309d498e
child 23
79ca64922cfa
equal deleted inserted replaced
19:e05f3e8ec2cb 20:2d3fe2c44163
1 #!/bin/sh 1 #!/bin/sh
2 2
3 PREFIX=/usr/local
4
5 # help text
6 printhelp()
7 {
8 echo "Usage: $0 [PREFIX=<path>]"
9 echo
10 echo "Default PREFIX:" $PREFIX
11 }
12
13 #
14 # parse arguments
15 #
16 for ARG in $@
17 do
18 case "$ARG" in
19 "PREFIX="*) PREFIX=${ARG#PREFIX=} ;;
20 "--help"*) printhelp; exit 1 ;;
21 "-"*) echo "unknown option: $ARG"; exit 1 ;;
22 esac
23 done
24
25
3 echo "mkdir -p /usr/lib/uwproj" 26 echo "mkdir -p /usr/lib/uwproj"
4 mkdir -p /usr/lib/uwproj 27 mkdir -p $PREFIX/lib/uwproj
5 28
6 echo "cp ../target/uwproj-0.1-jar-with-dependencies.jar /usr/lib/uwproj/uwproj-0.1.jar" 29 echo "cp ../target/uwproj-0.1-jar-with-dependencies.jar /usr/lib/uwproj/uwproj-0.1.jar"
7 cp ../target/uwproj-0.1-jar-with-dependencies.jar /usr/lib/uwproj/uwproj-0.1.jar 30 cp ../target/uwproj-0.1-jar-with-dependencies.jar $PREFIX/lib/uwproj/uwproj-0.1.jar
8 31
9 echo "cp bin/uwproj /usr/bin" 32 echo "cp bin/uwproj /usr/bin"
10 cp bin/uwproj /usr/bin 33 sed s:%%PREFIX%%:$PREFIX:g bin/uwproj > $PREFIX/bin/uwproj
11 34
35

mercurial