summaryrefslogtreecommitdiffstats
path: root/dist.sh
diff options
context:
space:
mode:
authorArnstein Ressem <aressem@oath.com>2019-02-13 11:41:32 +0000
committerArnstein Ressem <aressem@oath.com>2019-02-13 11:41:32 +0000
commiteac50d29ec62337798c9da91feef0a8e725ebe90 (patch)
tree18b2567142d8ba61820fcf44670a574e2f3191e5 /dist.sh
parentb9869d95dd4d80e23f15d610756924aaa12ea28b (diff)
Pick up vespa.spec from source root when building from tags. Copr requires spec file to be at the source root to properly build. This solution allows to build from both HEAD and tag.
Diffstat (limited to 'dist.sh')
-rwxr-xr-xdist.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/dist.sh b/dist.sh
index ae4cce08a99..aee7a20c8fe 100755
--- a/dist.sh
+++ b/dist.sh
@@ -10,4 +10,11 @@ VERSION="$1"
mkdir -p ~/rpmbuild/{SOURCES,SPECS}
GZIP=-1 tar -zcf ~/rpmbuild/SOURCES/vespa-$VERSION.tar.gz --exclude target --exclude cmake-build-debug --transform "flags=r;s,^,vespa-$VERSION/," *
-sed -e "s,_VESPA_VERSION_,$VERSION," < dist/vespa.spec > ~/rpmbuild/SPECS/vespa-$VERSION.spec
+
+DIST_FILE="dist/vespa.spec"
+# When checking out relase tags, the vespa.spec is in the source root folder. This is a workaround to be able to build rpms from a release tag.
+if [ ! -e "$DIST_FILE" ]; then
+ DIST_FILE="vespa.spec"
+fi
+
+sed -e "s,_VESPA_VERSION_,$VERSION," < "$DIST_FILE" > ~/rpmbuild/SPECS/vespa-$VERSION.spec