Skip to content

Instantly share code, notes, and snippets.

@steev
Created December 17, 2019 20:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steev/673699bec8ad651b08b7094b1ffc83ac to your computer and use it in GitHub Desktop.
Save steev/673699bec8ad651b08b7094b1ffc83ac to your computer and use it in GitHub Desktop.
diff --git a/Makefile b/Makefile
index a80ad47..e9bf0b0 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,12 @@
# Our plugin directory name when we install
PLUGIN_NAME ?= reportgen
+INSTALL ?= /usr/bin/install
+
+# As we have no live code, all we need is the manifest.conf to "compile"
+all: manifest.conf
+# We have no requirements for install or userinstall, we just copy our data
+install:
# Look for the kismet source in /usr/src/kismet by default
KIS_SRC_DIR ?= /usr/src/kismet
KIS_INC_DIR ?= $(KIS_SRC_DIR)
@@ -12,16 +18,10 @@ top_builddir = $(BLDHOME)
-include $(KIS_SRC_DIR)/Makefile.inc
# Set sane values if we don't have the base config
-INSTALL ?= /usr/bin/install
plugindir ?= $(shell pkg-config --variable=plugindir kismet)
INSTUSR ?= root
INSTGRP ?= root
-# As we have no live code, all we need is the manifest.conf to "compile"
-all: manifest.conf
-
-# We have no requirements for install or userinstall, we just copy our data
-install:
ifeq ("$(plugindir)", "")
echo "No kismet install found in pkgconfig, assuming /usr/local"
plugindir = "/usr/local/lib/kismet/"
@steev
Copy link
Author

steev commented Dec 17, 2019

PLUGIN_NAME ?= reportgen
INSTALL ?= /usr/bin/install

# As we have no live code, all we need is the manifest.conf to "compile"
all:    manifest.conf

# We have no requirements for install or userinstall, we just copy our data
install:
# Look for the kismet source in /usr/src/kismet by default
KIS_SRC_DIR ?= /usr/src/kismet
KIS_INC_DIR ?= $(KIS_SRC_DIR)

BLDHOME = .
top_builddir = $(BLDHOME)

# Try to include the base config
-include $(KIS_SRC_DIR)/Makefile.inc

# Set sane values if we don't have the base config
plugindir ?= $(shell pkg-config --variable=plugindir kismet)
INSTUSR ?= root
INSTGRP ?= root

ifeq ("$(plugindir)", "")
        echo "No kismet install found in pkgconfig, assuming /usr/local"
        plugindir = "/usr/local/lib/kismet/"
endif
        mkdir -p $(DESTDIR)/$(plugindir)/$(PLUGIN_NAME)
        $(INSTALL) -o $(INSTUSR) -g $(INSTGRP) -m 444 manifest.conf $(DESTDIR)/$(plugindir)/$(PLUGIN_NAME)/manifest.conf

        mkdir -p $(DESTDIR)/$(plugindir)/$(PLUGIN_NAME)/httpd
        cp -r httpd/* $(DESTDIR)/$(plugindir)/$(PLUGIN_NAME)/httpd

userinstall:
        mkdir -p ${HOME}/.kismet/plugins/$(PLUGIN_NAME)
        $(INSTALL) manifest.conf $(HOME)/.kismet/plugins/$(PLUGIN_NAME)/manifest.conf

        mkdir -p ${HOME}/.kismet/plugins/$(PLUGIN_NAME)/httpd
        cp -r httpd/* $(HOME)/.kismet/plugins/${PLUGIN_NAME}/httpd

clean:
        @echo "Nothing to clean"```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment