#!/bin/sh
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

if [ -z "$1" ]; then
  echo "Usage: $0 VERSION" 2>&1
  exit 1
fi

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/," *

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

#!/bin/sh
# Copyright 2017 Yahoo Holdings. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.

if [ -z "$1" ]; then
  echo "Usage: $0 VERSION" 2>&1
  exit 1
fi

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/," * .*

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

Add the .git repo to the tarball as we now depend on the git info in the build scripts.
Add the .git repo to the tarball as we now depend on the git info in the build scripts.
