Module: check_mk
Branch: master
Commit: 11f86e4675349cfd54477151cc07aa96f0f58f7b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=11f86e4675349c…
Author: Alex Zurhake <az(a)mathias-kettner.de>
Date: Mon Jan 14 14:34:12 2019 +0100
CMK-1468: Don't call 'make dist' in each rpm Distro
To make this work:
- Build livestatus only once as standalone.
- Make sure all autoreconf files are packed into the archive
Change-Id: I3fd3f4924b98916e1116cc6e5713372d7660cd2f
---
Makefile | 16 ++++++++--------
omd/Makefile | 1 -
omd/packages/mk-livestatus/mk-livestatus.make | 12 ++++++------
3 files changed, 14 insertions(+), 15 deletions(-)
diff --git a/Makefile b/Makefile
index bce07c0..2236f62 100644
--- a/Makefile
+++ b/Makefile
@@ -136,17 +136,17 @@ check-version:
# is currently not used by most distros
# Would also use --exclude-vcs, but this is also not available
# And --transform is also missing ...
-dist: mk-livestatus-$(VERSION).tar.gz $(DISTNAME).tar.gz config.h.in $(DIST_DEPS)
+dist: $(DISTNAME).tar.gz config.h.in $(DIST_DEPS)
ifeq ($(ENTERPRISE),yes)
$(MAKE) -C enterprise agents/plugins/cmk-update-agent
$(MAKE) -C enterprise agents/plugins/cmk-update-agent-32
$(MAKE) -C enterprise agents/windows/plugins/cmk-update-agent.exe
endif
- @set -e -o pipefail ; EXCLUDES= ; \
+ set -e -o pipefail ; EXCLUDES= ; \
if [ -d .git ]; then \
git rev-parse --short HEAD > COMMIT ; \
for X in $$(git ls-files --directory --others -i --exclude-standard) ; do \
- if [[ $$X != aclocal.m4 && $$X != config.h.in && !
"$(DIST_DEPS)" =~ (^|[[:space:]])$$X($$|[[:space:]]) && $$X !=
$(DISTNAME).tar.gz ]]; then \
+ if [[ $$X != aclocal.m4 && $$X != config.h.in && !
"$(DIST_DEPS)" =~ (^|[[:space:]])$$X($$|[[:space:]]) && $$X !=
$(DISTNAME).tar.gz && $$X !=
omd/packages/mk-livestatus/mk-livestatus-$(VERSION).tar.gz && $$X != livestatus/*
&& $$X != enterprise/* ]]; then \
EXCLUDES+=" --exclude $${X%*/}" ; \
fi ; \
done ; \
@@ -177,7 +177,7 @@ endif
rm -rf check-mk-$(EDITION)-$(OMD_VERSION)
# This tar file is only used by "omd/packages/check_mk/Makefile"
-$(DISTNAME).tar.gz: mk-livestatus-$(VERSION).tar.gz .werks/werks
web/htdocs/js/main_min.js web/htdocs/js/mobile_min.js web/htdocs/js/side_min.js ChangeLog
+$(DISTNAME).tar.gz: omd/packages/mk-livestatus/mk-livestatus-$(VERSION).tar.gz
.werks/werks web/htdocs/js/main_min.js web/htdocs/js/mobile_min.js
web/htdocs/js/side_min.js ChangeLog
@echo "Making $(DISTNAME)"
rm -rf $(DISTNAME)
mkdir -p $(DISTNAME)
@@ -210,7 +210,7 @@ $(DISTNAME).tar.gz: mk-livestatus-$(VERSION).tar.gz .werks/werks
web/htdocs/js/m
tar czf $(DISTNAME)/checkman.tar.gz $(TAROPTS) -C checkman $$(cd checkman ; ls)
tar czf $(DISTNAME)/web.tar.gz $(TAROPTS) -C web htdocs app
- tar xzf mk-livestatus-$(VERSION).tar.gz
+ tar xzf omd/packages/mk-livestatus/mk-livestatus-$(VERSION).tar.gz
tar czf $(DISTNAME)/livestatus.tar.gz $(TAROPTS) -C mk-livestatus-$(VERSION) $$(cd
mk-livestatus-$(VERSION) ; ls -A )
rm -rf mk-livestatus-$(VERSION)
@@ -268,13 +268,13 @@ packages:
# NOTE: Old tar versions (e.g. on CentOS 5) don't have the --transform option,
# so we do things in a slightly complicated way.
-mk-livestatus-$(VERSION).tar.gz:
+omd/packages/mk-livestatus/mk-livestatus-$(VERSION).tar.gz:
rm -rf mk-livestatus-$(VERSION)
mkdir -p mk-livestatus-$(VERSION)
tar cf - $(TAROPTS) -C livestatus $$(cd livestatus ; echo $(LIVESTATUS_SOURCES) ) | tar
xf - -C mk-livestatus-$(VERSION)
cp -a configure.ac m4 mk-livestatus-$(VERSION)
cd mk-livestatus-$(VERSION) && autoreconf --install --include=m4 && rm
-rf autom4te.cache
- tar czf mk-livestatus-$(VERSION).tar.gz $(TAROPTS) mk-livestatus-$(VERSION)
+ tar czf omd/packages/mk-livestatus/mk-livestatus-$(VERSION).tar.gz $(TAROPTS)
mk-livestatus-$(VERSION)
rm -rf mk-livestatus-$(VERSION)
version:
@@ -325,7 +325,7 @@ web/htdocs/js/%_min.js: node_modules webpack.config.js
$(JAVASCRIPT_SOURCES)
clean:
make -C omd clean
rm -rf clang-analyzer dist.tmp rpm.topdir *.rpm *.deb *.exe \
- mk-livestatus-*.tar.gz \
+ omd/packages/mk-livestatus/mk-livestatus-*.tar.gz \
$(NAME)-*.tar.gz *~ counters autochecks \
precompiled cache web/htdocs/js/*_min.js \
.werks/werks \
diff --git a/omd/Makefile b/omd/Makefile
index 012e7da..5db396c 100644
--- a/omd/Makefile
+++ b/omd/Makefile
@@ -250,7 +250,6 @@ rpm:
if [ "$(EDITION)" = "raw" ]; then \
sed -i '/icmpsender/d;/icmpreceiver/d' omd.spec ; \
fi
- make -C $(REPO_PATH) dist
mkdir -p $(RPM_TOPDIR)/{SOURCES,BUILD,RPMS,SRPMS,SPECS}
cp ../check-mk-$(EDITION)-$(OMD_VERSION).tar.gz $(RPM_TOPDIR)/SOURCES
# NO_BRP_STALE_LINK_ERROR ignores errors when symlinking from skel to
diff --git a/omd/packages/mk-livestatus/mk-livestatus.make
b/omd/packages/mk-livestatus/mk-livestatus.make
index 07eb10f..139e31f 100644
--- a/omd/packages/mk-livestatus/mk-livestatus.make
+++ b/omd/packages/mk-livestatus/mk-livestatus.make
@@ -2,8 +2,9 @@ MK_LIVESTATUS := mk-livestatus
MK_LIVESTATUS_DIR := $(MK_LIVESTATUS)-$(CMK_VERSION)
# Attention: copy-n-paste from check_mk/Makefile below...
-MK_LIVESTATUS_BUILD := $(BUILD_HELPER_DIR)/$(MK_LIVESTATUS)-build
-MK_LIVESTATUS_INSTALL := $(BUILD_HELPER_DIR)/$(MK_LIVESTATUS)-install
+MK_LIVESTATUS_BUILD := $(BUILD_HELPER_DIR)/$(MK_LIVESTATUS_DIR)-build
+MK_LIVESTATUS_UNPACK := $(BUILD_HELPER_DIR)/$(MK_LIVESTATUS_DIR)-unpack
+MK_LIVESTATUS_INSTALL := $(BUILD_HELPER_DIR)/$(MK_LIVESTATUS_DIR)-install
.PHONY: $(MK_LIVESTATUS) $(MK_LIVESTATUS)-install $(MK_LIVESTATUS)-skel
$(MK_LIVESTATUS)-clean
@@ -11,11 +12,10 @@ $(MK_LIVESTATUS): $(MK_LIVESTATUS_BUILD)
$(MK_LIVESTATUS)-install: $(MK_LIVESTATUS_INSTALL)
-$(REPO_PATH)/$(MK_LIVESTATUS_DIR).tar.gz:
- $(MAKE) -C $(REPO_PATH) $(MK_LIVESTATUS_DIR).tar.gz
+$(PACKAGE_DIR)/$(MK_LIVESTATUS)/$(MK_LIVESTATUS_DIR).tar.gz:
+ $(MAKE) -C $(REPO_PATH) omd/packages/mk-livestatus/$(MK_LIVESTATUS_DIR).tar.gz
-$(MK_LIVESTATUS_BUILD): $(REPO_PATH)/$(MK_LIVESTATUS_DIR).tar.gz $(BOOST_BUILD)
$(RE2_BUILD)
- $(TAR_GZ) $(REPO_PATH)/$(MK_LIVESTATUS_DIR).tar.gz
+$(MK_LIVESTATUS_BUILD): $(MK_LIVESTATUS_UNPACK) $(BOOST_BUILD) $(RE2_BUILD)
cd $(MK_LIVESTATUS_DIR) ; \
./configure CXXFLAGS="-g -O3 -Wall -Wextra"
--with-boost=$(PACKAGE_BOOST_DESTDIR) --with-re2=$(PACKAGE_RE2_DESTDIR)
--prefix=$(OMD_ROOT)
$(MAKE) -C $(MK_LIVESTATUS_DIR) all