]> git.sur5r.net Git - bacula/bacula/blob - bacula/release/makedocsrel
Final po changes for Release-5.0.3
[bacula/bacula] / bacula / release / makedocsrel
1 #!/bin/sh
2 #
3 #
4 # This script is used to make a Bacula docs release
5 #   docs
6 # It writes in the current directory, so we recommend that you
7 #  do not run it in the Bacula source or Git directory, but
8 #  in a special release directory.
9 #
10 # Commit all changes, export the release, make a release tar.
11 #
12 . ./functions
13
14 cwd=`pwd`
15 reltype=release
16 tagbase=Release-
17 base_dir=docs
18 base_pkg=bacula-$base_dir
19 remote=$3
20 branch=$4
21 ver=$5
22
23 if [ $# != 5 ] ; then
24   echo "Need $0 <bacula-source-directory> <docs-source-directory> <remote-name> <branch> <version>"
25   echo "e.g. $0 bacula-source docs-source bee master 4.0.1"
26   exit 1
27 fi
28
29 # Get Bacula branch setup
30 cd $1/bacula
31 check_return_code "$0: Directory $1/bacula does not exist"
32
33 bcurrent=`git branch | awk '/*/ { print $2 }'`
34 git checkout ${branch}
35 check_return_code "$0: Checkout of branch ${branch} in $1/bacula failed."
36 git pull ${remote} ${branch}
37 bsrc=`pwd` 
38 cd ${cwd}
39
40 # Go to docs
41 cd $2/$base_dir
42 check_return_code "$0: Directory $2/$base_dir does not exist"
43
44 current=`git branch | awk '/*/ { print $2 }'`
45 src=`pwd` 
46 git checkout ${branch}
47 check_return_code "$0: Checkout of branch ${branch} in ${src} failed."
48
49 git pull ${remote} ${branch}
50 fulltag=$tagbase$ver
51 echo " "
52 echo "$0: Making $reltype for $base_pkg-$ver ..."
53 echo " "
54 echo "OK?  ctl-c to stop"
55 read a
56
57 git tag -d ${fulltag} 2>/dev/null 1>/dev/null
58 echo "Creating new tag -- $fulltag"
59 git tag $fulltag
60 check_return_code "$0: Non-zero return status from Git"
61 echo "Create Tag $fulltag done"
62 cd ${cwd}
63 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.gz $base_pkg-$ver.tar.gz.sig
64 rm -rf $fulltag
65 cd ${src}
66 git archive --format=tar --prefix=$base_pkg-$ver/ $fulltag | gzip >${cwd}/$base_pkg-$ver.tar.gz
67 check_return_code "$0: Non-zero return status from Git"
68 echo "Exported release into ${cwd}/$base_pkg-$ver.tar.gz"
69 cd ${cwd}
70 tar xfz $base_pkg-$ver.tar.gz 
71 cd $base_pkg-$ver/
72 mv docs $base_pkg-$ver
73 cd $base_pkg-$ver
74 ./configure --with-bacula=$bsrc
75 make en
76 cd ${cwd}
77 echo "Tarring docs ..."
78 tar cf $base_pkg-$ver.tar $base_pkg-$ver
79 rm -rf $base_pkg-$ver $base_pkg-$ver.tar.*
80 echo "bzip2 docs ..."
81 bzip2 $base_pkg-$ver.tar
82 ./sign $base_pkg-$ver.tar.bz2
83 ls -l $base_pkg-$ver.tar.*
84
85 if [ a$push != ano ]; then
86    cd ${src}
87    git push ${remote} ${branch}
88 #   git push ${remote} tag ${fulltag}
89    echo "Pushed ${remote}"
90 fi
91
92 cd ${src}
93 git checkout ${current}
94
95 cd ${bsrc}
96 git checkout ${bcurrent}
97 exit 0