summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Martin <jxm@risingtidesystems.com>2011-09-22 12:36:22 +0200
committerJerome Martin <jxm@risingtidesystems.com>2011-09-22 12:37:09 +0200
commitb03ec79f3654cc790d216d24e9ec69795c486df7 (patch)
treebb3bc168497b351f44d1882e1c13c325b3abcab5
parent95cdcb7dd669d840d14bd099d68fce4dcdc9cc64 (diff)
downloadtargetcli-b03ec79f3654cc790d216d24e9ec69795c486df7.tar.gz
Normalized release archive generation.
* Now using gzip -n to compress the release tarball. * Forcing gzip compression level to 6. * Setting the timestamp for all files in the archive to the last commit's one. * Feeding a sorted list of files to tar. * Forcing numerid UIDs in tarball and original owner/group to be uid 0. * Forcing gnu archive format. * Forcing blocking factor. * Forcing name quoting style. * Preserves git archive permissions.
-rw-r--r--Makefile11
1 files changed, 9 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 8e0c53d..314457a 100644
--- a/Makefile
+++ b/Makefile
@@ -56,7 +56,7 @@ build/release-stamp:
@mkdir -p build
@echo "Exporting the repository files..."
@git archive ${GIT_BRANCH} --prefix ${NAME}-${VERSION}/ \
- | (cd build; tar xf -)
+ | (cd build; tar xfp -)
@echo "Cleaning up the target tree..."
@rm -f build/${NAME}-${VERSION}/Makefile
@rm -f build/${NAME}-${VERSION}/.gitignore
@@ -101,8 +101,15 @@ build/release-stamp:
echo " -- $${author} $${date}"; \
echo ; \
done > build/${NAME}-${VERSION}/debian/changelog
+ @find build/${NAME}-${VERSION}/ -exec \
+ touch -t $$(date -d @$$(git show -s --format="format:%at") \
+ +"%Y%m%d%H%M.%S") {} \;
@mkdir -p dist
- @cd build; tar zcf ../dist/${NAME}-${VERSION}.tar.gz ${NAME}-${VERSION}
+ @cd build; tar -c --owner=0 --group=0 --numeric-owner \
+ --format=gnu -b20 --quoting-style=escape \
+ -f ../dist/${NAME}-${VERSION}.tar \
+ $$(find ${NAME}-${VERSION} -type f | sort)
+ @gzip -6 -n dist/${NAME}-${VERSION}.tar
@echo "Generated release tarball:"
@echo " $$(ls dist/${NAME}-${VERSION}.tar.gz)"
@touch build/release-stamp