2020-05-21 12:08:26 +03:00
|
|
|
#!/bin/bash -e
|
|
|
|
|
2020-05-25 20:30:11 +03:00
|
|
|
function run {
|
|
|
|
"$@"
|
|
|
|
RES=$?
|
|
|
|
if [[ $RES -ne 0 ]];
|
|
|
|
then
|
2020-06-23 10:32:19 +03:00
|
|
|
echo "[ERROR] $@ returned $RES" >&2
|
2020-05-25 20:30:11 +03:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2020-05-21 12:08:26 +03:00
|
|
|
if [ -z ${TAG:-} ];then
|
|
|
|
echo "No TAG set - trying to detect"
|
|
|
|
TAG=$(git describe --tags)
|
|
|
|
echo "Is the TAG ${TAG} ok (YES|NO)?"
|
|
|
|
read answ
|
|
|
|
case "$answ" in
|
|
|
|
YES):
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo 'stopping here'
|
|
|
|
exit 1
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2023-12-22 12:22:25 +03:00
|
|
|
function create_hash {
|
|
|
|
NAME=$1
|
|
|
|
run md5sum ${NAME} > ${NAME}.md5
|
|
|
|
run sha1sum ${NAME} > ${NAME}.sha1
|
|
|
|
run sha256sum ${NAME} > ${NAME}.sha256
|
|
|
|
run sha512sum ${NAME} > ${NAME}.sha512
|
|
|
|
}
|
|
|
|
|
|
|
|
function create_tar {
|
|
|
|
ARGS=$1
|
|
|
|
EXT=$2
|
|
|
|
TAG=$3
|
|
|
|
|
|
|
|
NAME=freerdp-${TAG}${EXT}
|
|
|
|
run tar $ARGS ${NAME} freerdp-${TAG}
|
|
|
|
create_hash ${NAME}
|
|
|
|
}
|
|
|
|
|
2020-05-21 12:08:26 +03:00
|
|
|
TMPDIR=$(mktemp -d -t release-${TAG}-XXXXXXXXXX)
|
|
|
|
|
2020-05-25 20:30:11 +03:00
|
|
|
run git archive --prefix=freerdp-${TAG}/ --format=tar.gz -o ${TMPDIR}/freerdp-${TAG}.tar.gz ${TAG}
|
|
|
|
run tar xzvf ${TMPDIR}/freerdp-${TAG}.tar.gz -C ${TMPDIR}
|
|
|
|
run echo ${TAG} > ${TMPDIR}/freerdp-${TAG}/.source_version
|
|
|
|
|
2020-05-21 12:08:26 +03:00
|
|
|
pushd .
|
|
|
|
cd $TMPDIR
|
2023-12-22 12:22:25 +03:00
|
|
|
create_tar czf .tar.gz ${TAG}
|
|
|
|
create_tar cvjSf .tar.bz2 ${TAG}
|
|
|
|
create_tar cfJ .tar.xz ${TAG}
|
|
|
|
|
|
|
|
ZIPNAME=freerdp-${TAG}.zip
|
|
|
|
run zip -r ${ZIPNAME} freerdp-${TAG}
|
|
|
|
create_hash ${ZIPNAME}
|
2020-05-21 12:08:26 +03:00
|
|
|
popd
|
2020-05-25 20:30:11 +03:00
|
|
|
|
2023-12-22 12:22:25 +03:00
|
|
|
run mv ${TMPDIR}/freerdp-${TAG}.tar* .
|
2020-05-25 20:30:11 +03:00
|
|
|
run mv ${TMPDIR}/freerdp-${TAG}.zip* .
|
|
|
|
run rm -rf ${TMPDIR}
|
2020-05-21 12:08:26 +03:00
|
|
|
exit 0
|