forked from blynn/pbc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
release
executable file
·96 lines (96 loc) · 2.1 KB
/
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
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
#!/bin/bash
# perform sanity checks, make packages
VER=`grep AC_INIT configure.ac | sed 's/.*\[\([0-9]*\.[0-9]*\.[0-9]*\)\].*/\1/'`
echo Preparing new release: pbc-$VER
GREPVER=${VER//\./\\.}
if [[ $1 == "test" ]]; then
echo test run
TESTRUN=1
fi
if [[ ! -z $(git diff) ]]; then
echo Uncommitted changes detected. Commit them first.
exit 1
fi
git log > ChangeLog
cat ChangeLog | head -20 | grep pbc-$GREPVER > /dev/null || {
echo git log does not mention release
if [[ $TESTRUN ]]; then
echo test run: continuing anyway...
else
exit 1
fi
}
TMPDIR=`mktemp -d` || {
echo Error creating temp directory
exit 1
}
PBCDIR=$TMPDIR/pbc-$VER
echo Running setup...
git archive --format=tar --prefix=pbc-$VER/ HEAD | tar xvC $TMPDIR
HERE=`pwd`
make -f simple.make pbc/parser.tab.c pbc/lex.yy.c
cp pbc/parser.tab.[ch] pbc/lex.yy.[ch] $PBCDIR/pbc
cp ChangeLog $PBCDIR
cd $PBCDIR
grep $GREPVER NEWS > /dev/null || {
echo NEWS does not mention release
if [[ $TESTRUN ]]; then
echo test run: continuing anyway...
else
cd $HERE
rm -rf $TMPDIR
exit 1
fi
}
grep $GREPVER doc/preface.txt > /dev/null || {
echo Error: cannot find $GREPVER in doc/preface.txt.
if [[ $TESTRUN ]]; then
echo test run: continuing anyway...
else
cd $HERE
rm -rf $TMPDIR
exit 1
fi
}
./setup || {
echo ./setup error
rm -rf $TMPDIR
exit 1
}
cd $TMPDIR
echo Creating tarball...
rm -rf $PBCDIR/autom4te.cache
if [[ $TESTRUN ]]; then
echo test run: not building tarball...
else
tar cvfz $HERE/pbc-$VER.tar.gz pbc-$VER
fi
cd $PBCDIR
./configure || {
echo ./configure error
rm -rf $TMPDIR
exit 1
}
echo Testing make...
make || {
echo make error
rm -rf $TMPDIR
exit 1
}
make clean
echo Cross compiling with simple.make...
PLATFORM=win32 colormake -f simple.make || {
echo mingw cross compile error
rm -rf $TMPDIR
exit 1
}
if [[ $TESTRUN ]]; then
echo test run: not building zip...
else
mkdir pbc-$VER
mv out/* param/* pbc-$VER
cp benchmark/REPORT.BAT pbc-$VER
zip -r $HERE/pbc-$VER-win32-bin.zip pbc-$VER
fi
rm -rf $TMPDIR
echo 'Now run ./publish!'