3 # Copyright (C) 2000-2017 Kern Sibbald
4 # License: BSD 2-Clause; see file LICENSE-FOSS
6 # This script is used to make a Bacula release
10 # It writes in the current directory, so we recommend that you
11 # do not run it in the Bacula source or Git directory, but
12 # in a special release directory.
14 # Commit all changes, update the language files,
15 # export the release, make a release tar.
29 echo "Need $0 <source-directory> <remote-name> <branch> <version>"
30 echo "e.g. $0 release-source bee Branch-4.0 4.0.3"
35 echo "Directory: $1 does not exist"
39 current=`git branch | awk '/*/ { print $2 }'`
42 echo "Directory: $1 does not exist"
45 git checkout ${branch}
46 git pull ${remote} ${branch}
48 echo "Checkout of branch ${branch} failed."
53 echo "Making $reltype for $base_pkg-$ver ..."
55 #echo "OK? ctl-c to stop"
58 if [ $reltype != "beta" ] ; then
61 sed 's%^#define DEVELOPER 1%/* #define DEVELOPER 1 */%g' 1 >version.h
65 if [ a$updatepo != ano ]; then
66 ./configure --enable-client-only
73 echo "Creating new tag -- $fulltag"
77 echo "Non-zero return status from Git"
81 echo "Create Tag $fulltag done"
83 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.gz $base_pkg-$ver.tar.gz.sig
86 git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
90 echo "Non-zero return status from Git"
94 echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz"
96 tar xfz $base_pkg-$ver.tar.gz
97 # First remove Enterprise Win32 plugin source
98 cd $base_pkg-$ver/bacula
99 cp -fp ReleaseNotes ChangeLog src/version.h ${cwd}/
100 cp -fp LICENSE* ${cwd}/
102 cd ${cwd}/$base_pkg-$ver
103 # Move directories to release names including version
104 mv bacula $base_pkg-$ver
105 mv gui $base_pkg-gui-$ver
106 mv regress $base_pkg-regress-$ver
107 # Tar each component individually
108 tar cvfz ../$base_pkg-$ver.tar.gz $base_pkg-$ver
109 tar cvfz ../$base_pkg-gui-$ver.tar.gz $base_pkg-gui-$ver
110 tar cvfz ../$base_pkg-regress-$ver.tar.gz $base_pkg-regress-$ver
112 rm -rf $base_pkg-$ver
113 ./sign $base_pkg-$ver.tar.gz
114 ./sign $base_pkg-gui-$ver.tar.gz
115 ./sign $base_pkg-regress-$ver.tar.gz
117 if [ a$push != ano ]; then
119 git push ${remote} ${branch}
120 git push ${remote} tag ${fulltag}
121 echo "Pushed ${remote} and push tag ${fulltag}"
125 git checkout ${current}