Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: On-demand rebuilding and add "devel-install" target #17

Merged
merged 1 commit into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
3 changes: 2 additions & 1 deletion cockpit-starter-kit.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down