s3-waf: Build libwbclient as dynamic library
[Samba/gebeck_regimport.git] / lib / talloc / script / release-script.sh
blob4b8aac7d3c418b30d5c866181a12ad13a5da8120
1 #!/bin/bash
3 LNAME=talloc
4 LINCLUDE=talloc.h
6 if [ "$1" = "" ]; then
7 echo "Please provide version string, eg: 1.2.0"
8 exit 1
9 fi
11 if [ ! -d "lib/${LNAME}" ]; then
12 echo "Run this script from the samba base directory."
13 exit 1
16 curbranch=`git branch |grep "^*" | tr -d "* "`
18 version=$1
19 strver=`echo ${version} | tr "." "-"`
21 # Checkout the release tag
22 git branch -f ${LNAME}-release-script-${strver} ${LNAME}-${strver}
23 if [ ! "$?" = "0" ]; then
24 echo "Unable to checkout ${LNAME}-${strver} release"
25 exit 1
28 function cleanquit {
29 #Clean up
30 git checkout $curbranch
31 git branch -d ${LNAME}-release-script-${strver}
32 exit $1
35 # NOTE: use cleanquit after this point
36 git checkout ${LNAME}-release-script-${strver}
38 # Test configure agrees with us
39 confver=`grep "^AC_INIT" lib/${LNAME}/configure.ac | tr -d "AC_INIT(${LNAME}, " | tr -d ")"`
40 if [ ! "$confver" = "$version" ]; then
41 echo "Wrong version, requested release for ${version}, found ${confver}"
42 cleanquit 1
45 # Check exports and signatures are up to date
46 pushd lib/${LNAME}
47 ./script/abi_checks.sh ${LNAME} ${LINCLUDE}
48 abicheck=$?
49 popd
50 if [ ! "$abicheck" = "0" ]; then
51 echo "ERROR: ABI Checks produced warnings!"
52 cleanquit 1
55 git clean -f -x -d lib/${LNAME}
56 git clean -f -x -d lib/replace
58 # Now build tarball
59 cp -a lib/${LNAME} ${LNAME}-${version}
60 cp -a lib/replace ${LNAME}-${version}/libreplace
61 pushd ${LNAME}-${version}
62 ./autogen.sh
63 popd
64 tar cvzf ${LNAME}-${version}.tar.gz ${LNAME}-${version}
65 rm -fr ${LNAME}-${version}
67 cleanquit 0