Skip to content

Commit 6fafce5

Browse files
committed
Try to build a reproducible zip file instead of a tarball
1 parent ae9ab8d commit 6fafce5

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Makefile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,16 @@ dist/snooty/.EXISTS:
4747

4848
touch $@
4949

50-
dist/snooty-${VERSION}-${PLATFORM}.tar.bz2: snooty/rstspec.toml dist/snooty/.EXISTS ## Build a binary tarball
51-
tar -cjf $@ -C dist snooty
50+
dist/snooty-${VERSION}-${PLATFORM}.zip: snooty/rstspec.toml dist/snooty/.EXISTS ## Build a binary tarball
51+
# Normalize the mtime, and zip in sorted order
52+
find dist/snooty -exec touch -t "$$(date -jf '%s' '+%Y%m%d%H%M.%S' $$SOURCE_DATE_EPOCH)" {} +
53+
cd dist && find snooty -print | sort | zip -X ../$@ -@
5254

53-
dist/snooty-${VERSION}-${PLATFORM}.tar.bz2.asc: dist/snooty-${VERSION}-${PLATFORM}.tar.bz2 ## Build and sign a binary tarball
55+
dist/snooty-${VERSION}-${PLATFORM}.zip.asc: dist/snooty-${VERSION}-${PLATFORM}.zip ## Build and sign a binary tarball
5456
gpg --armor --detach-sig $^
5557

5658
clean: ## Remove all build artifacts
57-
-rm -r snooty.tar.bz2* snooty.py .venv
59+
-rm -r snooty.tar.zip* snooty.py .venv
5860
-rm -rf dist
5961

6062
flit-publish: test ## Deploy the package to pypi

0 commit comments

Comments
 (0)