From 848f917a5ea57951eee0ae2df1a7f74b47fb08c6 Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Sun, 19 Feb 2023 04:43:43 +0000 Subject: [PATCH] libdht: add package Add Kademlia Distributed Hash Table (DHT) library. Signed-off-by: Daniel Golle (cherry picked from commit a281a8af9f7b74960a52a3e102fc636c0722b92c) --- libs/libdht/Makefile | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 libs/libdht/Makefile diff --git a/libs/libdht/Makefile b/libs/libdht/Makefile new file mode 100644 index 0000000000..f81847aa82 --- /dev/null +++ b/libs/libdht/Makefile @@ -0,0 +1,41 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=libdht +PKG_RELEASE:=1 + +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=https://github.com/jech/dht +PKG_SOURCE_DATE:=2022-04-27 +PKG_SOURCE_VERSION:=111230894416d400c9a1e038a033586bfeaafc93 +PKG_MIRROR_HASH:=71decd82023e0d3ec872604e9f0d709003906b38266990a8b1bb540907d1d3f0 + +PKG_LICENSE:=MIT +PKG_LICENSE_FILES:=LICENSE + +PKG_MAINTAINER:=Daniel Golle + +include $(INCLUDE_DIR)/package.mk + +define Package/libdht + SECTION:=libs + CATEGORY:=Libraries + TITLE:=Kademlia Distributed Hash Table (DHT) library +endef + +define Build/InstallDev + $(INSTALL_DIR) $(1)/usr/include/dht $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/dht.h $(1)/usr/include/dht + $(CP) $(PKG_BUILD_DIR)/libdht.so $(1)/usr/lib/ +endef + +define Package/libdht/install + $(INSTALL_DIR) $(1)/usr/lib + $(CP) $(PKG_BUILD_DIR)/libdht.so $(1)/usr/lib/ +endef + +define Build/Compile + $(TARGET_CC) $(FPIC) -Wall -c -o $(PKG_BUILD_DIR)/dht.o $(PKG_BUILD_DIR)/dht.c + $(TARGET_CC) -shared -lcrypt -o $(PKG_BUILD_DIR)/libdht.so $(PKG_BUILD_DIR)/dht.o +endef + +$(eval $(call BuildPackage,libdht)) -- 2.30.2