2019-02-04 08:55:46 -05:00
|
|
|
#!/bin/bash
|
|
|
|
|
2019-02-11 08:54:33 -05:00
|
|
|
# Make sure you have built RetroShare at list once from the same source tree,
|
|
|
|
# so the support libs get ingluded in the source tarball
|
|
|
|
|
2019-02-04 08:55:46 -05:00
|
|
|
## 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"
|
2019-02-11 08:54:33 -05:00
|
|
|
define_default_value WORK_DIR "/tmp/"
|
2019-02-04 08:55:46 -05:00
|
|
|
|
2019-02-11 08:54:33 -05:00
|
|
|
ORIG_DIR="$(pwd)"
|
2019-02-04 08:55:46 -05:00
|
|
|
|
2019-02-11 08:54:33 -05:00
|
|
|
[ "$(ls "${GIT_DIR}/../supportlibs/restbed/" | wc -l)" -lt "5" ] &&
|
|
|
|
{
|
|
|
|
cat << EOF
|
|
|
|
WARNING: supportlibs/restbed/ seems have not been checked out!
|
|
|
|
The produced tarball may not be suitable to build RetroShare JSON API
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
cd "${WORK_DIR}"
|
|
|
|
rsync -a --delete \
|
|
|
|
--exclude='.git' \
|
|
|
|
--filter=':- build_scripts/OBS/.gitignore' \
|
|
|
|
"${GIT_DIR}/../" RetroShare/
|
2019-02-04 08:55:46 -05:00
|
|
|
git describe > RetroShare/Source_Version
|
2019-02-11 08:54:33 -05:00
|
|
|
tar -zcf RetroShare.tar.gz RetroShare/
|
|
|
|
|
2019-02-04 08:55:46 -05:00
|
|
|
cat RetroShare/Source_Version
|
|
|
|
md5sum RetroShare.tar.gz
|
|
|
|
wc -c RetroShare.tar.gz
|
2019-02-11 08:54:33 -05:00
|
|
|
mv RetroShare.tar.gz "${ORIG_DIR}/RetroShare.tar.gz"
|
|
|
|
|