spec: Don't try to rebuild webpack when building released tarballs
Release tarballs already have dist/. We can't rebuild the webpack in an RPM as that requires npm and network access for `npm install`. But we also don't want to ship the entire `node_modules/` as that is huge and would require lots of careful license review. So ship a stub node_modules/ that satisfies the Makefile dependency. Make sure that this is not newer than package.json or anything in dist/, so that none of the Makefile's rebuild rules trigger. Closes #36
This commit is contained in:
parent
70c7242d9d
commit
e9635620c5
2 changed files with 10 additions and 3 deletions
11
Makefile
11
Makefile
|
|
@ -81,11 +81,18 @@ devel-install: $(WEBPACK_TEST)
|
|||
ln -s `pwd`/dist ~/.local/share/cockpit/$(PACKAGE_NAME)
|
||||
|
||||
# when building a distribution tarball, call webpack with a 'production' environment
|
||||
# ship a stub node_modules/ so that `make` works without re-running `npm install`
|
||||
dist-gzip: NODE_ENV=production
|
||||
dist-gzip: $(NODE_MODULES_TEST) all cockpit-$(PACKAGE_NAME).spec
|
||||
dist-gzip: all cockpit-$(PACKAGE_NAME).spec
|
||||
mv node_modules node_modules.release
|
||||
mkdir -p $(NODE_MODULES_TEST)
|
||||
touch -r package.json $(NODE_MODULES_TEST)
|
||||
touch 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/
|
||||
$$(git ls-files) cockpit-$(PACKAGE_NAME).spec dist/ node_modules
|
||||
rm -rf node_modules
|
||||
mv node_modules.release node_modules
|
||||
|
||||
srpm: dist-gzip cockpit-$(PACKAGE_NAME).spec
|
||||
rpmbuild -bs \
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ Cockpit Starter Kit Example Module
|
|||
%setup -n cockpit-starter-kit
|
||||
|
||||
%build
|
||||
make
|
||||
# There is nothing to do, release tarballs already have dist/.
|
||||
|
||||
%install
|
||||
make install DESTDIR=%{buildroot}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue