-
Notifications
You must be signed in to change notification settings - Fork 0
/
tgfocus-gittag-x64-linux-gnu.bash
142 lines (109 loc) · 4.25 KB
/
tgfocus-gittag-x64-linux-gnu.bash
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
source vars-x64-linux-gnu.bash
###
# prepare tdlib
buildah ps | grep $CTN_PACK_TDLIB
if [[ $? -ne 0 ]]
then
buildah from --name $CTN_PACK_TDLIB "docker.io/micl2e2/$PICK_TDLIB_IMGFULLNAME"
test $? -eq 0 || exit 1
podman inspect "docker.io/micl2e2/$PICK_TDLIB_IMGFULLNAME" | grep Id
test $? -eq 0 || exit 1
fi
# remove build and pack
buildah ps | grep $CTN_BUILD_TGFOCUS
test $? -eq 0 && buildah rm $CTN_BUILD_TGFOCUS || \
echo "[INFO] $CTN_PACK_TGFOCUS not found"
test $? -eq 0 || exit 2
buildah ps | grep $CTN_PACK_TGFOCUS
test $? -eq 0 && buildah rm $CTN_PACK_TGFOCUS || \
echo "[INFO] $CTN_PACK_TGFOCUS not found"
test $? -eq 0 || exit 2
buildah from --name $CTN_BUILD_TGFOCUS $PICK_BASEIMG
test $? -eq 0 || exit 2
buildah copy --from $CTN_PACK_TDLIB $CTN_BUILD_TGFOCUS '/usr/local' '/usr/local'
test $? -eq 0 || exit 3
if [[ -n $APT_COUNTRY_CODE ]]
then
buildah run $CTN_BUILD_TGFOCUS -- \
sed -i \
"s/deb\.debian\.org/ftp\.$APT_COUNTRY_CODE\.debian\.org/" \
/etc/apt/sources.list
test $? -eq 0 || exit 4
fi
buildah run $CTN_BUILD_TGFOCUS -- \
apt-get -o Acquire::ForceIPv4=true update
test $? -eq 0 || exit 4
buildah run $CTN_BUILD_TGFOCUS -- \
apt-get -o Acquire::ForceIPv4=true \
install \
g++ git make cmake zlib1g-dev libssl-dev locales \
-y --quiet
test $? -eq 0 || exit 4
# locales
buildah run $CTN_BUILD_TGFOCUS -- \
sed -i 's/# en_HK.UTF-8/en_HK.UTF-8/' /etc/locale.gen
test $? -eq 0 || exit 6
buildah run $CTN_BUILD_TGFOCUS -- \
sed -i 's/# en_US.UTF-8/en_US.UTF-8/' /etc/locale.gen
test $? -eq 0 || exit 7
buildah run $CTN_BUILD_TGFOCUS -- \
sed -i 's/# en_ZW.UTF-8/en_ZW.UTF-8/' /etc/locale.gen
test $? -eq 0 || exit 8
buildah run $CTN_BUILD_TGFOCUS -- \
sed -i 's/# zh_CN.UTF-8/zh_CN.UTF-8/' /etc/locale.gen
test $? -eq 0 || exit 81
buildah run $CTN_BUILD_TGFOCUS -- \
sed -i 's/# zh_HK.UTF-8/zh_HK.UTF-8/' /etc/locale.gen
test $? -eq 0 || exit 82
buildah run $CTN_BUILD_TGFOCUS -- \
locale-gen
test $? -eq 0 || exit 9
$PXY_FRONTEND buildah run $CTN_BUILD_TGFOCUS -- \
git clone https://github.com/micl2e2/tg-focus
test $? -eq 0 || exit 11
$PXY_FRONTEND buildah run $CTN_BUILD_TGFOCUS -- \
bash -c "cd tg-focus && git checkout $PICK_TGFOCUS_GITTAG"
test $? -eq 0 || exit 12
$PXY_FRONTEND buildah run $CTN_BUILD_TGFOCUS -- \
bash -c "cd tg-focus && bash dev/install-deps-oci-only.bash"
test $? -eq 0 || exit 13
buildah run $CTN_BUILD_TGFOCUS -- \
bash -c "cd tg-focus && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/local/bin/alt-gcc -DCMAKE_CXX_COMPILER=/usr/local/bin/alt-g++ -B build"
test $? -eq 0 || exit 14
buildah run $CTN_BUILD_TGFOCUS -- \
bash -c 'cd tg-focus/build && LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH make -j$(nproc)'
test $? -eq 0 || exit 15
buildah run $CTN_BUILD_TGFOCUS -- \
bash -c 'cd tg-focus/build && LD_LIBRARY_PATH=/usr/local/lib64:$LD_LIBRARY_PATH TZ=UTC make test'
test $? -eq 0 || exit 16
buildah run $CTN_BUILD_TGFOCUS -- \
bash -c "cd tg-focus && strip /tg-focus/build/tgf-conf && strip /tg-focus/build/tgf-focusd"
test $? -eq 0 || exit 17
# package
buildah commit $CTN_BUILD_TGFOCUS $PICK_TGFOCUS_IMGFULLNAME
test $? -eq 0 || exit 13
tmpctn=$(podman create $PICK_TGFOCUS_IMGFULLNAME)
test $? -eq 0 || exit 14
rm -rf $PICK_TGFOCUS_ARTIFACTNAME
mkdir -p $PICK_TGFOCUS_ARTIFACTNAME/license
podman cp $tmpctn:/tg-focus/build/tgf-conf $PICK_TGFOCUS_ARTIFACTNAME/tgf-conf
test $? -eq 0 || exit 15
podman cp $tmpctn:/tg-focus/build/tgf-focusd $PICK_TGFOCUS_ARTIFACTNAME/tgf-focusd
test $? -eq 0 || exit 16
podman cp $tmpctn:/tg-focus/README.md $PICK_TGFOCUS_ARTIFACTNAME/README.md
test $? -eq 0 || exit 16
podman cp $tmpctn:/tg-focus/ChangeLog $PICK_TGFOCUS_ARTIFACTNAME/ChangeLog
test $? -eq 0 || exit 16
podman cp $tmpctn:/tg-focus/LICENSE-GPL $PICK_TGFOCUS_ARTIFACTNAME/license/LICENSE-GPL
test $? -eq 0 || exit 16
podman cp $tmpctn:/tg-focus/3rd/toml11/LICENSE $PICK_TGFOCUS_ARTIFACTNAME/license/LICENSE-toml11
test $? -eq 0 || exit 16
tar --create --gzip --file $PICK_TGFOCUS_ARTIFACTNAME.tar.gz $PICK_TGFOCUS_ARTIFACTNAME
test $? -eq 0 || exit 17
sha512sum $PICK_TGFOCUS_ARTIFACTNAME.tar.gz > CHECKSUMS
test $? -eq 0 || exit 18
podman rm $tmpctn
podman rm $CTN_BUILD_TGFOCUS
podman rm $CTN_PACK_TDLIB
podman rmi $PICK_TGFOCUS_IMGFULLNAME
test $? -eq 0 || exit 19