+ -e 's|[@]bindir@|'\''$(bindir)'\''|g' \
+ -e 's|[@]VERSION@|$(VERSION)|g' \
+ $(srcdir)/$@.in >$@-t \
+ && chmod a+x $@-t \
+ && mv $@-t $@
+
+# Arrange so that .tarball-version appears only in the distribution
+# tarball, and never in a checked-out repository.
+dist-hook: gen-ChangeLog
+ $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
+
+gen_start_date = 2008-01-01
+.PHONY: gen-ChangeLog
+gen-ChangeLog:
+ $(AM_V_GEN)if test -d .git; then \
+ $(top_srcdir)/build-aux/gitlog-to-changelog \
+ --since=$(gen_start_date) > $(distdir)/cl-t; \
+ rm -f $(distdir)/ChangeLog; \
+ mv $(distdir)/cl-t $(distdir)/ChangeLog; \
+ fi
+
+# A simple test, just of gzip -- more of a sanity check than anything else.
+FILES_TO_CHECK = $(bin_SCRIPTS) \
+ $(top_srcdir)/ChangeLog $(top_srcdir)/configure $(top_srcdir)/gzip.c
+check-local: $(FILES_TO_CHECK) $(bin_PROGRAMS) gzip.doc.gz
+ { test '$(srcdir)' != . || ./zdiff --__bindir . -c gzip.doc.gz; }
+ ./zdiff --__bindir . -c $(srcdir)/gzip.doc $(srcdir)/gzip.doc
+ ./zdiff --__bindir . $(srcdir)/gzip.doc gzip.doc.gz
+ ./zdiff --__bindir . -c - $(srcdir)/gzip.doc <gzip.doc.gz
+ ./zdiff --__bindir . -c gzip.doc.gz gzip.doc.gz
+ ./zgrep --__bindir . -iV >/dev/null
+ for file in $(FILES_TO_CHECK); do \
+ ./gzip -cv -- "$$file" | ./gzip -d | cmp - "$$file" || exit 1; \
+ done
+ @echo 'Test succeeded.'