-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure
More file actions
executable file
·52 lines (47 loc) · 1.75 KB
/
configure
File metadata and controls
executable file
·52 lines (47 loc) · 1.75 KB
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
#!/bin/bash
TARGET=sbbhost
NAME="SBB Host"
VERSION=0.1
COMMENT="Application for host communication with the self-balancing-bike microcontroller"
TYPE=Application
CATEGORIES="Science;Math;DataVisualization;NumericalAnalysis;Engineering;GTK"
TERMINAL="false"
STARTUPNOTIFY="true"
ICON=sbbhost-icon.svg
POSITIONAL_ARGS=()
PREFIX=/usr/local
while [[ $# -gt 0 ]]; do
case $1 in
--prefix)
PREFIX="$2"
shift # past argument
shift # past value
;;
--*)
echo "Unknown option $1"
exit 1
;;
*)
POSITIONAL_ARGS+=("$1") # save positional arg
shift # past argument
;;
esac
done
#Update dirs.h
printf '#define TOOLBAR_XML_LINUX "%s/share/%s/%s-toolbar.xml"\n' "$PREFIX" "$TARGET" "$TARGET" > ./include/dirs.h
printf '#define CONFIG_FILE_LINUX "%s/share/%s/%s-config.ini"\n' "$PREFIX" "$TARGET" "$TARGET" >> ./include/dirs.h
#Update installation_path.txt
printf '%s' $PREFIX > installation_path.txt
#Update desktop file
printf "[Desktop Entry]\n" > ./resource/sbbhost.desktop
printf "Name=%s\n" "$NAME" >> ./resource/sbbhost.desktop
printf "Version=%s\n" "$VERSION" >> ./resource/sbbhost.desktop
printf "Type=%s\n" "$TYPE" >> ./resource/sbbhost.desktop
printf "Comment=%s\n" "$COMMENT" >> ./resource/sbbhost.desktop
printf "Categories=%s\n" "$CATEGORIES" >> ./resource/sbbhost.desktop
printf "Terminal=%s\n" "$TERMINAL" >> ./resource/sbbhost.desktop
printf "StartupNotify=%s\n" "$STARTUPNOTIFY" >> ./resource/sbbhost.desktop
printf "Exec=%s/bin/%s\n" "$PREFIX" "$TARGET" >> ./resource/sbbhost.desktop
printf "TryExec=%s/bin/%s\n" "$PREFIX" "$TARGET" >> ./resource/sbbhost.desktop
printf "Path=%s/bin\n" "$PREFIX" >> ./resource/sbbhost.desktop
printf "Icon=%s/share/pixmaps/%s\n" "$PREFIX" "$ICON" >> ./resource/sbbhost.desktop