-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildrelease
executable file
·113 lines (89 loc) · 2.28 KB
/
buildrelease
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#! /bin/sh
# buildrelease -- make a release
set -e
PACKAGE=nc6
# determine the version number
current_version=`grep AC_INIT ./configure.ac | sed -e 's/^AC_INIT(.*, \(.*\)-cvs, .*)$/\1/'`
if [ "X$current_version" = "X" ]; then
echo "Can't determine current version number. Please check configure.ac"
exit 1
fi
current_major=`echo $current_version | sed -e 's/^\(.*\)\..*$/\1/'`
if [ "X$current_major" = "X" ]; then
echo "Can't determine current major version number. Please check configure.ac"
exit 1
fi
current_minor=`echo $current_version | sed -e 's/^.*\.\(.*\)$/\1/'`
if [ "X$current_minor" = "X" ]; then
echo "Can't determine current minor version number. Please check configure.ac"
exit 1
fi
new_version=$current_major.`expr $current_minor + 1`
echo -n "What is the next version number [$new_version]? "
read response
case "$response" in
'')
;;
*)
new_version=$response
;;
esac
release_tag=release_`echo $new_version | sed -e 's/^\([0-9]+\)\.\([0-9+]\)$/\1_\2/'`
if [ "X$release_tag" = "Xrelease_" ]; then
echo "Invalid new version number '$new_version'"
exit 1
fi
# update the po files
echo
echo "Updating po files"
if [ -e po/Makefile ]; then
(cd po && make update-po) > /dev/null
else
echo "Please configure the source first" >&2
exit 1
fi
# edit the changelog
echo
echo -n "Should I open the changelog for editing [Y/n]? "
read response
case "$response" in
y|yes|Y|YES|Yes|'')
if [ "X$EDITOR" = "X" ]; then
EDITOR=vi
fi
$EDITOR ./ChangeLog
;;
n|no|N|NO|No)
;;
*)
echo "Bad response" >&2;
exit 1
;;
esac
# update version in configure.ac
echo
echo "Updating configure.ac with release version"
cp configure.ac configure.ac.$$
cat configure.ac.$$ | sed -e "s/^\(AC_INIT(.*, \).*-cvs\(, .*)\)$/\1$new_version\2/" > configure.ac
cvs commit
echo
echo "Tagging dist with release version"
cvs tag $release_tag
echo
echo "Updating configure.ac with new cvs version"
cat configure.ac.$$ | sed -e "s/^\(AC_INIT(.*, \).*\(-cvs, .*)\)$/\1$new_version\2/" > configure.ac
rm -f configure.ac.$$
cvs commit
# do the build
echo
echo "Building release"
set -x
cvs export -r $release_tag -d release_build $PACKAGE
cd release_build
./bootstrap
./configure
make dist
make distcheck
cp *.tar.gz *.tar.bz2 ..
cd ..
rm -rf release_build