forked from coccinelle/coccinelle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
make-release.sh
executable file
·86 lines (75 loc) · 2.77 KB
/
make-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
75
76
77
78
79
80
81
82
83
84
85
86
#!/usr/bin/env bash
set -e
VERSION=$1
if [ "a$VERSION" = "a" -o "a$VERSION" = "a-h" -o "a$VERSION" = "a--help" ]; then
echo "Usage: $0 <version number>"
echo "Example: $0 `cat version`"
exit 1
fi
PACKAGE=coccinelle-$VERSION
WORKING_DIRECTORY=/tmp/$PACKAGE
WEBBASE=~/website
WEBSITE=$WEBBASE/distrib
echo The release script will write $VERSION to the file ./version and will create
echo a tag $VERSION if there is no such tag already.
echo If you want to delete a previously tagged release, run the following command:
echo " git tag -d $VERSION"
echo
echo The release script will work in the directory $WORKING_DIRECTORY and
echo will work only if this directory does _not_ exist already. If you
echo want to delete a previously created directory, run the following command:
echo " rm -rf $WORKING_DIRECTORY"
echo
echo The release script will _not_ push the updated repository.
echo You may want to run the following command after the release:
echo " git push"
echo
if [ -d "$WEBSITE" ]; then
echo For the website, you need to manually update those files:
echo " $WEBBASE/download.php"
echo " $WEBSITE/change.html"
echo Then commit the changes.
echo
fi
set -x
mkdir $WORKING_DIRECTORY
echo $VERSION > version
./autogen --ignore_localversion
if ! git rev-parse $VERSION &>/dev/null; then
git add version
git add setup/Makefile.in
git commit -m "Release $VERSION" || true
git tag -a -m "Release $VERSION" $VERSION
fi
./configure >/dev/null
make docs >/dev/null
mkdir $WORKING_DIRECTORY/$PACKAGE
cp -r * $WORKING_DIRECTORY/$PACKAGE
rm -f $WORKING_DIRECTORY/$PACKAGE/*.tar.gz
make spatch.opt tools/spgen/source/spgen.opt >/dev/null
cp spatch.opt $WORKING_DIRECTORY/$PACKAGE
cp tools/spgen/source/spgen.opt $WORKING_DIRECTORY/$PACKAGE/tools/spgen/source
cp ocaml/*.cmi ocaml/*.cmx $WORKING_DIRECTORY/$PACKAGE/ocaml
tar -czf $PACKAGE-bin-x86.tar.gz -C $WORKING_DIRECTORY $PACKAGE
rm -rf $WORKING_DIRECTORY/$PACKAGE
make clean >/dev/null
mkdir $WORKING_DIRECTORY/$PACKAGE
cp -r * $WORKING_DIRECTORY/$PACKAGE
rm -f $WORKING_DIRECTORY/$PACKAGE/*.tar.gz
make spatch tools/spgen/source/spgen >/dev/null
cp spatch $WORKING_DIRECTORY/$PACKAGE
cp tools/spgen/source/spgen $WORKING_DIRECTORY/$PACKAGE/tools/spgen/source
cp ocaml/*.cmi ocaml/*.cmo $WORKING_DIRECTORY/$PACKAGE/ocaml
tar -czf $PACKAGE-bin-bytecode-`ocamlc -vnum`.tar.gz -C $WORKING_DIRECTORY $PACKAGE
rm -rf $WORKING_DIRECTORY/$PACKAGE
make clean >/dev/null
mkdir $WORKING_DIRECTORY/$PACKAGE
cp -r * $WORKING_DIRECTORY/$PACKAGE
rm -f $WORKING_DIRECTORY/$PACKAGE/*.tar.gz
tar -czf $PACKAGE.tar.gz -C $WORKING_DIRECTORY $PACKAGE
rm -rf $WORKING_DIRECTORY/$PACKAGE
if [ -d "$WEBSITE" ]; then
cp $PACKAGE.tar.gz $WEBSITE
cp $PACKAGE-bin-x86.tar.gz $WEBSITE
( cd $WEBSITE; svn add $PACKAGE.tar.gz $PACKAGE-bin-x86.tar.gz )
fi