libcli: added a drsuapi attribute encryption function
[Samba/ekacnet.git] / lib / tdb / release-script.sh
blobddeb753b970be487c0e5dbaeebb6429210228df4
1 #!/bin/bash
3 if [ "$1" = "" ]; then
4 echo "Please provide version string, eg: 1.2.0"
5 exit 1
6 fi
8 if [ ! -d "lib/tdb" ]; then
9 echo "Run this script from the samba base directory."
10 exit 1
13 git clean -f -x -d lib/tdb
14 git clean -f -x -d lib/replace
16 curbranch=`git-branch |grep "^*" | tr -d "* "`
18 version=$1
19 strver=`echo ${version} | tr "." "-"`
21 # Checkout the release tag
22 git branch -f tdb-release-script-${strver} tdb-${strver}
23 if [ ! "$?" = "0" ]; then
24 echo "Unable to checkout tdb-${strver} release"
25 exit 1
28 git checkout tdb-release-script-${strver}
30 # Test configure agrees with us
31 confver=`grep "^AC_INIT" lib/tdb/configure.ac | tr -d "AC_INIT(tdb, " | tr -d ")"`
32 if [ ! "$confver" = "$version" ]; then
33 echo "Wrong version, requested release for ${version}, found ${confver}"
34 exit 1
37 # Now build tarball
38 cp -a lib/tdb tdb-${version}
39 cp -a lib/replace tdb-${version}/libreplace
40 pushd tdb-${version}
41 ./autogen.sh
42 popd
43 tar cvzf tdb-${version}.tar.gz tdb-${version}
44 rm -fr tdb-${version}
46 #Clean up
47 git checkout $curbranch
48 git branch -d tdb-release-script-${strver}