From 534fad1c6340d96d73b1c12d393bd09f19106dcf Mon Sep 17 00:00:00 2001 From: Simon Pichugin Date: Nov 02 2018 16:25:17 +0000 Subject: Issue 49999 - Add dist-bz2 target for Koji build system Description: Change Makefile so it is run only when there is no files cockpit_dist and node_modules. Add target for creating a tarball for Koji system https://pagure.io/389-ds-base/issue/49999 Reviewed by: mreynolds, mhonek (Thanks!) --- diff --git a/Makefile.am b/Makefile.am index 579f977..61973d3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2381,13 +2381,16 @@ lib389: src/lib389/setup.py lib389-install: lib389 cd $(srcdir)/src/lib389; $(PYTHON) setup.py install --skip-build --force -node_modules: - cd $(srcdir)/src/cockpit/389-console; make -f node_modules.mk install +NODE_MODULES_TEST = src/cockpit/389-console/node_modules/webpack +WEBPACK_TEST = src/cockpit/389-console/cockpit_dist/index.html # Cockpit UI plugin - we install the dependancies and build the JS sources # and then we use install-data-hook for copying the results on 'make install' -389-console: node_modules - cd $(srcdir)/src/cockpit/389-console; make -f node_modules.mk build-cockpit-plugin +$(NODE_MODULES_TEST): + cd src/cockpit/389-console; make -f node_modules.mk install + +$(WEBPACK_TEST): $(NODE_MODULES_TEST) + cd src/cockpit/389-console; make -f node_modules.mk build-cockpit-plugin # This requires a built source tree and avoids having to install anything system-wide 389-console-devel-install: diff --git a/rpm.mk b/rpm.mk index 1b3f7b3..0b2b3a0 100644 --- a/rpm.mk +++ b/rpm.mk @@ -12,6 +12,9 @@ NUNC_STANS_ON = 1 JEMALLOC_URL ?= $(shell rpmspec -P $(RPMBUILD)/SPECS/389-ds-base.spec | awk '/^Source3:/ {print $$2}') JEMALLOC_TARBALL ?= $(shell basename "$(JEMALLOC_URL)") BUNDLE_JEMALLOC = 1 +NODE_MODULES_TEST = src/cockpit/389-console/node_modules/webpack +WEBPACK_TEST = src/cockpit/389-console/cockpit_dist/index.html +GIT_TAG = ${TAG} # Some sanitizers are supported only by clang CLANG_ON = 0 @@ -31,13 +34,24 @@ clean: rm -rf dist rm -rf rpmbuild -node_modules: +$(NODE_MODULES_TEST): cd src/cockpit/389-console; make -f node_modules.mk install -cockpit_dist: node_modules +$(WEBPACK_TEST): $(NODE_MODULES_TEST) cd src/cockpit/389-console; make -f node_modules.mk build-cockpit-plugin -local-archive: cockpit_dist +dist-bz2: $(WEBPACK_TEST) + cd src/cockpit/389-console; \ + mv node_modules node_modules.release; \ + touch cockpit_dist/* + mkdir -p $(NODE_MODULES_TEST) + touch -r src/cockpit/389-console/package.json $(NODE_MODULES_TEST) + tar cjf $(GIT_TAG).tar.bz2 --transform "s,^,$(GIT_TAG)/," $$(git ls-files) src/cockpit/389-console/cockpit_dist/ src/cockpit/389-console/node_modules + cd src/cockpit/389-console; \ + rm -rf node_modules; \ + mv node_modules.release node_modules + +local-archive: $(WEBPACK_TEST) -mkdir -p dist/$(NAME_VERSION) rsync -a --exclude=node_modules --exclude=dist --exclude=.git --exclude=rpmbuild . dist/$(NAME_VERSION)