dist/install.sh

Sat, 15 Jul 2023 13:12:19 +0200

author
Mike Becker <universe@uap-core.de>
date
Sat, 15 Jul 2023 13:12:19 +0200
changeset 21
34ebff7ddd43
parent 18
0df7309d498e
child 23
79ca64922cfa
permissions
-rwxr-xr-x

add .idea folder to .hgignore

0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
1 #!/bin/sh
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
2
18
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
3 PREFIX=/usr/local
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
4
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
5 # help text
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
6 printhelp()
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
7 {
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
8 echo "Usage: $0 [PREFIX=<path>]"
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
9 echo
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
10 echo "Default PREFIX:" $PREFIX
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
11 }
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
12
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
13 #
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
14 # parse arguments
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
15 #
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
16 for ARG in $@
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
17 do
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
18 case "$ARG" in
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
19 "PREFIX="*) PREFIX=${ARG#PREFIX=} ;;
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
20 "--help"*) printhelp; exit 1 ;;
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
21 "-"*) echo "unknown option: $ARG"; exit 1 ;;
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
22 esac
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
23 done
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
24
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
25
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
26 echo "mkdir -p /usr/lib/uwproj"
18
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
27 mkdir -p $PREFIX/lib/uwproj
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
28
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
29 echo "cp ../target/uwproj-0.1-jar-with-dependencies.jar /usr/lib/uwproj/uwproj-0.1.jar"
18
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
30 cp ../target/uwproj-0.1-jar-with-dependencies.jar $PREFIX/lib/uwproj/uwproj-0.1.jar
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
31
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
32 echo "cp bin/uwproj /usr/bin"
18
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
33 sed s:%%PREFIX%%:$PREFIX:g bin/uwproj > $PREFIX/bin/uwproj
0
38775db5fdf5 add existing source
Olaf Wintermann <olaf.wintermann@gmail.com>
parents:
diff changeset
34
18
0df7309d498e add PREFIX parameter to install script
Olaf Wintermann <olaf.wintermann@gmail.com>
parents: 0
diff changeset
35

mercurial