forked from aantonop/cpp-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release.sh
executable file
·74 lines (58 loc) · 1.32 KB
/
release.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
#!/bin/bash
dist="saucy"
version=$(grep "define ETH_VERSION" libethereum/Common.h | cut -d ' ' -f 3)
branch="$(git branch | grep \* | cut -c 3-)"
if [[ ! "$1" == "" ]]; then
version=$1
fi
if [[ ! "$3" == "" ]]; then
if [[ ! "$4" == "" ]]; then
dist=$4
fi
if [[ "$2" == "-i" ]]; then
# increment current debian release only
# new version ./release VERSION -i MESSAGE DIST
debchange -i -p "$3" -D "$dist"
git commit -a -m "$3"
else
# new version ./release VERSION DEB-VERSION MESSAGE DIST
debchange -v $version-$2 -p "$3" -D "$dist"
git commit -a -m "$3"
fi
fi
opwd=`pwd`
cd /tmp
echo Checking out...
git clone $opwd
cd cpp-ethereum
git checkout "$branch"
archdir="cpp-ethereum-$version"
archfile="$archdir.tar.bz2"
echo Making BuildInfo...
mkdir build
cd build
cmake ..
cd ..
cp build/BuildInfo.h .
rm -rf build
echo Cleaning backup files...
find . | grep \~ | xargs rm -f
echo Cleaning others...
rm release.sh
echo Cleaning versioning...
rm -rf .git .gitignore
echo Renaming directory...
cd ..
rm -rf $archdir
mv cpp-ethereum $archdir
echo Creating archive...
tar c $archdir | bzip2 -- > $archfile
shasum $archfile
[[ ! "$version" == "" ]] && ln -sf $archfile "cpp-ethereum_$version.orig.tar.bz2"
echo Packaging...
cd "$archdir"
./package.sh
echo Cleaning up...
rm -rf /tmp/$archdir
mv /tmp/$archfile ~
echo Done.