Merge pull request #187 in FS/freeswitch from ~CRIENZO/freeswitch:feature/fs-7273 to master
* commit '66486713b0eca7df5879ddf4250a3e21e3e21810': FS-7273 Add support for build server to optionally specify revision when packaging RPM. common.sh optionally accepts revision number and sets version in freeswitch-config-rayo.spec config-rayo.sh updated to be consistent with rpmbuilder.sh rpmbuilder.sh optionally accepts revision number src_tarball.sh will now produce freeswitch.spec and freeswitch-config-rayo.spec as artifacts.
This commit is contained in:
commit
d3caa6f7c6
|
@ -1,7 +1,7 @@
|
||||||
######################################################################################################################
|
######################################################################################################################
|
||||||
#
|
#
|
||||||
# freeswitch-config-rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
# freeswitch-config-rayo for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
|
||||||
# Copyright (C) 2013-2014, Grasshopper
|
# Copyright (C) 2013-2015, Grasshopper
|
||||||
#
|
#
|
||||||
# Version: MPL 1.1
|
# Version: MPL 1.1
|
||||||
#
|
#
|
||||||
|
@ -28,8 +28,8 @@
|
||||||
#
|
#
|
||||||
######################################################################################################################
|
######################################################################################################################
|
||||||
|
|
||||||
%define version %{VERSION_NUMBER}
|
%define version 1.5.16
|
||||||
%define release %{BUILD_NUMBER}
|
%define release 1
|
||||||
|
|
||||||
%define fsname freeswitch
|
%define fsname freeswitch
|
||||||
|
|
||||||
|
|
|
@ -116,14 +116,38 @@ set_fs_ver () {
|
||||||
mv configure.ac.$$ configure.ac
|
mv configure.ac.$$ configure.ac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sed -e "s|\(%define version \).*|\1$major.$minor.$micro|" \
|
local rpm_version
|
||||||
|
if [ -n "$rev" ]; then
|
||||||
|
rpm_version="$major.$minor.$micro.$rev"
|
||||||
|
else
|
||||||
|
rpm_version="$major.$minor.$micro"
|
||||||
|
fi
|
||||||
|
|
||||||
|
sed -e "s|\(%define version \).*|\1$rpm_version|" \
|
||||||
freeswitch.spec > freeswitch.spec.$$
|
freeswitch.spec > freeswitch.spec.$$
|
||||||
mv freeswitch.spec.$$ freeswitch.spec
|
mv freeswitch.spec.$$ freeswitch.spec
|
||||||
|
|
||||||
|
sed -e "s|\(%define version \).*|\1$rpm_version|" \
|
||||||
|
freeswitch-config-rayo.spec > freeswitch-config-rayo.spec.$$
|
||||||
|
mv freeswitch-config-rayo.spec.$$ freeswitch-config-rayo.spec
|
||||||
|
|
||||||
#%define version 1.5.16
|
#%define version 1.5.16
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
set_fs_release () {
|
||||||
|
local release="$1"
|
||||||
|
if [ -n "$release" ]; then
|
||||||
|
sed -e "s|\(%define release \).*|\1$release|" \
|
||||||
|
freeswitch.spec > freeswitch.spec.$$
|
||||||
|
mv freeswitch.spec.$$ freeswitch.spec
|
||||||
|
|
||||||
|
sed -e "s|\(%define release \).*|\1$release|" \
|
||||||
|
freeswitch-config-rayo.spec > freeswitch-config-rayo.spec.$$
|
||||||
|
mv freeswitch-config-rayo.spec.$$ freeswitch-config-rayo.spec
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
gnuize () {
|
gnuize () {
|
||||||
./bootstrap.sh
|
./bootstrap.sh
|
||||||
mv bootstrap.sh rebootstrap.sh
|
mv bootstrap.sh rebootstrap.sh
|
||||||
|
|
|
@ -1,19 +1,39 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
|
##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*-
|
||||||
|
|
||||||
src_repo="$(pwd)"
|
sdir="."
|
||||||
|
[ -n "${0%/*}" ] && sdir="${0%/*}"
|
||||||
|
. $sdir/common.sh
|
||||||
|
|
||||||
if [ ! -d .git ]; then
|
check_pwd
|
||||||
echo "error: must be run from within the top level of a FreeSWITCH git tree." 1>&2
|
check_input_ver_build $@
|
||||||
exit 1;
|
eval $(parse_version "$1")
|
||||||
|
|
||||||
|
if [ -n "$rev" ]; then
|
||||||
|
dst_name="freeswitch-$cmajor.$cminor.$cmicro.$rev"
|
||||||
|
else
|
||||||
|
dst_name="freeswitch-$cmajor.$cminor.$cmicro"
|
||||||
|
fi
|
||||||
|
dst_parent="/tmp/"
|
||||||
|
dst_dir="/tmp/$dst_name"
|
||||||
|
release="1"
|
||||||
|
if [ $# -gt 1 ]; then
|
||||||
|
release="$2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rpmbuild --define "VERSION_NUMBER $1" \
|
(mkdir -p rpmbuild && cd rpmbuild && mkdir -p SOURCES BUILD BUILDROOT i386 x86_64 SPECS)
|
||||||
--define "BUILD_NUMBER $2" \
|
|
||||||
--define "_topdir %(pwd)/rpmbuild" \
|
cd $src_repo
|
||||||
|
cp -a src_dist/*.spec rpmbuild/SPECS/ || true
|
||||||
|
cp -a src_dist/* rpmbuild/SOURCES/ || true
|
||||||
|
cd rpmbuild/SPECS
|
||||||
|
set_fs_release "$release"
|
||||||
|
cd ../../
|
||||||
|
|
||||||
|
rpmbuild --define "_topdir %(pwd)/rpmbuild" \
|
||||||
--define "_rpmdir %{_topdir}" \
|
--define "_rpmdir %{_topdir}" \
|
||||||
--define "_srcrpmdir %{_topdir}" \
|
--define "_srcrpmdir %{_topdir}" \
|
||||||
-ba freeswitch-config-rayo.spec
|
-ba rpmbuild/SPECS/freeswitch-config-rayo.spec
|
||||||
|
|
||||||
mkdir -p $src_repo/RPMS
|
mkdir -p $src_repo/RPMS
|
||||||
mv $src_repo/rpmbuild/*/freeswitch-config-rayo*.rpm $src_repo/RPMS/.
|
mv $src_repo/rpmbuild/*/freeswitch-config-rayo*.rpm $src_repo/RPMS/.
|
||||||
|
|
|
@ -8,23 +8,34 @@ sdir="."
|
||||||
check_pwd
|
check_pwd
|
||||||
check_input_ver_build $@
|
check_input_ver_build $@
|
||||||
eval $(parse_version "$1")
|
eval $(parse_version "$1")
|
||||||
build="$2"
|
|
||||||
|
|
||||||
|
if [ -n "$rev" ]; then
|
||||||
|
dst_name="freeswitch-$cmajor.$cminor.$cmicro.$rev"
|
||||||
|
else
|
||||||
dst_name="freeswitch-$cmajor.$cminor.$cmicro"
|
dst_name="freeswitch-$cmajor.$cminor.$cmicro"
|
||||||
|
fi
|
||||||
dst_parent="/tmp/"
|
dst_parent="/tmp/"
|
||||||
dst_dir="/tmp/$dst_name"
|
dst_dir="/tmp/$dst_name"
|
||||||
|
release="1"
|
||||||
|
if [ $# -gt 1 ]; then
|
||||||
|
release="$2"
|
||||||
|
fi
|
||||||
|
|
||||||
(mkdir -p rpmbuild && cd rpmbuild && mkdir -p SOURCES BUILD BUILDROOT i386 x86_64 SPECS)
|
(mkdir -p rpmbuild && cd rpmbuild && mkdir -p SOURCES BUILD BUILDROOT i386 x86_64 SPECS)
|
||||||
|
|
||||||
cd $src_repo
|
cd $src_repo
|
||||||
|
cp -a src_dist/*.spec rpmbuild/SPECS/ || true
|
||||||
cp -a src_dist/* rpmbuild/SOURCES/ || true
|
cp -a src_dist/* rpmbuild/SOURCES/ || true
|
||||||
|
cd rpmbuild/SPECS
|
||||||
|
set_fs_release "$release"
|
||||||
|
cd ../../
|
||||||
|
|
||||||
rpmbuild --define "_topdir %(pwd)/rpmbuild" \
|
rpmbuild --define "_topdir %(pwd)/rpmbuild" \
|
||||||
--define "_rpmdir %{_topdir}" \
|
--define "_rpmdir %{_topdir}" \
|
||||||
--define "_srcrpmdir %{_topdir}" \
|
--define "_srcrpmdir %{_topdir}" \
|
||||||
-ba freeswitch.spec
|
-ba rpmbuild/SPECS/freeswitch.spec
|
||||||
|
|
||||||
mkdir $src_repo/RPMS
|
mkdir -p $src_repo/RPMS
|
||||||
mv $src_repo/rpmbuild/*/*.rpm $src_repo/RPMS/.
|
mv $src_repo/rpmbuild/*/*.rpm $src_repo/RPMS/.
|
||||||
|
|
||||||
cat 1>&2 <<EOF
|
cat 1>&2 <<EOF
|
||||||
|
|
|
@ -7,13 +7,16 @@ sdir="."
|
||||||
|
|
||||||
check_pwd
|
check_pwd
|
||||||
version=`cat build/next-release.txt`
|
version=`cat build/next-release.txt`
|
||||||
check_input_ver_build $version
|
if [ $# -gt 0 ]; then
|
||||||
|
version="$version.$1"
|
||||||
|
fi
|
||||||
eval $(parse_version "$version")
|
eval $(parse_version "$version")
|
||||||
if [ -n "$grev" ]; then
|
if [ -n "$grev" ]; then
|
||||||
dst_name="freeswitch-$cmajor.$cminor.$cmicro.$grev"
|
dst_name="freeswitch-$cmajor.$cminor.$cmicro.$grev"
|
||||||
else
|
else
|
||||||
dst_name="freeswitch-$cmajor.$cminor.$cmicro"
|
dst_name="freeswitch-$cmajor.$cminor.$cmicro"
|
||||||
fi
|
fi
|
||||||
|
check_input_ver_build $version
|
||||||
|
|
||||||
#This should be a RAM Drive
|
#This should be a RAM Drive
|
||||||
build_dir="jenkins.$$"
|
build_dir="jenkins.$$"
|
||||||
|
@ -40,11 +43,13 @@ bzip2 -z -k ${dst_name}.tar || echo "bzip2 not available"
|
||||||
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"
|
||||||
zip -r $dst_name.zip $dst_name
|
zip -r $dst_name.zip $dst_name
|
||||||
|
|
||||||
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
|
||||||
mv -f $dst_name.zip ${src_repo}/../src_dist
|
mv -f $dst_name.zip ${src_repo}/../src_dist
|
||||||
|
cp -f ${dst_dir}/freeswitch.spec ${src_repo}/../src_dist
|
||||||
|
cp -f ${dst_dir}/freeswitch-config-rayo.spec ${src_repo}/../src_dist
|
||||||
|
|
||||||
|
rm -rf ${dst_name}.tar $dst_dir
|
||||||
|
|
||||||
cd ${tmp_dir}
|
cd ${tmp_dir}
|
||||||
ls -al
|
ls -al
|
||||||
|
|
Loading…
Reference in New Issue