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