]> Sergey Matveev's repositories - public-inbox.git/blobdiff - Documentation/include.mk
doc: avoid needless rebuilds of NEWS
[public-inbox.git] / Documentation / include.mk
index f2605346ad495b9fb16d8f7799da007ef80a4ad8..3d88fcec29bd85e0eb8cb9ef663e2edff9aa7db2 100644 (file)
@@ -62,12 +62,7 @@ Documentation/standards.txt : Documentation/standards.perl
        touch -r Documentation/standards.perl $@+
        mv $@+ $@
 
-RELEASES =
-RELEASES += v1.2.0
-RELEASES += v1.1.0-pre1
-RELEASES += v1.0.0
-
-NEWS NEWS.atom NEWS.html : Documentation/include.mk
+NEWS NEWS.atom NEWS.html : $(news_deps)
        $(PERL) -I lib -w Documentation/mknews.perl $@ $(RELEASES)
 
 # check for internal API changes:
@@ -109,15 +104,14 @@ clean-doc:
 clean :: clean-doc
 
 # No camel-cased tarballs or pathnames which MakeMaker creates,
-# this may not always be a Perl project.
-git-dist :: ver = $(shell git describe |sed -ne 's/v//p')
-git-dist :: pkgpfx := public-inbox-$(ver)
-git-dist :: NEWS
-       git archive --prefix=$(pkgpfx)/ --format=tar HEAD^{tree} >$(pkgpfx).tar
-       mkdir -p $(pkgpfx)
-       cp NEWS $(pkgpfx)/NEWS
-       $(TAR) rf $(pkgpfx).tar $(pkgpfx)/NEWS
-       $(RM) $(pkgpfx)/NEWS
-       rmdir $(pkgpfx)
-       gzip -9 $(pkgpfx).tar
-       @echo $(pkgpfx).tar.gz created
+# this may not always be a Perl project.  This should match what
+# cgit generate, since git maintainers ensure git-archive has
+# stable tar output
+DIST_TREE = HEAD^{tree}
+DIST_VER =
+git-dist :
+       ver=$$(git describe $(DIST_VER) | sed -ne s/v//p); \
+       pkgpfx=public-inbox-$$ver; \
+       git archive --prefix=$$pkgpfx/ --format=tar $(DIST_TREE) \
+               | gzip -n >$$pkgpfx.tar.gz; \
+       echo $$pkgpfx.tar.gz created