forked from haojiangwang/tcltk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-dev
executable file
·57 lines (50 loc) · 1.32 KB
/
setup-dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash -e
## exit on non-zero status
set -e
## info
VERSION=1.1
MANUFACT="(c) 2021 ATOS IT Solutions and Services GmbH"
AUTHORS="Thomas Perschak"
## defaults
SCRIPTDIR=$(dirname $(readlink -f $0))
CBOLD="\033[1m"
CEND="\e[0m"
## helper functions
##
function printHelp {
echo "Install development environment."
echo "$MANUFACT, $AUTHORS"
echo "Script version: $VERSION"
echo ""
echo "Syntax:"
echo " setupdev [<options>]"
echo "Options (optional):"
echo " -help: Print this help text."
}
##
## helper functions
## read command line parameters
INDEX=1
while [ $INDEX -le $# ]; do
case ${!INDEX} in
"-help")
printHelp
exit 1
;;
*)
echo "Unknown parameter '${!INDEX}', type -help for more information." >&2; exit 1
;;
esac
let INDEX+=1
done
## restart script as sudo user
if [[ $UID -ne 0 ]]; then
pkexec $(readlink -f $0) "$@"
exit $?
fi
## install development tools
if which apt &>/dev/null; then
apt install autoconf g++ gcc make chrpath libpq5 libssl-dev libxt-dev libx11-dev libxft-dev postgresql-server-dev-all libcairo2-dev libxcursor-dev libfftw3-dev libsnmp-dev swig curl
else
yum rpm-build install patch autoconf automake gcc-c++ libX11-devel fftw-devel swig libXcursor-devel net-snmp-devel
fi