freeswitch/scripts/ci/src_tarball.sh

69 lines
1.8 KiB
Bash
Raw Normal View History

#!/bin/sh
##### -*- 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-05-06 02:58:16 +00:00
eval $(parse_version "$1")
dst_name="freeswitch-$ver"
dst_cname="freeswitch-$cmajor.$cminor.$cmicro"
dst_parent="${tmp_dir}/jenkis.$$/"
dst_dir="${tmp_dir}/jenkins.$$/$dst_name"
if [ -d "$dst_dir" ]; then
echo "error: destination directory $dst_dir already exists." 1>&2
exit 1;
fi
mkdir -p $dst_dir
cp -r . $dst_dir
cd $dst_dir
sed -e "s|\(AC_SUBST(SWITCH_VERSION_MAJOR, \[\).*\(\])\)|\1$major\2|" \
-e "s|\(AC_SUBST(SWITCH_VERSION_MINOR, \[\).*\(\])\)|\1$minor\2|" \
-e "s|\(AC_SUBST(SWITCH_VERSION_MICRO, \[\).*\(\])\)|\1$micro\2|" \
-e "s|\(AC_INIT(\[freeswitch\], \[\).*\(\], BUG-REPORT-ADDRESS)\)|\1$ver\2|" \
-i configure.in
if [ -n "$rev" ]; then
sed -e "s|\(AC_SUBST(SWITCH_VERSION_REVISION, \[\).*\(\])\)|\1$rev\2|" \
-e "s|#\(AC_SUBST(SWITCH_VERSION_REVISION\)|\1|" \
-i configure.in
fi
2012-05-06 00:17:20 +00:00
./bootstrap.sh -j
mv bootstrap.sh rebootstrap.sh
rm -f docs/AUTHORS
rm -f docs/COPYING
rm -f docs/ChangeLog
rm -rf .git
cd ..
cd $dst_parent
ls
2012-05-06 01:52:50 +00:00
tar -cvf ${dst_name}.tar $dst_name
2012-05-06 01:52:50 +00:00
# gzip -9 -c ${dst_name}.tar > $dst_name.tar.gz || echo "gzip not available"
bzip2 -z -k ${dst_name}.tar || echo "bzip2 not available"
[ "$dst_name" = "$dst_cname" ] || cp -al ${dst_name}.tar.bz2 ${dst_cname}.tar.bz2
2012-05-06 01:52:50 +00:00
# xz -z -9 -k ${dst_name}.tar || echo "xz / xz-utils not available"
2012-05-06 01:52:50 +00:00
rm -rf ${dst_name}.tar $dst_dir
2012-05-06 01:52:50 +00:00
mkdir -p ${src_repo}/src_dist
mv -f ${dst_name}.tar.* ${src_repo}/src_dist
[ "$dst_name" = "$dst_cname" ] || mv -f ${dst_cname}.tar.* ${src_repo}/src_dist
cat 1>&2 <<EOF
----------------------------------------------------------------------
2012-05-06 02:07:28 +00:00
The freeswitch-${ver} tarballs have been rolled,
now we just need to roll packages with them
----------------------------------------------------------------------
EOF