-
Notifications
You must be signed in to change notification settings - Fork 36
/
release
executable file
·49 lines (38 loc) · 871 Bytes
/
release
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
#!/bin/sh
dir=$(dirname $0)
olddir=$(pwd)
cd $dir
echo""
echo "compiling and stripping"
CC=musl-gcc ./build -static -no-pie || exit $?
CC=gcc ./libbuild || exit $?
echo""
echo "packaging"
folder="oppai-$(./oppai -version)-"
folder="${folder}$(gcc -dumpmachine)"
mkdir -p "$folder" || exit $?
mv ./oppai $folder/oppai || exit $?
mv ./liboppai.so $folder/liboppai.so || exit $?
git archive HEAD --prefix=src/ -o "$folder"/src.tar ||
exit $?
cd "$folder" || exit $?
tar xf src.tar || exit $?
cd .. || exit $?
rm "$folder".tar.xz
tar -cvJf "$folder".tar.xz \
"$folder"/oppai \
"$folder"/liboppai.so \
"$folder"/src \
|| exit $?
echo ""
file "$folder".tar.xz
tar tf "$folder".tar.xz
echo ""
file "$folder"/oppai
readelf --dynamic "$folder"/oppai
ldd "$folder"/oppai
echo ""
file "$folder"/liboppai.so
ldd "$folder"/liboppai.so
rm -rf "$folder"
cd $olddir