| 1 | ################################################################# |
|---|
| 2 | # Started 2007-06-06 |
|---|
| 3 | # Last modified 2007-06-14 |
|---|
| 4 | # |
|---|
| 5 | # This is a makefile for compiling muninlite for floppyFW. |
|---|
| 6 | # It requires inetd to be compiled in floppyfw. |
|---|
| 7 | # |
|---|
| 8 | # Kai Ove Gran |
|---|
| 9 | # kaiove@humla.no |
|---|
| 10 | ################################################################# |
|---|
| 11 | |
|---|
| 12 | # Setting our variables. |
|---|
| 13 | |
|---|
| 14 | MUNINLITE_SOURCE_URL=$(SF_MIRROR)/sourceforge/muninlite/ |
|---|
| 15 | MUNINLITE_SOURCE=muninlite-1.0.0.tar.gz |
|---|
| 16 | MUNINLITE_DIR=$(BUILD_DIR)/muninlite-1.0.0 |
|---|
| 17 | MUNINLITE_PKG_DIR=$(PACKAGES_DIR)/muninlite |
|---|
| 18 | |
|---|
| 19 | # Downloading the source. |
|---|
| 20 | |
|---|
| 21 | $(DL_DIR)/$(MUNINLITE_SOURCE): |
|---|
| 22 | $(WGET) -P $(DL_DIR) $(MUNINLITE_SOURCE_URL)$(MUNINLITE_SOURCE) |
|---|
| 23 | |
|---|
| 24 | # Makes it possible to write 'make muninlite-source' from floppyfw |
|---|
| 25 | # directory to download source only. |
|---|
| 26 | |
|---|
| 27 | muninlite-source: $(DL_DIR)/$(MUNINLITE_SOURCE) |
|---|
| 28 | |
|---|
| 29 | # Unpacks the source from the download directory to the |
|---|
| 30 | # BUILD_DIR. The reason we unpack to the BUILD_DIR and not the |
|---|
| 31 | # MUNINLITE_DIR is because the files are packed in a folder within |
|---|
| 32 | # the tarball, thus ending up in the MUNINLITE_DIR when unpacked. |
|---|
| 33 | |
|---|
| 34 | $(MUNINLITE_DIR)/.unpacked: $(DL_DIR)/$(MUNINLITE_SOURCE) |
|---|
| 35 | # PLEASE NOTE! This is a temporary patch which can be removed when this bug is fixed in the general makefile!! |
|---|
| 36 | if [ ! -d $(BUILD_DIR) ]; then mkdir -p $(BUILD_DIR);fi |
|---|
| 37 | # ^-- This one that is ;) |
|---|
| 38 | tar -C $(BUILD_DIR) -xvzf $(DL_DIR)/$(MUNINLITE_SOURCE) |
|---|
| 39 | touch $(MUNINLITE_DIR)/.unpacked |
|---|
| 40 | |
|---|
| 41 | # Setting what plugins to use, running the make and copying to package dir |
|---|
| 42 | |
|---|
| 43 | $(MUNINLITE_PKG_DIR)/usr/bin/munin-node: $(MUNINLITE_DIR)/.unpacked |
|---|
| 44 | $(SED) 's/^PLUGINS=.*/PLUGINS=cpu if_ if_err_ load memory processes uptime interrupts irqstats/' $(MUNINLITE_DIR)/Makefile |
|---|
| 45 | $(MAKE) -C $(MUNINLITE_DIR) |
|---|
| 46 | if [ ! -d $(MUNINLITE_PKG_DIR)/usr/bin ]; then mkdir -p $(MUNINLITE_PKG_DIR)/usr/bin;fi |
|---|
| 47 | cp $(MUNINLITE_DIR)/munin-node $(MUNINLITE_PKG_DIR)/usr/bin/munin-node |
|---|
| 48 | |
|---|
| 49 | # Makes the bz2 and ffw package files and places them under |
|---|
| 50 | # /floppyfw/packages. |
|---|
| 51 | |
|---|
| 52 | $(PACKAGES_DIR)/muninlite.ffw: $(MUNINLITE_PKG_DIR)/usr/bin/munin-node |
|---|
| 53 | cp $(MUNINLITE_DIR)/examples/post-muninlite.ini $(PACKAGES_DIR)/post-muninlite.ini |
|---|
| 54 | (cd $(PACKAGES_DIR); sh mkpack muninlite) |
|---|
| 55 | |
|---|
| 56 | # Makes it possible to write 'make muninlite' from the floppyfw |
|---|
| 57 | # dir. |
|---|
| 58 | |
|---|
| 59 | muninlite: $(PACKAGES_DIR)/muninlite.ffw |
|---|
| 60 | |
|---|
| 61 | # Makes it possible to write 'make muninlite-clean' from the |
|---|
| 62 | # floppyfw dir to remove everything related to muninlite. |
|---|
| 63 | |
|---|
| 64 | muninlite-clean: |
|---|
| 65 | $(RM) -r $(MUNINLITE_DIR) |
|---|
| 66 | $(RM) -r $(MUNINLITE_PKG_DIR) |
|---|
| 67 | $(RM) -r $(DL_DIR)/$(MUNINLITE_SOURCE) |
|---|