-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_package
executable file
·54 lines (52 loc) · 1.24 KB
/
make_package
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
#!/bin/bash
# read_char var
read_char() {
stty -icanon -echo
eval "$1=\$(dd bs=1 count=1 2>/dev/null)"
stty icanon echo
}
BUILD_DIR="cmake-build-release"
CODENAME=$(lsb_release -sc)
ARCH=$(dpkg --print-architecture)
#
char=' '
while true
do
echo -n "Build hamclock for ${CODENAME} ${ARCH} (Y/n)? "
read_char char
[[ $char == 'N' || $char == 'n' ]] && echo && exit 0
[[ $char == 'Y' || $char == 'y' || $char == "" ]] && break
done
echo "Building..."
#
cd SourceCode && ./build && cd .. || exit 1
#
rm -rf ${BUILD_DIR} || exit 1
mkdir ${BUILD_DIR} || exit 1
cd ${BUILD_DIR} || exit 1
cmake -DCMAKE_BUILD_TYPE=Release .. || exit 1
make package || exit 1
type vfrott_upload_auth >/dev/null 2>/dev/null && vfrott_upload_auth || exit 0
#
char=' '
while true
do
echo -n "Upload packages for ${CODENAME} ${ARCH} (y/N)? "
read_char char
[[ $char == 'N' || $char == 'n' || $char == "" ]] && echo && exit 0
[[ $char == 'Y' || $char == 'y' ]] && break
done
echo "Uploading..."
#
case $CODENAME in
buster|bullseye|bookworm)
echo $CODENAME
../bin/vfrott -n -c $CODENAME -s stable hamclock*.deb
;;
nobel)
echo $CODENAME
../bin/vfrott -n -s stable hamclock*.deb
;;
*)
echo "No package upload for ${CODENAME}."
esac