# Note: GNUmakefile is built automatically from GNUmakefile.in
#
-# $Id: GNUmakefile.in,v 1.259 2017/05/04 14:35:02 fabiankeil Exp $
+# $Id: GNUmakefile.in,v 1.260 2017/05/20 09:27:07 fabiankeil Exp $
#
# Written by and Copyright (C) 2001-2017 members of the
# Privoxy team. https://www.privoxy.org/
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_POINT)
SNAPVERSION = $(VERSION)-$(shell date "+%Y%m%d")
+SOURCE_DATE_EPOCH = @SOURCE_DATE_EPOCH@
+MTREE_SPEC_FILE = privoxy-$(VERSION)-$(CODE_STATUS).spec
#############################################################################
# "make install" directories and variables
$(GZIP_PROG) ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar
@$(ECHO) Tarball distribution created.
+# 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.
+
# anonymously ncftps the tarball to sourceforge
tarball-upload:
ncftpput -u anonymous -p ijbswa-developers@lists.sourceforge.net upload.sourceforge.net /incoming ../privoxy-$(VERSION)-$(CODE_STATUS)-src.tar.gz