starter-kit/Makefile
Lars Karlitski 6bfe20fdcc Dist using git ls-files
This makes sure we always include all files in the repository when
disting.

Obsoletes webpack-with-stats, which had a bug anyway: it wasn't
reporting jslint errors.
2017-10-18 19:12:56 +02:00

41 lines
1.2 KiB
Makefile

PACKAGE_NAME := $(shell python3 -c "import json; print(json.load(open('package.json'))['name'])")
all:
NODE_ENV=$(NODE_ENV) npm run build
clean:
rm -rf dist/
rm -rf _install
install: all install-only
install-only:
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/
# when building a distribution tarball, call webpack with a 'production' environment
dist-gzip: NODE_ENV=production
dist-gzip: clean all
tar czf $(PACKAGE_NAME)-cockpit.tar.gz --transform 's,^,$(PACKAGE_NAME)-cockpit/,' $$(git ls-files) dist/
srpm: dist-gzip
rpmbuild -bs \
--define "_sourcedir `pwd`" \
--define "_srcrpmdir `pwd`" \
$(PACKAGE_NAME)-cockpit.spec
rpm: dist-gzip
mkdir -p "`pwd`/output"
mkdir -p "`pwd`/rpmbuild"
rpmbuild -bb \
--define "_sourcedir `pwd`" \
--define "_specdir `pwd`" \
--define "_builddir `pwd`/rpmbuild" \
--define "_srcrpmdir `pwd`" \
--define "_rpmdir `pwd`/output" \
--define "_buildrootdir `pwd`/build" \
$(PACKAGE_NAME)-cockpit.spec
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec mv {} . \;
rm -r "`pwd`/rpmbuild"