diff --git a/scripts/create_release_tarball.sh b/scripts/create_release_tarball.sh index 3a234eba8..2ad9ca70a 100755 --- a/scripts/create_release_tarball.sh +++ b/scripts/create_release_tarball.sh @@ -24,6 +24,24 @@ if [ -z ${TAG:-} ];then esac fi +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} +} + TMPDIR=$(mktemp -d -t release-${TAG}-XXXXXXXXXX) run git archive --prefix=freerdp-${TAG}/ --format=tar.gz -o ${TMPDIR}/freerdp-${TAG}.tar.gz ${TAG} @@ -32,18 +50,16 @@ run echo ${TAG} > ${TMPDIR}/freerdp-${TAG}/.source_version pushd . cd $TMPDIR -run tar czvf freerdp-${TAG}.tar.gz freerdp-${TAG} -run md5sum freerdp-${TAG}.tar.gz > freerdp-${TAG}.tar.gz.md5 -run sha1sum freerdp-${TAG}.tar.gz > freerdp-${TAG}.tar.gz.sha1 -run sha256sum freerdp-${TAG}.tar.gz > freerdp-${TAG}.tar.gz.sha256 +create_tar czf .tar.gz ${TAG} +create_tar cvjSf .tar.bz2 ${TAG} +create_tar cfJ .tar.xz ${TAG} -run zip -r freerdp-${TAG}.zip freerdp-${TAG} -run md5sum freerdp-${TAG}.zip > freerdp-${TAG}.zip.md5 -run sha1sum freerdp-${TAG}.zip > freerdp-${TAG}.zip.sha1 -run sha256sum freerdp-${TAG}.zip > freerdp-${TAG}.zip.sha256 +ZIPNAME=freerdp-${TAG}.zip +run zip -r ${ZIPNAME} freerdp-${TAG} +create_hash ${ZIPNAME} popd -run mv ${TMPDIR}/freerdp-${TAG}.tar.gz* . +run mv ${TMPDIR}/freerdp-${TAG}.tar* . run mv ${TMPDIR}/freerdp-${TAG}.zip* . run rm -rf ${TMPDIR} exit 0