]> www.infradead.org Git - users/dhowells/kafs-client.git/commitdiff
makefile: Build the tarball and then build the rpm from that
authorDavid Howells <dhowells@redhat.com>
Tue, 25 Jun 2019 19:32:28 +0000 (20:32 +0100)
committerDavid Howells <dhowells@redhat.com>
Tue, 25 Jun 2019 19:37:17 +0000 (20:37 +0100)
Build the tarball and then build the rpm from that as separate steps.

Signed-off-by: David Howells <dhowells@redhat.com>
Makefile

index cff3865310ff195fa04b0b1df422d8ec49cebb3c..ad679367a1c19b63e1a00d3a4aab8d71e0e7b6b1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -90,8 +90,8 @@ distclean: clean
 #
 ###############################################################################
 $(ZTARBALL):
-       git archive --prefix=kafs-client-$(VERSION)/ --format tar -o $(TARBALL) HEAD
-       bzip2 -9 <$(TARBALL) >$(ZTARBALL)
+       git archive --prefix=kafs-client-$(VERSION)/ --format tar HEAD | \
+       bzip2 -9 >$(ZTARBALL)
 
 tarball: $(ZTARBALL)
 
@@ -123,12 +123,11 @@ RPMBUILDDIRS := \
 RPMFLAGS := \
        --define "buildid $(BUILDID)"
 
-rpm:
+rpm: tarball
        mkdir -p rpmbuild
        chmod ug-s rpmbuild
        mkdir -p rpmbuild/{SPECS,SOURCES,BUILD,BUILDROOT,RPMS,SRPMS}
-       git archive --prefix=kafs-client-$(VERSION)/ --format tar -o $(SRCBALL) HEAD
-       bzip2 -9 <$(SRCBALL) >$(ZSRCBALL)
+       cp $(ZTARBALL) $(ZSRCBALL)
        rpmbuild -ts $(ZSRCBALL) --define "_srcrpmdir rpmbuild/SRPMS" $(RPMFLAGS)
        rpmbuild --rebuild $(SRPM) $(RPMBUILDDIRS) $(RPMFLAGS)