summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2019-11-07 13:24:43 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2019-11-07 13:24:43 +0000
commitf04a2ee34b28a38c4349ef1f94686a07afce730f (patch)
tree2aaddf2dce0fd1e26e3c792d05a2b04a5461cfad
parent672032a4be46b385da7ac631f688ffaea8ab29bd (diff)
downloadabuild-f04a2ee34b28a38c4349ef1f94686a07afce730f.tar.gz
abuild-f04a2ee34b28a38c4349ef1f94686a07afce730f.tar.bz2
abuild-f04a2ee34b28a38c4349ef1f94686a07afce730f.tar.xz
abuild-f04a2ee34b28a38c4349ef1f94686a07afce730f.zip
abuild: make built package reproducible
Flags to make the tarball reproducible is taken from here: http://h2.jaguarpaw.co.uk/posts/reproducible-tar/
-rw-r--r--abuild.in14
1 files changed, 11 insertions, 3 deletions
diff --git a/abuild.in b/abuild.in
index a7ece85..db94445 100644
--- a/abuild.in
+++ b/abuild.in
@@ -1565,7 +1565,11 @@ create_apks() {
# normalize timestamps
find . -exec touch -h -d "@$SOURCE_DATE_EPOCH" {} +
- tar --xattrs -f - -c "$@" | abuild-tar --hash | $gzip -9 >"$dir"/data.tar.gz
+ tar --xattrs \
+ --format=posix \
+ --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime,delete=mtime \
+ --mtime="@${SOURCE_DATE_EPOCH}" \
+ -f - -c "$@" | abuild-tar --hash | $gzip -n -9 >"$dir"/data.tar.gz
msg "Create checksum..."
# append the hash for data.tar.gz
@@ -1575,8 +1579,12 @@ create_apks() {
# control.tar.gz
cd "$dir"
- tar -f - -c $(cat "$dir"/.metafiles) | abuild-tar --cut \
- | $gzip -9 > control.tar.gz
+ tar \
+ --format=posix \
+ --pax-option=exthdr.name=%d/PaxHeaders/%f,delete=atime,delete=ctime,delete=mtime \
+ --mtime="@${SOURCE_DATE_EPOCH}" \
+ -f - -c $(cat "$dir"/.metafiles) | abuild-tar --cut \
+ | $gzip -n -9 > control.tar.gz
abuild-sign -q control.tar.gz || exit 1
msg "Create $apk"