################################################################# # Started 2007-06-06 # Last modified 2007-06-14 # # This is a makefile for compiling muninlite for floppyFW. # It requires inetd to be compiled in floppyfw. # # Kai Ove Gran # kaiove@humla.no ################################################################# # Setting our variables. MUNINLITE_SOURCE_URL=$(SF_MIRROR)/sourceforge/muninlite/ MUNINLITE_SOURCE=muninlite-1.0.0.tar.gz MUNINLITE_DIR=$(BUILD_DIR)/muninlite-1.0.0 MUNINLITE_PKG_DIR=$(PACKAGES_DIR)/muninlite # Downloading the source. $(DL_DIR)/$(MUNINLITE_SOURCE): $(WGET) -P $(DL_DIR) $(MUNINLITE_SOURCE_URL)$(MUNINLITE_SOURCE) # Makes it possible to write 'make muninlite-source' from floppyfw # directory to download source only. muninlite-source: $(DL_DIR)/$(MUNINLITE_SOURCE) # Unpacks the source from the download directory to the # BUILD_DIR. The reason we unpack to the BUILD_DIR and not the # MUNINLITE_DIR is because the files are packed in a folder within # the tarball, thus ending up in the MUNINLITE_DIR when unpacked. $(MUNINLITE_DIR)/.unpacked: $(DL_DIR)/$(MUNINLITE_SOURCE) # PLEASE NOTE! This is a temporary patch which can be removed when this bug is fixed in the general makefile!! if [ ! -d $(BUILD_DIR) ]; then mkdir -p $(BUILD_DIR);fi # ^-- This one that is ;) tar -C $(BUILD_DIR) -xvzf $(DL_DIR)/$(MUNINLITE_SOURCE) touch $(MUNINLITE_DIR)/.unpacked # Setting what plugins to use, running the make and copying to package dir $(MUNINLITE_PKG_DIR)/usr/bin/munin-node: $(MUNINLITE_DIR)/.unpacked $(SED) 's/^PLUGINS=.*/PLUGINS=cpu if_ if_err_ load memory processes uptime interrupts irqstats/' $(MUNINLITE_DIR)/Makefile $(MAKE) -C $(MUNINLITE_DIR) if [ ! -d $(MUNINLITE_PKG_DIR)/usr/bin ]; then mkdir -p $(MUNINLITE_PKG_DIR)/usr/bin;fi cp $(MUNINLITE_DIR)/munin-node $(MUNINLITE_PKG_DIR)/usr/bin/munin-node # Makes the bz2 and ffw package files and places them under # /floppyfw/packages. $(PACKAGES_DIR)/muninlite.ffw: $(MUNINLITE_PKG_DIR)/usr/bin/munin-node cp $(MUNINLITE_DIR)/examples/post-muninlite.ini $(PACKAGES_DIR)/post-muninlite.ini (cd $(PACKAGES_DIR); sh mkpack muninlite) # Makes it possible to write 'make muninlite' from the floppyfw # dir. muninlite: $(PACKAGES_DIR)/muninlite.ffw # Makes it possible to write 'make muninlite-clean' from the # floppyfw dir to remove everything related to muninlite. muninlite-clean: $(RM) -r $(MUNINLITE_DIR) $(RM) -r $(MUNINLITE_PKG_DIR) $(RM) -r $(DL_DIR)/$(MUNINLITE_SOURCE)