From 70ad97185c4c05b0dd9fa90b18c2b0709fc09887 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Tue, 17 Jul 2018 22:02:54 +0200 Subject: [PATCH] Ship final spec file instead of template in release tarballs This is easier to handle downstream, as the spec file can be used as-is, instead of having to get rebuilt. Adjust the clean rule to only remove the .spec if the .spec.in exists, so that it gets removed in the upstream git, but not in unpacked release tarball trees. --- Makefile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 8125908..b16b92a 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ dist/index.js: $(NODE_MODULES_TEST) $(wildcard src/*) package.json webpack.confi clean: rm -rf dist/ - rm -f $(PACKAGE_NAME).spec + [ ! -e cockpit-$(PACKAGE_NAME).spec.in ] || rm -f cockpit-$(PACKAGE_NAME).spec install: dist/index.js mkdir -p $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME) @@ -80,8 +80,10 @@ devel-install: dist/index.js # when building a distribution tarball, call webpack with a 'production' environment dist-gzip: NODE_ENV=production -dist-gzip: clean $(NODE_MODULES_TEST) all - tar czf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' $$(git ls-files) dist/ +dist-gzip: $(NODE_MODULES_TEST) all cockpit-$(PACKAGE_NAME).spec + tar czf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' \ + --exclude cockpit-$(PACKAGE_NAME).spec.in \ + $$(git ls-files) cockpit-$(PACKAGE_NAME).spec dist/ srpm: dist-gzip cockpit-$(PACKAGE_NAME).spec rpmbuild -bs \