Improve the VFS Makefile so that it is easier for use out of tree but still works...
[Samba/gebeck_regimport.git] / script / librelease.sh
blobac82762d307a60f615d25e43c50f6b0f860bc9ab
1 #!/bin/bash
2 # make a release of a Samba library
4 [ -z "$GPG_USER" ] && {
5 GPG_USER='Samba Library Distribution Key <samba-bugs@samba.org>'
8 [ -z "$GPG_KEYID" ] && {
9 GPG_KEYID='13084025'
12 if [ ! -d ".git" ]; then
13 echo "Run this script from the top-level directory in the"
14 echo "repository"
15 exit 1
18 if [ $# -lt 1 ]; then
19 echo "Usage: librelease.sh <LIBNAMES>"
20 exit 1
23 umask 0022
25 release_lib() {
26 lib="$1"
27 srcdir="$2"
28 ftpdir="$3"
30 pushd $srcdir
32 echo "Releasing library $lib"
34 echo "building release tarball"
35 tgzname=$(make dist 2>&1 | grep ^Created | cut -d' ' -f2)
36 [ -f "$tgzname" ] || {
37 echo "Failed to create tarball"
38 exit 1
40 tarname=$(basename $tgzname .gz)
41 echo "Tarball: $tarname"
42 gunzip -f $tgzname || exit 1
43 [ -f "$tarname" ] || {
44 echo "Failed to decompress tarball $tarname"
45 exit 1
48 tagname=$(basename $tarname .tar)
49 echo "tagging as $tagname"
50 git tag -u $GPG_KEYID -s "$tagname" -m "$lib: tag release $tagname" || {
51 exit 1
54 echo "signing"
55 rm -f "$tarname.asc"
56 gpg -u "$GPG_USER" --detach-sign --armor $tarname || {
57 exit 1
59 [ -f "$tarname.asc" ] || {
60 echo "Failed to create signature $tarname.asc"
61 exit 1
63 echo "compressing"
64 gzip -f -9 $tarname
65 [ -f "$tgzname" ] || {
66 echo "Failed to compress $tgzname"
67 exit 1
70 echo "Push git tag $tagname"
71 git push ssh://git.samba.org/data/git/samba.git refs/tags/$tagname:refs/tags/$tagname || {
72 exit 1
75 echo "Transferring for FTP"
76 rsync -Pav $tarname.asc $tgzname master.samba.org:~ftp/pub/$ftpdir/ || {
77 exit 1
79 rsync master.samba.org:~ftp/pub/$ftpdir/$tarname.*
81 popd
84 for lib in $*; do
85 case $lib in
86 talloc | tdb | tevent | ldb)
87 release_lib $lib "lib/$lib" $lib
89 samba4)
90 release_lib $lib "." "samba/$lib"
93 echo "Unknown library $lib"
94 exit 1
95 esac
96 done