diff --git a/dist/redhat/build_rpm.sh b/dist/redhat/build_rpm.sh index 5df7607..6135f08 100755 --- a/dist/redhat/build_rpm.sh +++ b/dist/redhat/build_rpm.sh @@ -76,5 +76,12 @@ SCYLLA_RELEASE=$(cat build/SCYLLA-RELEASE-FILE) git archive --format=tar --prefix=scylla-jmx-$SCYLLA_VERSION/ HEAD -o build/scylla-jmx-$VERSION.tar pystache dist/redhat/scylla-jmx.spec.mustache "{ \"version\": \"$SCYLLA_VERSION\", \"release\": \"$SCYLLA_RELEASE\" }" > build/scylla-jmx.spec +# mock generates files owned by root, fix this up +fix_ownership() { + sudo chown "$(id -u):$(id -g)" -R "$@" +} + sudo mock --buildsrpm --root=$TARGET --resultdir=`pwd`/build/srpms --spec=build/scylla-jmx.spec --sources=build/scylla-jmx-$VERSION.tar +fix_ownership build/srpms sudo mock --rebuild --root=$TARGET --resultdir=`pwd`/build/rpms build/srpms/scylla-jmx-$VERSION*.src.rpm +fix_ownership build/rpms