Skip to content

Instantly share code, notes, and snippets.

@adde88
Created January 13, 2020 22:33
Show Gist options
  • Save adde88/b49ded62f7cac6b4cc15f9411239e153 to your computer and use it in GitHub Desktop.
Save adde88/b49ded62f7cac6b4cc15f9411239e153 to your computer and use it in GitHub Desktop.
Custom 'kismet-remote' Makefile for OpenWRT (Kismet source-files located within 'src' directory in the same dir as this makefile)
include $(TOPDIR)/rules.mk
PKG_NAME:=kismet-remote-custom
PKG_VERSION:=13012020
PKG_RELEASE:=1
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
include $(INCLUDE_DIR)/package.mk
PKG_USE_MIPS16:=0
HOST_BUILD_DEPENDS:=protobuf/host
define Package/kismet-remote-custom
SECTION:=net
CATEGORY:=Network
TITLE:=Kismet Remote Capture (Hak5)
URL:=https://www.kismetwireless.net/
DEPENDS:=+libpthread +libpcap +libpcre +libmicrohttpd +libnl +libcap +libstdcpp +libncurses +libsqlite3 +zlib +protobuf-lite +libprotobuf-c +libdw +zlib
SUBMENU:=Wireless
endef
define Package/kismet-remote-custom/description
Kismet Wireless Remote Capture Tools.
endef
define Build/Configure
$(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))
endef
CONFIGURE_ARGS += \
--sysconfdir=/etc/kismet \
--bindir=/usr/bin \
--disable-python-tools \
--with-protoc=$(STAGING_DIR_HOSTPKG)/bin/protoc \
--enable-capture-tools-only
# Override libs to force lpthread because we don't detect it properly on openwrt
CONFIGURE_VARS += \
CXXFLAGS="$$$$CXXFLAGS" \
LIBS="-lm -lpthread"
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) -rf ./src/* $(PKG_BUILD_DIR)/
endef
define Build/Compile
$(MAKE) -C $(PKG_BUILD_DIR) \
CFLAGS="-fPIC -I$(STAGING_DIR)/usr/include/libnl3" \
LD="$(TARGET_CXX)" \
datasources
endef
define Package/kismet-remote-custom/install
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_cap_pcapfile $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/kismet_cap_kismetdb $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/capture_linux_wifi/kismet_cap_linux_wifi $(1)/usr/bin/
$(INSTALL_BIN) $(PKG_BUILD_DIR)/capture_linux_bluetooth/kismet_cap_linux_bluetooth $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/kismet/
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet.conf $(1)/etc/kismet
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet_80211.conf $(1)/etc/kismet
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet_alerts.conf $(1)/etc/kismet
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet_filter.conf $(1)/etc/kismet
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet_httpd.conf $(1)/etc/kismet
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet_logging.conf $(1)/etc/kismet
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet_memory.conf $(1)/etc/kismet
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet_storage.conf $(1)/etc/kismet
$(INSTALL_CONF) $(PKG_BUILD_DIR)/conf/kismet_uav.conf $(1)/etc/kismet
endef
$(eval $(call BuildPackage,kismet-remote-custom))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment