-
Notifications
You must be signed in to change notification settings - Fork 41
/
maketxpkg.sh
executable file
·85 lines (73 loc) · 2.38 KB
/
maketxpkg.sh
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
#!/bin/sh
LOCAL_PATH=$(cd `dirname $0`; pwd)
echo "LOCAL_PATH=$LOCAL_PATH"
SERO_PATH="${LOCAL_PATH%}"
echo "SERO_PATH=$SERO_PATH"
CZERO_PATH="${SERO_PATH%/*}/go-czero-import"
echo "CZERO_PATH=$CZERO_PATH"
echo "update go-czero-import"
cd $CZERO_PATH
git fetch&&git rebase
echo "update go-sero"
cd $SERO_PATH
git fetch&&git rebase
make clean
BUILD_PATH="${SERO_PATH%}/build"
os="all"
version="v0.3.1-beta.rc.5"
while getopts ":o:v:" opt
do
case $opt in
o)
os=$OPTARG
;;
v)
version=$OPTARG
;;
?)
echo "unkonw param"
exit 1;;
esac
done
if [ "$os" = "all" ]; then
os_version=("linux-amd64-v3" "linux-amd64-v4" "darwin-amd64" "windows-amd64")
else
os_version[0]="$os"
fi
for os in ${os_version[@]}
do
echo "make gerotx-${os}"
make "gerotx-"${os}
rm -rf $BUILD_PATH/gerotxpkg/bin
rm -rf $BUILD_PATH/gerotxpkg/czero
mkdir -p $BUILD_PATH/gerotxpkg/bin
mkdir -p $BUILD_PATH/gerotxpkg/czero/data/
mkdir -p $BUILD_PATH/gerotxpkg/czero/include/
mkdir -p $BUILD_PATH/gerotxpkg/czero/lib/
cp -rf $CZERO_PATH/czero/data/* $SERO_PATH/build/gerotxpkg/czero/data/
cp -rf $CZERO_PATH/czero/include/* $SERO_PATH/build/gerotxpkg/czero/include/
if [ $os == "windows-amd64" ];then
mv $BUILD_PATH/bin/gerotx*.exe $BUILD_PATH/gerotxpkg/bin/tx.exe
cp -rf $CZERO_PATH/czero/lib_WINDOWS_AMD64/* $SERO_PATH/build/gerotxpkg/czero/lib/
elif [ $os == "linux-amd64-v3" ];then
mv $BUILD_PATH/bin/gerotx-v3* $BUILD_PATH/gerotxpkg/bin/tx
cp -rf $CZERO_PATH/czero/lib_LINUX_AMD64_V3/* $SERO_PATH/build/gerotxpkg/czero/lib/
elif [ $os == "linux-amd64-v4" ];then
mv $BUILD_PATH/bin/gerotx-v4* $BUILD_PATH/gerotxpkg/bin/tx
cp -rf $CZERO_PATH/czero/lib_LINUX_AMD64_V4/* $SERO_PATH/build/gerotxpkg/czero/lib/
else
mv $BUILD_PATH/bin/gerotx-darwin* $BUILD_PATH/gerotxpkg/bin/tx
cp -rf $CZERO_PATH/czero/lib_DARWIN_AMD64/* $SERO_PATH/build/gerotxpkg/czero/lib/
fi
cd $BUILD_PATH
if [ $os == "windows-amd64" ];then
rm -rf ./gerotx-*-$os.zip
zip -r gerotx-$version-$os.zip gerotxpkg/*
else
rm -rf ./gerotx-*-$os.tar.gz
tar czvf gerotx-$version-$os.tar.gz gerotxpkg/*
fi
cd $LOCAL_PATH
done
rm -rf $BUILD_PATH/gerotxpkg/bin
rm -rf $BUILD_PATH/gerotxpkg/czero