ci: build orig tarball ourselves for debian
This commit is contained in:
parent
c65aec5b49
commit
075dc90bdb
|
@ -50,6 +50,29 @@ parse_version () {
|
||||||
echo "crev='$crev'"
|
echo "crev='$crev'"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_fs_ver () {
|
||||||
|
local ver="$1" major="$2" minor="$3" micro="$4" rev="$5"
|
||||||
|
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
|
||||||
|
}
|
||||||
|
|
||||||
|
gnuize () {
|
||||||
|
./bootstrap.sh -j
|
||||||
|
mv bootstrap.sh rebootstrap.sh
|
||||||
|
rm -f docs/AUTHORS
|
||||||
|
rm -f docs/COPYING
|
||||||
|
rm -f docs/ChangeLog
|
||||||
|
rm -rf .git
|
||||||
|
}
|
||||||
|
|
||||||
if [ ! -d .git ]; then
|
if [ ! -d .git ]; then
|
||||||
echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2
|
echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2
|
||||||
exit 1;
|
exit 1;
|
||||||
|
|
|
@ -9,49 +9,42 @@ eval $(parse_version "$1")
|
||||||
datestamp="$(date +%Y%m%dT%H%M%SZ)"
|
datestamp="$(date +%Y%m%dT%H%M%SZ)"
|
||||||
nightly="n${datestamp}"
|
nightly="n${datestamp}"
|
||||||
build="b$2"
|
build="b$2"
|
||||||
input_distro=$3
|
distro=${3:="unstable"}
|
||||||
distro=${input_distro:="unstable"}
|
|
||||||
|
|
||||||
dst_version="$ver"
|
fver="${ver}~${nightly}~${build}"
|
||||||
dst_name="freeswitch-${dst_version}"
|
fname="freeswitch-$fver"
|
||||||
dst_parent="/tmp/"
|
orig="freeswitch_$fver.orig"
|
||||||
dst_dir="/tmp/${dst_name}"
|
ddir=$src_repo/debbuild
|
||||||
dst_full_version="${dst_version}~${nightly}~${build}"
|
bdir=$src_repo/debbuild/$fname
|
||||||
dst_full_name="freeswitch-${dst_full_version}"
|
|
||||||
|
|
||||||
mkdir -p $src_repo/debbuild/
|
mkdir -p $ddir
|
||||||
|
git clone . $bdir
|
||||||
|
cd $bdir
|
||||||
|
set_fs_ver "$ver" "$major" "$minor" "$micro" "$rev"
|
||||||
|
gnuize
|
||||||
|
sleep 2
|
||||||
|
cd $ddir
|
||||||
|
tar -c --exclude=.git -vf $orig.tar $fname
|
||||||
|
bzip2 -z -k $orig.tar
|
||||||
|
rm $orig.tar
|
||||||
|
|
||||||
tar xjf src_dist/${dst_name}.tar.bz2 -C ${src_repo}/debbuild/
|
cd $bdir
|
||||||
mv ${src_repo}/debbuild/${dst_name} ${src_repo}/debbuild/${dst_full_name}
|
|
||||||
cp -al src_dist/${dst_name}.tar.bz2 \
|
|
||||||
${src_repo}/debbuild/freeswitch_${dst_full_version}.orig.tar.bz2
|
|
||||||
|
|
||||||
# Build the debian source package first, from the source tar file.
|
|
||||||
echo "changing directory to ${src_repo}/debbuild/${dst_full_name}"
|
|
||||||
|
|
||||||
cd ${src_repo}/debbuild/${dst_full_name}
|
|
||||||
(cd debian && ./bootstrap.sh)
|
(cd debian && ./bootstrap.sh)
|
||||||
# dch can't handle comments in control file
|
# dch can't handle comments in control file
|
||||||
(cd debian; \
|
(cd debian; \
|
||||||
mv control control.orig; \
|
mv control control.orig; \
|
||||||
grep -e '^#' -v control.orig > control)
|
grep -e '^#' -v control.orig > control)
|
||||||
# dependency: libparse-debcontrol-perl
|
# dependency: libparse-debcontrol-perl
|
||||||
dch -b -v "${dst_full_version}-1" \
|
dch -b -v "${fver}-1" \
|
||||||
-M --force-distribution -D "$distro" \
|
-M --force-distribution -D "$distro" \
|
||||||
"Nightly build at ${datestamp}."
|
"Nightly build at ${datestamp}."
|
||||||
# dependency: fakeroot
|
# dependency: fakeroot
|
||||||
dpkg-buildpackage -rfakeroot -S -us -uc
|
dpkg-buildpackage -rfakeroot -S -us -uc || exit $?
|
||||||
|
|
||||||
status=$?
|
cat 1>&2 <<EOF
|
||||||
|
|
||||||
if [ $status -gt 0 ]; then
|
|
||||||
exit $status
|
|
||||||
else
|
|
||||||
cat 1>&2 <<EOF
|
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
The ${dst_full_name} DEB-SRCs have been rolled, now we
|
The ${fname} DEB-SRCs have been rolled, now we
|
||||||
just need to push them to the Debian repo
|
just need to push them to the Debian repo
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
EOF
|
EOF
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,7 @@ sdir="."
|
||||||
|
|
||||||
eval $(parse_version "$1")
|
eval $(parse_version "$1")
|
||||||
|
|
||||||
dst_name="freeswitch-$ver"
|
dst_name="freeswitch-$cmajor.$cminor.$cmicro"
|
||||||
dst_cname="freeswitch-$cmajor.$cminor.$cmicro"
|
|
||||||
dst_parent="${tmp_dir}/jenkis.$$/"
|
dst_parent="${tmp_dir}/jenkis.$$/"
|
||||||
dst_dir="${tmp_dir}/jenkins.$$/$dst_name"
|
dst_dir="${tmp_dir}/jenkins.$$/$dst_name"
|
||||||
|
|
||||||
|
@ -21,25 +20,8 @@ mkdir -p $dst_dir
|
||||||
cp -r . $dst_dir
|
cp -r . $dst_dir
|
||||||
|
|
||||||
cd $dst_dir
|
cd $dst_dir
|
||||||
|
set_fs_ver "$cver" "$cmajor" "$cminor" "$cmicro" "$crev"
|
||||||
sed -e "s|\(AC_SUBST(SWITCH_VERSION_MAJOR, \[\).*\(\])\)|\1$major\2|" \
|
gnuize
|
||||||
-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
|
|
||||||
|
|
||||||
./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 ..
|
||||||
|
|
||||||
cd $dst_parent
|
cd $dst_parent
|
||||||
|
@ -50,18 +32,16 @@ tar -cvf ${dst_name}.tar $dst_name
|
||||||
|
|
||||||
# gzip -9 -c ${dst_name}.tar > $dst_name.tar.gz || echo "gzip not available"
|
# gzip -9 -c ${dst_name}.tar > $dst_name.tar.gz || echo "gzip not available"
|
||||||
bzip2 -z -k ${dst_name}.tar || echo "bzip2 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
|
|
||||||
# xz -z -9 -k ${dst_name}.tar || echo "xz / xz-utils not available"
|
# xz -z -9 -k ${dst_name}.tar || echo "xz / xz-utils not available"
|
||||||
|
|
||||||
rm -rf ${dst_name}.tar $dst_dir
|
rm -rf ${dst_name}.tar $dst_dir
|
||||||
|
|
||||||
mkdir -p ${src_repo}/src_dist
|
mkdir -p ${src_repo}/src_dist
|
||||||
mv -f ${dst_name}.tar.* ${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
|
cat 1>&2 <<EOF
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
The freeswitch-${ver} tarballs have been rolled,
|
The freeswitch-${cver} tarballs have been rolled,
|
||||||
now we just need to roll packages with them
|
now we just need to roll packages with them
|
||||||
----------------------------------------------------------------------
|
----------------------------------------------------------------------
|
||||||
EOF
|
EOF
|
||||||
|
|
Loading…
Reference in New Issue