#!/bin/bash
# Quick script to generate source tarball for Debian and RPMs from a tag.
# It is run from the root of the git repository and places the tarballs
# in the parent directory.
if [ -z ${1} ]; then
    echo Usage: $(basename $0) version \# example version: 2.1.1
    exit 1
fi
version=$1
# Debian tarball
git archive --prefix=blahp-${version}/ --out ../blahp_${version}.orig.tar.gz v${version}
# RPM tarball
ln ../blahp_${version}.orig.tar.gz ../blahp-${version}.tar.gz
