Add script to prepare OBS source tarball

This commit is contained in:
Gioacchino Mazzurco 2019-02-04 14:55:46 +01:00
parent 04db4b0f24
commit b46fb73f20
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051

View File

@ -0,0 +1,24 @@
#!/bin/sh
#!/bin/bash
## Define default value for variable, take two arguments, $1 variable name,
## $2 default variable value, if the variable is not already define define it
## with default value.
function define_default_value()
{
VAR_NAME="${1}"
DEFAULT_VALUE="${2}"
[ -z "${!VAR_NAME}" ] && export ${VAR_NAME}="${DEFAULT_VALUE}"
}
define_default_value GIT_DIR "${HOME}/Development/rs-develop/.git"
rsync -aPh --delete --exclude='.git' "${GIT_DIR}/../" RetroShare/
git describe > RetroShare/Source_Version
tar -zcvf RetroShare.tar.gz RetroShare/
cat RetroShare/Source_Version
md5sum RetroShare.tar.gz
wc -c RetroShare.tar.gz