Makefile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=client2server-unified
  3. PKG_VERSION:=2.0.0
  4. PKG_RELEASE:=1
  5. PKG_LICENSE:=MIT
  6. PKG_MAINTAINER:=Luis Rosales <lrosales@techno-world.net>
  7. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
  8. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  9. PKG_SOURCE_URL:=https://git3.techno-world.net/lrosales/client2server
  10. include $(INCLUDE_BASE)/package
  11. define Package/$(PKG_NAME)
  12. SECTION:=utils
  13. CATEGORY:=Utilities
  14. TITLE:=Event forwarder for OpenWrt to central server
  15. DESCRIPTION:=All-in-one Lua event forwarder that monitors DHCP, WAN link, and forwards to central server via WebSocket with offline buffering
  16. DEPENDS:=+lua +luasocket +openssl-util
  17. TITLE:=Client2Server Unified
  18. endef
  19. define Package/$(PKG_NAME)/description
  20. All-in-one Lua event forwarder for OpenWrt routers.
  21. Features:
  22. - WebSocket connection with auto-reconnect
  23. - Local buffer (store-and-forward while offline)
  24. - DHCP lease events (new/expire)
  25. - WAN link state monitoring
  26. - DHCP IP changes (new ISP detection)
  27. endef
  28. define Build/Prepare
  29. mkdir -p $(PKG_BUILD_DIR)
  30. $(CP) ./src/* $(PKG_BUILD_DIR)/
  31. chmod +x $(PKG_BUILD_DIR)/*
  32. endef
  33. define Build/Configure
  34. endef
  35. define Build/Compile
  36. endef
  37. define Package/$(PKG_NAME)/install
  38. $(CP) $(PKG_BUILD_DIR)/* $(1)/usr/sbin/
  39. chmod +x $(1)/usr/sbin/*.lua
  40. # Init script
  41. $(INSTALL_DIR) $(1)/etc/init.d
  42. $(INSTALL_BIN) ./files/etc/init.d/client2server $(1)/etc/init.d/client2server
  43. # Config
  44. $(INSTALL_DIR) $(1)/etc/config
  45. $(INSTALL_DATA) ./files/etc/config/client2server $(1)/etc/config/client2server
  46. endef
  47. $(eval $(call BuildPackage,$(PKG_NAME)))