File: Setup.sh

package info (click to toggle)
kshutdown 3.2-1
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,568 kB
  • ctags: 648
  • sloc: cpp: 5,492; sh: 265; makefile: 7
file content (73 lines) | stat: -rwxr-xr-x 1,609 bytes parent folder | download
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash

default_item=""
kshutdown_full_version=`sed 2!d tools/VERSION`

function doError()
{
	echo
	echo "ERROR: $1"
	echo
	exit 1
}

function doCompile()
{
	clear
	if [ $1 == "kshutdown" ]; then
		if ! ./Setup-kde4.sh; then
			doError "Build failed. See README.html for troubleshooting information."
		fi
	elif [ $1 == "kshutdown-qt" ]; then
		if ./Setup-qt4.sh; then
			dialog --msgbox \
"Compiled KShutdown program (\"kshutdown-qt\" file)\n
can be found in the \"${PWD}\" directory.\n
\n
Installation is not required.\n
However, you can run\n
\n
cd src; sudo make install  (Ubuntu, etc.)\n
or\n
cd src; su -c \"make install\"  (Fedora, etc.)\n
\n
to setup menu shortcut (Utilities section),\n
and copy \"kshutdown-qt\" to the \"/usr/bin\" directory." \
0 0
		else
			doError "Build failed. See README.html for troubleshooting information."
		fi
	else
		doError "Unknown build type: $1"
	fi
}

function doQuit()
{
	clear
}

if [[ $DESKTOP_SESSION == *kde* ]]; then
	default_item="kshutdown"
else
	default_item="kshutdown-qt"
fi

out=`dialog \
	--backtitle "KShutdown $kshutdown_full_version Setup" \
	--default-item "$default_item" \
	--ok-label "OK, compile!" \
	--cancel-label "Maybe later" \
	--item-help \
	--no-lines \
	--no-shadow \
	--stdout \
	--title "Select a KShutdown version to build:" \
	--menu "" 0 0 0 \
	"kshutdown" "Version for KDE 4 with additional features" "Required libraries: Qt 4.8+, KDE 4 libs" \
	"kshutdown-qt"  "Version for Xfce, LXDE, MATE, KDE, etc. - lightweight" "Required libraries: Qt 4.8+ or Qt 5.x, NO KDE 4 libs"`

case $? in
	0) doCompile $out;;
	*) doQuit;;
esac