gluon-status-page: make status page mesh protocol agnostic
batman-adv-specific parts are moved to a new package gluon-status-page-mesh-batman-adv.
This commit is contained in:
parent
b70d4ce20a
commit
8959d8c3ea
@ -21,3 +21,6 @@ packages 'web-advanced' \
|
||||
|
||||
packages 'web-advanced & autoupdater' \
|
||||
'gluon-web-autoupdater'
|
||||
|
||||
packages 'status-page & (mesh-batman-adv-14 | mesh-batman-adv-15)' \
|
||||
'gluon-status-page-mesh-batman-adv'
|
||||
|
20
package/gluon-status-page-mesh-batman-adv/Makefile
Normal file
20
package/gluon-status-page-mesh-batman-adv/Makefile
Normal file
@ -0,0 +1,20 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=gluon-status-page-mesh-batman-adv
|
||||
PKG_VERSION:=1
|
||||
|
||||
include ../gluon.mk
|
||||
|
||||
define Package/gluon-status-page-mesh-batman-adv
|
||||
TITLE:=Batman-data provider for gluon-status-page
|
||||
DEPENDS:=+gluon-status-page gluon-mesh-batman-adv +libnl-tiny +libbatadv +libjson-c
|
||||
endef
|
||||
|
||||
define Package/gluon-status-page-mesh-batman-adv/install
|
||||
$(Gluon/Build/Install)
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/gluon/status-page/providers
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/neighbours-batadv $(1)/lib/gluon/status-page/providers/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackageGluon,gluon-status-page-mesh-batman-adv))
|
40
package/gluon-status-page-mesh-batman-adv/src/Makefile
Normal file
40
package/gluon-status-page-mesh-batman-adv/src/Makefile
Normal file
@ -0,0 +1,40 @@
|
||||
all: neighbours-batadv
|
||||
|
||||
CFLAGS += -Wall -D_GNU_SOURCE
|
||||
|
||||
ifeq ($(origin PKG_CONFIG), undefined)
|
||||
PKG_CONFIG = pkg-config
|
||||
ifeq ($(shell which $(PKG_CONFIG) 2>/dev/null),)
|
||||
$(error $(PKG_CONFIG) not found)
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(origin LIBNL_CFLAGS) $(origin LIBNL_LDLIBS), undefined undefined)
|
||||
LIBNL_NAME ?= libnl-tiny
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion $(LIBNL_NAME) 2>/dev/null),)
|
||||
$(error No $(LIBNL_NAME) development libraries found!)
|
||||
endif
|
||||
LIBNL_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBNL_NAME))
|
||||
LIBNL_LDLIBS += $(shell $(PKG_CONFIG) --libs $(LIBNL_NAME))
|
||||
endif
|
||||
CFLAGS += $(LIBNL_CFLAGS)
|
||||
LDLIBS += $(LIBNL_LDLIBS)
|
||||
|
||||
CFLAGS_JSONC = $(shell pkg-config --cflags json-c)
|
||||
LDFLAGS_JSONC = $(shell pkg-config --libs json-c)
|
||||
|
||||
|
||||
ifeq ($(origin LIBBATADV_CFLAGS) $(origin LIBBATADV_LDLIBS), undefined undefined)
|
||||
LIBBATADV_NAME ?= libbatadv
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion $(LIBBATADV_NAME) 2>/dev/null),)
|
||||
$(error No $(LIBBATADV_NAME) development libraries found!)
|
||||
endif
|
||||
LIBBATADV_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBBATADV_NAME))
|
||||
LIBBATADV_LDLIBS += $(shell $(PKG_CONFIG) --libs $(LIBBATADV_NAME))
|
||||
endif
|
||||
CFLAGS += $(LIBBATADV_CFLAGS)
|
||||
LDLIBS += $(LIBBATADV_LDLIBS)
|
||||
|
||||
neighbours-batadv: neighbours-batadv.c
|
||||
$(CC) $(CFLAGS) $(CFLAGS_JSONC) $(LDFLAGS) $(LDFLAGS_JSONC) -o $@ $^ $(LDLIBS)
|
||||
|
@ -7,14 +7,14 @@ include ../gluon.mk
|
||||
|
||||
define Package/gluon-status-page
|
||||
TITLE:=Status page showing information about the node
|
||||
DEPENDS:=+gluon-web +gluon-neighbour-info +gluon-respondd +uhttpd +sse-multiplex +libiwinfo +libjson-c +libnl-tiny +libubus-lua +libbatadv
|
||||
DEPENDS:=+gluon-web +gluon-neighbour-info +gluon-respondd +uhttpd +sse-multiplex +libiwinfo +libjson-c +libnl-tiny +libubus-lua
|
||||
endef
|
||||
|
||||
define Package/gluon-status-page/install
|
||||
$(Gluon/Build/Install)
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/gluon/status-page/providers
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/{neighbours-batadv,stations} $(1)/lib/gluon/status-page/providers/
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/stations $(1)/lib/gluon/status-page/providers/
|
||||
|
||||
$(INSTALL_DIR) $(1)/lib/gluon/status-page/view/
|
||||
$(LN) /lib/gluon/web/i18n $(1)/lib/gluon/status-page/
|
||||
|
@ -6,6 +6,6 @@ badrequest() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
( batctl if | cut -d: -f1 | grep -qxF "$QUERY_STRING" ) 2>/dev/null || badrequest
|
||||
( gluon-list-mesh-interfaces | grep -qxF "$QUERY_STRING" ) 2>/dev/null || badrequest
|
||||
|
||||
exec gluon-neighbour-info -s neighbour -i "$QUERY_STRING" -d ff02::2:1001 -p 1001 -r nodeinfo
|
||||
|
@ -6,7 +6,7 @@ badrequest() {
|
||||
exit 1
|
||||
}
|
||||
|
||||
( batctl if | cut -d: -f1 | grep -qxF "$QUERY_STRING" ) 2>/dev/null || badrequest
|
||||
( gluon-list-mesh-interfaces | grep -qxF "$QUERY_STRING" ) 2>/dev/null || badrequest
|
||||
|
||||
CMD="exec /lib/gluon/status-page/providers/stations '$QUERY_STRING'"
|
||||
|
||||
|
@ -20,19 +20,7 @@ endif
|
||||
CFLAGS_JSONC = $(shell pkg-config --cflags json-c)
|
||||
LDFLAGS_JSONC = $(shell pkg-config --libs json-c)
|
||||
|
||||
ifeq ($(origin LIBBATADV_CFLAGS) $(origin LIBBATADV_LDLIBS), undefined undefined)
|
||||
LIBBATADV_NAME ?= libbatadv
|
||||
ifeq ($(shell $(PKG_CONFIG) --modversion $(LIBBATADV_NAME) 2>/dev/null),)
|
||||
$(error No $(LIBBATADV_NAME) development libraries found!)
|
||||
endif
|
||||
LIBBATADV_CFLAGS += $(shell $(PKG_CONFIG) --cflags $(LIBBATADV_NAME))
|
||||
LIBBATADV_LDLIBS += $(shell $(PKG_CONFIG) --libs $(LIBBATADV_NAME))
|
||||
endif
|
||||
|
||||
all: neighbours-batadv stations
|
||||
|
||||
neighbours-batadv: neighbours-batadv.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_JSONC) $(LIBNL_CFLAGS) $(LIBBATADV_CFLAGS) $(LDFLAGS) $(LDFLAGS_JSONC) $(LIBNL_LDLIBS) $(LIBBATADV_LDLIBS) -Wall -o $@ $^ $(LDLIBS)
|
||||
all: stations
|
||||
|
||||
stations: stations.c
|
||||
$(CC) $(CPPFLAGS) $(CFLAGS) $(CFLAGS_JSONC) $(LDFLAGS) $(LDFLAGS_JSONC) -Wall -o $@ $^ $(LDLIBS) -liwinfo
|
||||
|
Loading…
Reference in New Issue
Block a user