-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
release.sh
56 lines (49 loc) · 1.23 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
#!/bin/sh
#
# Shell script if you are going to package the library up for release
#
cwd=`pwd`
version=`grep dmalloc_version version.h | cut -f2 -d\"`
dir=dmalloc-$version
head -1 ChangeLog.txt | grep -q $version
if [ $? -ne 0 ]; then
echo "First line of ChangeLog.txt does not include version $version"
head -1 ChangeLog.txt
exit 1
fi
grep -q "dmalloc_version Version $version" dmalloc.texi
if [ $? -ne 0 ]; then
echo "dmalloc.texi does not include version $version"
grep -q "dmalloc_version " dmalloc.texi
exit 1
fi
grep -q "Version: $version" dmalloc.spec
if [ $? -ne 0 ]; then
echo "dmalloc.spec does not include version $version"
grep "Version: " dmalloc.spec
exit 1
fi
set -e
# run tests
echo "Running tests"
rm -rf $dir
# clone our repo
git clone git@github.com:j256/dmalloc.git $dir
mkdir $dir/tmp
cd $dir/tmp
../configure
make all heavy
dmalloc
echo "----------------------------------------------------------------"
echo "Building release"
cd $cwd
echo "Building release directory: $dir"
rm -rf $dir
# clone our repo
git clone git@github.com:j256/dmalloc.git $dir
# clear our dot files not suitable for release
rm -rf $dir/.??*
dest=$dir.tgz
rm -f $dest
tar -cf - $dir | gzip -9 > $dest
echo "Created $dest"