From 65590aa039a9c14933a16654e26fcf47e8420199 Mon Sep 17 00:00:00 2001 From: Nathan Cutler Date: Tue, 23 Aug 2016 11:34:04 +0200 Subject: [PATCH] buildpackages: make make-{deb,rpm}.sh aware of cmake Fixes: http://tracker.ceph.com/issues/16819 Signed-off-by: Ricardo Dias Signed-off-by: Nathan Cutler --- tasks/buildpackages/make-deb.sh | 54 +++++++++++++++++++-------------- tasks/buildpackages/make-rpm.sh | 29 +++++++++++++----- 2 files changed, 53 insertions(+), 30 deletions(-) diff --git a/tasks/buildpackages/make-deb.sh b/tasks/buildpackages/make-deb.sh index db9df06ffb525..1e5600e7cfe09 100755 --- a/tasks/buildpackages/make-deb.sh +++ b/tasks/buildpackages/make-deb.sh @@ -64,32 +64,40 @@ function build_package() { # included in the distribution. # git clean -qdxff - # - # creating the distribution tarbal requires some configure - # options (otherwise parts of the source tree will be left out). - # - ./autogen.sh - # Building with LTTNG on Ubuntu Precise is not possible. - # It fails the LTTNG-is-sane check (it misses headers) - # And the Debian rules files leave it out anyway - case $codename in - precise) lttng_opt="--without-lttng" ;; - *) lttng_opt="--with-lttng" ;; - esac - ./configure $(flavor2configure $flavor) \ - --with-rocksdb --with-ocf \ - --with-nss --with-debug --enable-cephfs-java \ - $lttng_opt --with-babeltrace - # - # use distdir= to set the name of the top level directory of the - # tarbal to match the desired version - # - make distdir=ceph-$vers dist + + fileext="gz" + # autotools only works in jewel and below + if [[ ! -e "make-dist" ]] ; then + # + # creating the distribution tarbal requires some configure + # options (otherwise parts of the source tree will be left out). + # + ./autogen.sh + # Building with LTTNG on Ubuntu Precise is not possible. + # It fails the LTTNG-is-sane check (it misses headers) + # And the Debian rules files leave it out anyway + case $codename in + precise) lttng_opt="--without-lttng" ;; + *) lttng_opt="--with-lttng" ;; + esac + ./configure $(flavor2configure $flavor) \ + --with-rocksdb --with-ocf \ + --with-nss --with-debug --enable-cephfs-java \ + $lttng_opt --with-babeltrace + # + # use distdir= to set the name of the top level directory of the + # tarbal to match the desired version + # + make distdir=ceph-$vers dist + else + ./make-dist + fileext="bz2" + fi # # rename the tarbal to match debian conventions and extract it # - mv ceph-$vers.tar.gz $releasedir/ceph_$vers.orig.tar.gz - tar -C $releasedir -zxf $releasedir/ceph_$vers.orig.tar.gz + mv ceph-$vers.tar.$fileext $releasedir/ceph_$vers.orig.tar.$fileext + tar -C $releasedir -xf $releasedir/ceph_$vers.orig.tar.$fileext # # copy the debian directory over # diff --git a/tasks/buildpackages/make-rpm.sh b/tasks/buildpackages/make-rpm.sh index f44efc432076f..6e566a347dff8 100755 --- a/tasks/buildpackages/make-rpm.sh +++ b/tasks/buildpackages/make-rpm.sh @@ -91,13 +91,28 @@ function build_package() { else sudo yum install -y bzip2 fi - ./autogen.sh - ./configure $(flavor2configure $flavor) --with-debug --with-radosgw --with-fuse --with-libatomic-ops --with-gtk2 --with-nss - # - # use distdir= to set the name of the top level directory of the - # tarbal to match the desired version - # - make dist-bzip2 + # autotools only works in jewel and below + if [[ ! -e "make-dist" ]] ; then + ./autogen.sh + ./configure $(flavor2configure $flavor) --with-debug --with-radosgw --with-fuse --with-libatomic-ops --with-gtk2 --with-nss + + # + # use distdir= to set the name of the top level directory of the + # tarbal to match the desired version + # + make dist-bzip2 + else + ## + # make-dist script suffixes the tarball with full version info, + # these transformations change version info to only include + # version number as is required by the ceph.spec file + # + cat make-dist \ + | sed -e '0,/^outfile=/s//ver=`echo $version | cut -d - -f 1-1`\n&/' \ + | sed -e 's/^\(outfile="ceph-$ver\)sion"/\1"/g' \ + -e 's/\(--prefix ceph-$ver\)sion/\1/g' \ + | sh + fi # Set up build area setup_rpmmacros if [ "$suse" = true ] ; then -- 2.39.5