-
Notifications
You must be signed in to change notification settings - Fork 0
/
tgfocus-gittag-x64-linux-musl.bash~
106 lines (82 loc) · 3.03 KB
/
tgfocus-gittag-x64-linux-musl.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
source vars-x64-linux-musl.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
fi
# remove build and pack
buildah ps | grep $CTN_BUILD_TGFOCUS
test $? -eq 0 && buildah rm $CTN_BUILD_TGFOCUS
test $? -eq 0 || exit 2
buildah ps | grep $CTN_PACK_TGFOCUS
test $? -eq 0 && buildah rm $CTN_PACK_TGFOCUS
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
buildah run $CTN_BUILD_TGFOCUS -- \
sed -i "s/dl-cdn.alpinelinux.org/$PICK_APK_MIRROR/" /etc/apk/repositories
test $? -eq 0 || exit 4
buildah run $CTN_BUILD_TGFOCUS -- \
sh -c "apk update"
test $? -eq 0 || exit 5
buildah run $CTN_BUILD_TGFOCUS -- \
sh -c "apk add pkgconfig gcc g++ git cmake make"
test $? -eq 0 || exit 6
# better use *-dev
buildah run $CTN_BUILD_TGFOCUS -- \
sh -c "ln -s /usr/lib/libssl.so.3 /usr/lib/libssl.so"
test $? -eq 0 || exit 7
buildah run $CTN_BUILD_TGFOCUS -- \
sh -c "ln -s /usr/lib/libcrypto.so.3 /usr/lib/libcrypto.so"
test $? -eq 0 || exit 8
buildah run $CTN_BUILD_TGFOCUS -- \
sh -c "ln -s /lib/libz.so.1 /lib/libz.so"
test $? -eq 0 || exit 9
$PXY_FRONTEND buildah run $CTN_BUILD_TGFOCUS -- \
sh -c "git clone https://github.com/micl2e2/tg-focus"
test $? -eq 0 || exit 10
$PXY_FRONTEND buildah run $CTN_BUILD_TGFOCUS -- \
sh -c "cd tg-focus && git checkout $PICK_TGFOCUS_GITTAG"
test $? -eq 0 || exit 11
$PXY_FRONTEND buildah run $CTN_BUILD_TGFOCUS -- \
sh -c "cd tg-focus && sh dev/install-deps-oci-only.bash"
test $? -eq 0 || exit 12
buildah run $CTN_BUILD_TGFOCUS -- \
sh -c "cd tg-focus && cmake -DCMAKE_BUILD_TYPE=Release -B build"
test $? -eq 0 || exit 13
buildah run $CTN_BUILD_TGFOCUS -- \
sh -c 'cd tg-focus/build && make -j$(nproc)'
test $? -eq 0 || exit 14
buildah run $CTN_BUILD_TGFOCUS -- \
sh -c "cd tg-focus/build && make test"
test $? -eq 0 || exit 15
buildah run $CTN_BUILD_TGFOCUS -- \
sh -c "cd tg-focus && strip /tg-focus/build/tf-conf && strip /tg-focus/build/tf-focusd"
test $? -eq 0 || exit 16
# package
buildah from --name $CTN_PACK_TGFOCUS $PICK_BASEIMG
test $? -eq 0 || exit 17
buildah copy --from $CTN_BUILD_TGFOCUS $CTN_PACK_TGFOCUS '/usr/local' '/usr/local'
test $? -eq 0 || exit 18
buildah commit $CTN_PACK_TGFOCUS $PICK_TGFOCUS_IMGFULLNAME
test $? -eq 0 || exit 19
# save tar
podman save --output $PICK_TGFOCUS_ARTIFACTNAME.tar --format oci-archive $PICK_TGFOCUS_IMGFULLNAME
test $? -eq 0 || exit 20
# save json
podman inspect $PICK_TGFOCUS_IMGFULLNAME >$PICK_TGFOCUS_ARTIFACTNAME.json
test $? -eq 0 || exit 21
# save checksums
sha512sum $PICK_TGFOCUS_ARTIFACTNAME.tar >> CHECKSUMS
test $? -eq 0 || exit 22
sha512sum $PICK_TGFOCUS_ARTIFACTNAME.json >> CHECKSUMS
test $? -eq 0 || exit 23
# Delete only when necessary
buildah rm $CTN_BUILD_TGFOCUS
buildah rm $CTN_PACK_TGFOCUS
podman rmi $PICK_TGFOCUS_IMGFULLNAME