diff --git a/Makefile b/Makefile index 97a5e7c..e725afc 100644 --- a/Makefile +++ b/Makefile @@ -5,21 +5,26 @@ endif export TEST_OS VM_IMAGE=$(CURDIR)/test/images/$(TEST_OS) -all: node_modules/react-lite +all: dist/index.js + +dist/index.js: node_modules/react-lite $(wildcard src/*) package.json webpack.config.js NODE_ENV=$(NODE_ENV) npm run build clean: rm -rf dist/ rm -rf _install -install: all install-only - -install-only: +install: dist/index.js mkdir -p $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME) cp -r dist/* $(DESTDIR)/usr/share/cockpit/$(PACKAGE_NAME) mkdir -p $(DESTDIR)/usr/share/metainfo/ cp org.cockpit-project.$(PACKAGE_NAME).metainfo.xml $(DESTDIR)/usr/share/metainfo/ +# this requires a built source tree and avoids having to install anything system-wide +devel-install: dist/index.js + mkdir -p ~/.local/share/cockpit + ln -s `pwd`/dist ~/.local/share/cockpit/starter-kit + # when building a distribution tarball, call webpack with a 'production' environment dist-gzip: NODE_ENV=production dist-gzip: clean all @@ -70,4 +75,4 @@ test/common: node_modules/react-lite: npm install -.PHONY: all clean install install-only dist-gzip srpm rpm check +.PHONY: all clean install devel-install dist-gzip srpm rpm check diff --git a/cockpit-starter-kit.spec b/cockpit-starter-kit.spec index a6200d8..41a9dc5 100644 --- a/cockpit-starter-kit.spec +++ b/cockpit-starter-kit.spec @@ -16,9 +16,10 @@ Cockpit Starter Kit Example Module %setup -n cockpit-starter-kit %build +make %install -make install-only DESTDIR=%{buildroot} +make install DESTDIR=%{buildroot} find %{buildroot} -type f >> files.list sed -i "s|%{buildroot}||" *.list