From 6f13748800df35d8976e0b347412b6eca982b051 Mon Sep 17 00:00:00 2001 From: Ken Rice Date: Mon, 9 Feb 2015 12:19:31 -0600 Subject: [PATCH] Tweaks for building packages --- build/next-release.txt | 2 +- freeswitch.spec | 4 ++-- scripts/ci/common.sh | 14 +++++++++++--- scripts/ci/rpmbuilder.sh | 9 +-------- scripts/ci/src_tarball.sh | 6 ++++-- 5 files changed, 19 insertions(+), 16 deletions(-) diff --git a/build/next-release.txt b/build/next-release.txt index d0149fef74..0ed0610841 100644 --- a/build/next-release.txt +++ b/build/next-release.txt @@ -1 +1 @@ -1.3.4 +1.5.16 diff --git a/freeswitch.spec b/freeswitch.spec index 69100bcbc4..a24d1ff45d 100644 --- a/freeswitch.spec +++ b/freeswitch.spec @@ -45,8 +45,8 @@ %{?with_timerfd:%define build_timerfd 1 } %{?with_mod_esl:%define build_mod_esl 1 } -%define version %{VERSION_NUMBER} -%define release %{BUILD_NUMBER} +%define version 1.5.16 +%define release 1 ###################################################################################################################### # diff --git a/scripts/ci/common.sh b/scripts/ci/common.sh index d317541ca2..535044ca18 100755 --- a/scripts/ci/common.sh +++ b/scripts/ci/common.sh @@ -2,7 +2,7 @@ ##### -*- mode:shell-script; indent-tabs-mode:nil; sh-basic-offset:2 -*- src_repo="$(pwd)" -tmp_dir=${TMP_DIR:="/tmp"} +tmp_dir=${TMP_DIR:=".."} zgrep () { (echo "$2" | grep -e "$1" >/dev/null); } @@ -99,10 +99,11 @@ parse_version () { set_fs_ver () { local ver="$1" major="$2" minor="$3" micro="$4" rev="$5" hrev="$6" - sed -e "s|\(AC_SUBST(SWITCH_VERSION_MAJOR, \[\).*\(\])\)|\1$major\2|" \ + 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|" \ + -e "s|\(AC_INIT(\[freeswitch\], \[\).*\(\], bugs@freeswitch.org)\)|\1$ver\2|" \ configure.ac > configure.ac.$$ mv configure.ac.$$ configure.ac if [ -n "$rev" ]; then @@ -114,6 +115,13 @@ set_fs_ver () { configure.ac > configure.ac.$$ mv configure.ac.$$ configure.ac fi + + sed -e "s|\(%define version \).*|\1$major.$minor.$micro|" \ + freeswitch.spec > freeswitch.spec.$$ + mv freeswitch.spec.$$ freeswitch.spec + +#%define version 1.5.16 + } gnuize () { diff --git a/scripts/ci/rpmbuilder.sh b/scripts/ci/rpmbuilder.sh index 8d633d6d80..894d28e162 100755 --- a/scripts/ci/rpmbuilder.sh +++ b/scripts/ci/rpmbuilder.sh @@ -19,18 +19,11 @@ dst_dir="/tmp/$dst_name" cd $src_repo cp -a src_dist/* rpmbuild/SOURCES/ || true -rpmbuild --define "VERSION_NUMBER $cver" \ - --define "BUILD_NUMBER $build" \ - --define "_topdir %(pwd)/rpmbuild" \ +rpmbuild --define "_topdir %(pwd)/rpmbuild" \ --define "_rpmdir %{_topdir}" \ --define "_srcrpmdir %{_topdir}" \ -ba freeswitch.spec -# --define '_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm' \ -# --define "_sourcedir %{_topdir}" \ -# --define "_builddir %{_topdir}" \ - - mkdir $src_repo/RPMS mv $src_repo/rpmbuild/*/*.rpm $src_repo/RPMS/. diff --git a/scripts/ci/src_tarball.sh b/scripts/ci/src_tarball.sh index 82c970bced..d9bead19ae 100755 --- a/scripts/ci/src_tarball.sh +++ b/scripts/ci/src_tarball.sh @@ -6,14 +6,16 @@ sdir="." . $sdir/common.sh check_pwd -check_input_ver_build $@ -eval $(parse_version "$1") +version=`cat build/next-release.txt` +check_input_ver_build $version +eval $(parse_version "$version") if [ -n "$grev" ]; then dst_name="freeswitch-$cmajor.$cminor.$cmicro.$grev" else dst_name="freeswitch-$cmajor.$cminor.$cmicro" fi +#This should be a RAM Drive dst_dir="${tmp_dir}/jenkins.$$/$dst_name" if [ -d "$dst_dir" ]; then