+# Create a mtree spec file that can be used to get a reproducible tar ball
+mtree-spec:
+ $(LN) -s `pwd` ../privoxy-$(VERSION)-$(CODE_STATUS)
+ $(ECHO) "#mtree 2.0" > $(MTREE_SPEC_FILE)
+ for i in `find . -type f -a -not \( -path "*/CVS*" -o -name ".*" \
+ -o -path "*/debian/*" -o -path "*/actions/*" -o -name "*.php" -o \
+ -name "PACKAGERS" -o -path "*.git/*" -o -name "*.spec" \) | env -i sort`; do \
+ $(ECHO) "privoxy-$(VERSION)-$(CODE_STATUS)/$$i time=$(SOURCE_DATE_EPOCH) type=file uname=privoxy gname=privoxy mode=0555"; \
+ done >> $(MTREE_SPEC_FILE)
+ $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS)
+
+# Create a reproducible tarball.
+# Requires a tar implementation with mtree support.
+reproducible-tarball-dist: dist-check clean clobber mtree-spec
+ $(LN) -s `pwd` ../privoxy-$(VERSION)-$(CODE_STATUS)
+
+ $(TAR) cvhf privoxy-$(VERSION)-$(CODE_STATUS)-src.tar -C .. @privoxy-$(VERSION)-$(CODE_STATUS)/$(MTREE_SPEC_FILE)
+ $(GZIP_PROG) -n privoxy-$(VERSION)-$(CODE_STATUS)-src.tar
+ $(RM) ../privoxy-$(VERSION)-$(CODE_STATUS) $(MTREE_SPEC_FILE)
+ @$(ECHO) Reproducible tarball distribution created.
+