2012-05-06 03:24:46 +00:00
|
|
|
#!/bin/sh
|
2012-03-06 03:13:16 +00:00
|
|
|
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
|
|
|
|
|
2012-05-06 02:58:16 +00:00
|
|
|
sdir="."
|
|
|
|
[ -n "${0%/*}" ] && sdir="${0%/*}"
|
|
|
|
. $sdir/common.sh
|
2012-03-06 03:13:16 +00:00
|
|
|
|
2012-05-06 02:58:16 +00:00
|
|
|
eval $(parse_version "$1")
|
2012-05-06 02:08:29 +00:00
|
|
|
datestamp="$(date +%Y%m%dT%H%M%SZ)"
|
|
|
|
nightly="n${datestamp}"
|
|
|
|
build="b$2"
|
2012-04-20 03:37:17 +00:00
|
|
|
input_distro=$3
|
|
|
|
distro=${input_distro:="unstable"}
|
2012-03-06 03:13:16 +00:00
|
|
|
|
2012-05-06 01:12:08 +00:00
|
|
|
dst_version="$ver"
|
2012-05-06 01:52:50 +00:00
|
|
|
dst_name="freeswitch-${dst_version}"
|
2012-03-06 03:13:16 +00:00
|
|
|
dst_parent="/tmp/"
|
2012-05-06 01:52:50 +00:00
|
|
|
dst_dir="/tmp/${dst_name}"
|
2012-05-06 03:49:34 +00:00
|
|
|
dst_full_version="${dst_version}~${nightly}~${build}"
|
2012-05-06 01:52:50 +00:00
|
|
|
dst_full_name="freeswitch-${dst_full_version}"
|
2012-03-06 03:13:16 +00:00
|
|
|
|
|
|
|
mkdir -p $src_repo/debbuild/
|
|
|
|
|
2012-05-06 01:52:50 +00:00
|
|
|
tar xjf src_dist/${dst_name}.tar.bz2 -C ${src_repo}/debbuild/
|
|
|
|
mv ${src_repo}/debbuild/${dst_name} ${src_repo}/debbuild/${dst_full_name}
|
|
|
|
mv src_dist/${dst_name}.tar.bz2 \
|
|
|
|
${src_repo}/debbuild/freeswitch_${dst_full_version}.orig.tar.bz2
|
2012-03-06 03:13:16 +00:00
|
|
|
|
|
|
|
# Build the debian source package first, from the source tar file.
|
2012-05-06 01:52:50 +00:00
|
|
|
echo "changing directory to ${src_repo}/debbuild/${dst_full_name}"
|
2012-04-20 05:02:26 +00:00
|
|
|
|
2012-05-06 01:52:50 +00:00
|
|
|
cd ${src_repo}/debbuild/${dst_full_name}
|
2012-05-06 03:32:11 +00:00
|
|
|
(cd debian && ./bootstrap.sh)
|
2012-05-06 02:08:29 +00:00
|
|
|
dch -v "${dst_full_version}-1" \
|
|
|
|
-M --force-distribution -D "$distro" \
|
|
|
|
"Nightly build at ${datestamp}."
|
2012-03-06 03:13:16 +00:00
|
|
|
|
|
|
|
dpkg-buildpackage -rfakeroot -S -us -uc
|
|
|
|
|
|
|
|
status=$?
|
|
|
|
|
|
|
|
if [ $status -gt 0 ]; then
|
|
|
|
exit $status
|
|
|
|
else
|
|
|
|
cat 1>&2 <<EOF
|
|
|
|
----------------------------------------------------------------------
|
2012-05-06 01:52:50 +00:00
|
|
|
The ${dst_full_name} DEB-SRCs have been rolled, now we
|
|
|
|
just need to push them to the Debian repo
|
2012-03-06 03:13:16 +00:00
|
|
|
----------------------------------------------------------------------
|
|
|
|
EOF
|
|
|
|
fi
|
|
|
|
|