From a4d03bbcdaf7739d7e9073ee76bb186f68ddc163 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Tue, 3 Nov 2009 21:28:10 +0000
Subject: [PATCH] Build bzip2 tarball in dist target as well

---
 GNUmakefile.in         | 10 ++++++----
 src/Makefile.global.in |  6 +++---
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/GNUmakefile.in b/GNUmakefile.in
index 34a8bd15b78..d934b19d951 100644
--- a/GNUmakefile.in
+++ b/GNUmakefile.in
@@ -1,7 +1,7 @@
 #
 # PostgreSQL top level makefile
 #
-# $PostgreSQL: pgsql/GNUmakefile.in,v 1.54 2009/10/29 21:57:17 petere Exp $
+# $PostgreSQL: pgsql/GNUmakefile.in,v 1.55 2009/11/03 21:28:10 petere Exp $
 #
 
 subdir =
@@ -70,12 +70,14 @@ distdir	= postgresql-$(VERSION)
 dummy	= =install=
 garbage = =*  "#"*  ."#"*  *~*  *.orig  *.rej  core  postgresql-*
 
-dist: $(distdir).tar.gz 
+dist: $(distdir).tar.gz $(distdir).tar.bz2
 	rm -rf $(distdir)
 
 $(distdir).tar: distdir
 	$(TAR) chf $@ $(distdir)
 
+.INTERMEDIATE: $(distdir).tar
+
 distdir-location:
 	@echo $(distdir)
 
@@ -98,10 +100,10 @@ distdir:
 	$(MAKE) -C $(distdir) distclean
 	rm -f $(distdir)/README.CVS
 
-distcheck: $(distdir).tar.gz
+distcheck: dist
 	rm -rf $(dummy)
 	mkdir $(dummy)
-	$(GZIP) -d -c $< | $(TAR) xf -
+	$(GZIP) -d -c $(distdir).tar.gz | $(TAR) xf -
 	install_prefix=`cd $(dummy) && pwd`; \
 	cd $(distdir) \
 	&& ./configure --prefix="$$install_prefix"
diff --git a/src/Makefile.global.in b/src/Makefile.global.in
index c781e22f48f..37441a8003a 100644
--- a/src/Makefile.global.in
+++ b/src/Makefile.global.in
@@ -1,5 +1,5 @@
 # -*-makefile-*-
-# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.258 2009/08/26 22:24:42 petere Exp $
+# $PostgreSQL: pgsql/src/Makefile.global.in,v 1.259 2009/11/03 21:28:10 petere Exp $
 
 #------------------------------------------------------------------------------
 # All PostgreSQL makefiles include this file and use the variables it sets,
@@ -475,10 +475,10 @@ TAS         = @TAS@
 	$(CPP) $(CPPFLAGS) -o $@ $<
 
 %.gz: %
-	$(GZIP) -f --best $<
+	$(GZIP) --best -c $< >$@
 
 %.bz2: %
-	$(BZIP2) -f $<
+	$(BZIP2) -c $< >$@
 
 ifndef PGXS
 
-- 
GitLab