libs: add rpcd-mod-luci

Add rpcd-mod-luci, a fast rpcd C plugin for speeding up common backend
ubus operations.

Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
Jo-Philipp Wich 2019-10-31 14:01:38 +01:00
parent 4798b3f062
commit b292c1d5fa
3 changed files with 1834 additions and 0 deletions

View File

@ -0,0 +1,54 @@
#
# Copyright (C) 2016-2017 Jo-Philipp Wich <jo@mein.io>
#
# Licensed under the Apache License, Version 2.0.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=rpcd-mod-luci
PKG_VERSION:=20191031
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
PKG_LICENSE:=Apache-2.0
PKG_BUILD_PARALLEL:=1
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk
TARGET_CFLAGS += \
-I$(STAGING_DIR)/usr/include/libnl-tiny \
-I$(STAGING_DIR)/usr/include \
CMAKE_OPTIONS += \
-DLIBNL_LIBS=-lnl-tiny \
define Build/Prepare
$(INSTALL_DIR) $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Package/rpcd-mod-luci
SECTION:=libs
CATEGORY:=Libraries
TITLE:=Rapid reverse DNS rpcd module
DEPENDS:=+rpcd +libubox +libubus +libiwinfo
endef
define Package/rpcd-mod-luci/description
Provides rapid mass reverse DNS lookup functionality.
endef
define Package/rpcd-mod-luci/install
$(INSTALL_DIR) $(1)/usr/lib/rpcd
$(INSTALL_BIN) $(PKG_BUILD_DIR)/luci.so $(1)/usr/lib/rpcd/
endef
define Package/rpcd-mod-luci/postinst
#!/bin/sh
killall -HUP rpcd 2>/dev/null
exit 0
endef
$(eval $(call BuildPackage,rpcd-mod-luci))

View File

@ -0,0 +1,23 @@
cmake_minimum_required(VERSION 2.6)
PROJECT(rpcd-mod-luci C)
ADD_DEFINITIONS(-Os -Wall -Werror --std=gnu99 -g3 -Wmissing-declarations)
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
IF(APPLE)
INCLUDE_DIRECTORIES(/opt/local/include)
LINK_DIRECTORIES(/opt/local/lib)
ENDIF()
IF (NOT DEFINED LIBNL_LIBS)
FIND_LIBRARY(libnl NAMES libnl-3 libnl nl-3 nl)
SET(LIBNL_LIBS ${libnl})
ENDIF()
ADD_LIBRARY(rpcd-mod-luci MODULE luci.c)
TARGET_LINK_LIBRARIES(rpcd-mod-luci ubox ubus uci dl ${LIBNL_LIBS})
SET_TARGET_PROPERTIES(rpcd-mod-luci PROPERTIES OUTPUT_NAME luci PREFIX "")
INSTALL(TARGETS rpcd-mod-luci LIBRARY DESTINATION lib)

File diff suppressed because it is too large Load Diff