#
# Commit all changes, export the release, make a release tar.
#
-cwd=`pwd`
-reltype=release
+# source ./config
+. ./config
+
tagbase=Release-
-base_pkg=windows
-branch=$2
-ver=$2
-if [ $# != 2 ] ; then
- echo "Need $0 <rescue-source-directory> <branch>"
- echo "e.g. $0 rescue-source master"
+base_pkg=bacula
+remote=$2
+branch=$3
+ver=$4
+fulltag=$tagbase$ver
+
+if [ $# != 4 ] ; then
+ echo "Need $0 <bacula-source-directory> <remote-name> <branch> <version>"
+ echo "e.g. $0 rescue-source bee Branch-4.0 4.0.3"
exit 1
fi
cd $1
echo "Directory: $1 does not exist"
exit 1
fi
+current=`git branch | awk '/*/ { print $2 }'`
src=`pwd`
git checkout ${branch}
if [ $? -ne 0 ]; then
echo "Checkout of branch ${branch} in ${src} failed."
exit 1
fi
-git pull origin ${branch}
-fulltag=$tagbase$ver
+git pull ${remote} ${branch}
echo " "
-echo "Making $reltype for $base_pkg-$ver ..."
+echo "Making $reltype for Windows $base_pkg-$ver ..."
echo " "
-echo "OK? ctl-c to stop"
-read a
+#echo "OK? ctl-c to stop"
+#read a
cd src/win32
-rm -f release32/winbacula-$ver.exe
-rm -f release64/win64bacula-$ver.exe
+rm -f release32/${base_pkg}-win32-$ver.exe
+rm -f release64/${base_pkg}-win64-$ver.exe
make clean
+cd ../..
+./configure --with-sqlite3
+cd src/win32
./makeall
-cp release32/winbacula-$ver.exe ${cwd}
-cp release64/win64bacula-$ver.exe ${cwd}
-git checkout master
+cp release32/${base_pkg}-win32-$ver.exe ${cwd}
+cp release64/${base_pkg}-win64-$ver.exe ${cwd}
cd ${cwd}
rm -f *.exe.sig
-./sign winbacula-$ver.exe
-./sign win64bacula-$ver.exe
-ls -l win*.exe*
+./sign ${base_pkg}-win32-$ver.exe
+./sign ${base_pkg}-win64-$ver.exe
+ls -l ${base_pkg}-win*.exe*
+cd ${src}
+# get back to original branch
+git checkout ${current}