]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
buildpackages: ensure spec file has correct tarball name
authorNathan Cutler <ncutler@suse.com>
Fri, 2 Mar 2018 21:01:17 +0000 (22:01 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@suse.com>
Mon, 14 Oct 2019 14:47:01 +0000 (16:47 +0200)
We are using this script to build various versions of ceph.spec.in, which do
various things for different build environments. Ignore whatever the spec file
is trying to do with the tarball name and force it to the name of the tarball
at hand.

Signed-off-by: Nathan Cutler <ncutler@suse.com>
teuthology/task/buildpackages/make-rpm.sh

index 6830957d3b01d5d4d9652fe6dfe80abe6a1cffa5..d2686a2814badc19944db9bb017e8a73037d4b84 100755 (executable)
@@ -117,10 +117,6 @@ function build_package() {
         make dist-bzip2
     else
         # kraken and above
-        if [ "$suse" = true ]; then
-            sed -i -e 's/^%autosetup -p1$/%autosetup -p1 -n @TARBALL_BASENAME@/' \
-                ceph.spec.in
-        fi
         ./make-dist
     fi
     # Set up build area
@@ -138,6 +134,7 @@ function build_package() {
     mkdir -p ${buildarea}/RPMS
     mkdir -p ${buildarea}/BUILD
     CEPH_TARBALL=( ceph-*.tar.bz2 )
+    CEPH_TARBALL_BASE=$(echo $CEPH_TARBALL | sed -e 's/.tar.bz2$//')
     cp -a $CEPH_TARBALL ${buildarea}/SOURCES/.
     cp -a rpm/*.patch ${buildarea}/SOURCES || true
     (
@@ -149,8 +146,11 @@ function build_package() {
                  -e 's/%bcond_with ceph_test_package/%bcond_without ceph_test_package/g' \
                  -e '0,/^Release:/s/.<B_CNT>//' \
                  -e '/^Source9/d' \
+                 -e "0,/^Source0:/s/Source0:.*/Source0: $CEPH_TARBALL/" \
+                 -e "s/^%autosetup -p1.*/%autosetup -p1 -n $CEPH_TARBALL_BASE/g" \
                  ceph.spec
         fi
+        cat ceph.spec
         buildarea=`readlink -fn ${releasedir}`   ### rpm wants absolute path
         PATH=$ccache:$PATH rpmbuild -ba --nosignature \
           --define '_srcdefattr (-,root,root)' \