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.
This commit is contained in:
Martin Pitt 2018-07-17 22:02:54 +02:00
parent 274c8da345
commit 70ad97185c

View file

@ -65,7 +65,7 @@ dist/index.js: $(NODE_MODULES_TEST) $(wildcard src/*) package.json webpack.confi
clean: clean:
rm -rf dist/ rm -rf dist/
rm -f $(PACKAGE_NAME).spec [ ! -e cockpit-$(PACKAGE_NAME).spec.in ] || rm -f cockpit-$(PACKAGE_NAME).spec
install: dist/index.js install: dist/index.js
mkdir -p $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME) 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 # when building a distribution tarball, call webpack with a 'production' environment
dist-gzip: NODE_ENV=production dist-gzip: NODE_ENV=production
dist-gzip: clean $(NODE_MODULES_TEST) all dist-gzip: $(NODE_MODULES_TEST) all cockpit-$(PACKAGE_NAME).spec
tar czf cockpit-$(PACKAGE_NAME)-$(VERSION).tar.gz --transform 's,^,cockpit-$(PACKAGE_NAME)/,' $$(git ls-files) dist/ 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 srpm: dist-gzip cockpit-$(PACKAGE_NAME).spec
rpmbuild -bs \ rpmbuild -bs \