]> git.sur5r.net Git - bacula/bacula/blob - bacula/release/makebacularel
Tweak update release script
[bacula/bacula] / bacula / release / makebacularel
1 #!/bin/sh
2 #
3 #
4 # This script is used to make a Bacula release
5 #   bacula
6 #   regress
7 #   gui
8 # It writes in the current directory, so we recommend that you
9 #  do not run it in the Bacula source or Git directory, but
10 #  in a special release directory.
11 #
12 # Commit all changes, update the language files, 
13 #    export the release, make a release tar.
14 #
15 cwd=`pwd`
16 reltype=release
17 tagbase=Release-
18 base_dir=bacula
19 base_pkg=bacula
20 ver=$4
21 if [ $# != 4 ] ; then
22   echo "Need $0 <source-directory> <remote-name> <branch> <version>"
23   echo "e.g. $0 release-source bee 4.0 4.0.1"
24   exit 1
25 fi
26 cd $1
27 if [ $? -ne 0 ]; then
28    echo "Directory: $1 does not exist"
29    exit 1
30 fi
31 src=`pwd` 
32 current=`git branch | awk '/*/ { print $2 }'`
33 cd $base_dir 
34 if [ $?  -ne 0 ]; then
35    echo "Directory: $1 does not exist"
36    exit 1
37 fi
38 remote=$2
39 branch=$3
40 git checkout ${branch}
41 git pull ${remote} ${branch}
42 if [ $? -ne 0 ]; then
43    echo "Checkout of branch ${branch} failed."
44    exit 1
45 fi
46 fulltag=$tagbase$ver
47 echo " "
48 echo "Making $reltype for $base_pkg-$ver ..."
49 echo " "
50 echo "OK?  ctl-c to stop"
51 read a
52 rm -rf Release-$ver
53 if [ $reltype != "beta" ] ; then
54    cd src
55    cp -fp version.h 1
56    sed 's%^#define DEVELOPER 1%/* #define DEVELOPER 1 */%g' 1 >version.h
57    rm -f 1
58    cd ..
59 fi
60 if [ a$updatepo != ano ]; then
61    ./configure --enable-client-only
62    cd po
63    make update-po
64    cd ${src}   
65    git commit -am "Final po changes for ${fulltag}"
66 fi
67 git tag -d ${fulltag}
68 echo "Creating new tag -- $fulltag"
69 git tag $fulltag
70 if [ $? != 0 ] ; then
71   echo " "
72   echo "Non-zero return status from Git"
73   echo " "
74   exit 1
75 fi
76 echo "Create Tag $fulltag done"
77 cd ${cwd}
78 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.gz $base_pkg-$ver.tar.gz.sig
79 rm -rf $fulltag
80 cd ${src}
81 git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
82 if [ $? != 0 ] ; then
83   echo " "
84   echo "Non-zero return status from Git"
85   echo " "
86   exit 1
87 fi
88 echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz"
89 cd ${cwd}
90 tar xfz $base_pkg-$ver.tar.gz 
91 cd $base_pkg-$ver/
92 mv bacula $base_pkg-$ver
93 mv gui $base_pkg-gui-$ver
94 mv regress $base_pkg-regress-$ver
95 tar cvfz ../$base_pkg-$ver.tar.gz $base_pkg-$ver
96 tar cvfz ../$base_pkg-gui-$ver.tar.gz $base_pkg-gui-$ver
97 tar cvfz ../$base_pkg-regress-$ver.tar.gz $base_pkg-regress-$ver
98 rm -rf $base_pkg-$ver
99 cd ..
100 ./sign $base_pkg-$ver.tar.gz
101 ./sign $base_pkg-gui-$ver.tar.gz
102 ./sign $base_pkg-regress-$ver.tar.gz
103
104 if [ a$push != ano ]; then
105    cd ${src}
106    git push ${remote} ${branch}
107 #   git push ${remote} tag ${fulltag}
108    echo "Pushed ${remote}"
109 fi
110
111 cd ${src}
112 git checkout ${current}