Update list-maintainers to output redmine syntax
[hoomd-blue.git] / packaging / deb_build_nightly.sh
blobef9ddf487cc883437cc1f42d2a0fb21837c3ecd7
1 BRANCH=maint
3 #update our codebase
4 cd ../
5 git fetch
6 git checkout ${BRANCH}
7 git pull --ff-only
9 #check the previous version built
10 export atrev="$(cat ../deb_old_version)"
11 export old_ver="$(git describe)"
12 echo $atrev
13 echo $old_ver
14 if [ "$atrev" = "$old_ver" ];then
15 echo "up to date"
16 else
17 echo "commence building"
18 rm -r debian/*
19 cp -r packaging/debian ./
20 #get what architecture we're building on.
21 if [ `arch` = "x86_64" ]
22 then
23 #patch debian folder for 64 bit
24 echo "patching 64bit"
25 export lib_suffix="64"
26 sed -i s/i386/amd64/ debian/control
27 sed -i s/i386/amd64/ debian/files
28 else
29 #patch debian folder for building on i386
30 echo "patching 32bit"
31 export lib_suffix=""
32 sed -i s/amd64/i386/ debian/control
33 sed -i s/amd64/i386/ debian/files
36 #set the version we just setup for in deb_old_version so it won't be built again
37 echo $(git describe) > ../deb_old_version
39 #export the variables to set the version from git
40 export HVERSION_BASE=$(git describe | awk 'BEGIN { FS = "-" } ; {print $1}' | cut -c2-)
42 export HREVISION=$(git describe | awk 'BEGIN { FS = "-" } ; {print $2}')
43 #set a zero revision if HREVISION is blank
44 if [ -z "${HREVISION}" ]; then
45 HREVISION="0"
47 export HVERSION="${HVERSION_BASE}-"${HREVISION}
48 echo $HVERSION
49 #set our package version in changelog
50 sed s/HVERSION/${HVERSION}/ debian/changelog -i
51 #call package builder
52 dpkg-buildpackage
53 #move files to be uploaded
54 cd ..
55 cp deb_old_version deb_version${lib_suffix}
56 scp deb_version${lib_suffix} joaander@foxx.engin.umich.edu:devel/incoming/ubuntu
57 scp hoomd-blue_${HVERSION}_$(dpkg-architecture -qDEB_BUILD_ARCH).deb joaander@foxx.engin.umich.edu:devel/incoming/ubuntu