From a61a450e8c92aa78f7755049c469601b52a8deda Mon Sep 17 00:00:00 2001 From: Artem Prilutskiy Date: Tue, 2 Aug 2016 10:08:52 +0300 Subject: [PATCH] Added Makefile to build OpenWRT package --- OpenWRT/package/Makefile | 63 ++++++++++++++++++++++++++++++++++++++++ cronosagent.sh | 4 +-- 2 files changed, 65 insertions(+), 2 deletions(-) create mode 100644 OpenWRT/package/Makefile diff --git a/OpenWRT/package/Makefile b/OpenWRT/package/Makefile new file mode 100644 index 0000000..8f7a43d --- /dev/null +++ b/OpenWRT/package/Makefile @@ -0,0 +1,63 @@ +include $(TOPDIR)/rules.mk + +PKG_NAME:=cronosagent +PKG_VERSION:=master +PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_PROTO:=git +PKG_SOURCE_URL:=git@code.brandmeister.network:r3abm/CronosAgent.git +PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION) +PKG_SOURCE_VERSION:=HEAD +PKG_SOURCE:=$(PKG_NAME).tar.gz +PKG_BUILD_DEPENDS:=+libstdcpp +libopenssl + +include $(INCLUDE_DIR)/package.mk + +define Package/cronosagent +SECTION:=net +CATEGORY:=Network +TITLE:=CronosAgent +URL:=https://brandmeister.network/ +DEPENDS:=+libstdcpp +libopenssl +endef + +define Package/cronosagent/description + CronosAgent for BrandMeister DMR Master Server + Allows to connect Radio Activity KAIROS Repetaters to BrandMeister DMR Master Server + Radio Activity KAIROS should have built-in feature of External Server Access + which is available on firmware customization 008 (Radio Amateur community) +endef + +#define Build/cronosagent/Compile +#$(call Build/Compile/Default, -C $(PKG_BUILD_DIR) ) +#endef + +define Package/cronosagent/conffiles + /etc/config/cronosagent +endef + +define Package/cronosagent/postinst + #!/bin/sh + /etc/init.d/cronosagent enable +endef + +define Package/cronosagent/prerm + #!/bin/sh + /etc/init.d/cronosagent disable +endef + +define Package/cronosagent/install + $(INSTALL_DIR) $(1)/opt/CronosAgent + $(INSTALL_DIR) $(1)/etc/init.d + $(INSTALL_DIR) $(1)/etc/config + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/controller + $(INSTALL_DIR) $(1)/usr/lib/lua/luci/model/cbi/cronosagent + $(INSTALL_BIN) $(BUILD_DIR)/cronosagent.sh $(1)/opt/CronosAgent/ + $(INSTALL_BIN) $(PKG_BUILD_DIR)/cronosagent $(1)/opt/CronosAgent/ + $(INSTALL_BIN) $(BUILD_DIR)/OpenWRT/init.d/cronosagent $(1)/etc/init.d/ + $(INSTALL_DATA) $(BUILD_DIR)/OpenWRT/config/cronosagent $(1)/etc/config/ + $(INSTALL_DATA) $(BUILD_DIR)/OpenWRT/controller/cronosagent.lua $(1)/usr/lib/lua/luci/controller/ + $(INSTALL_DATA) $(BUILD_DIR)/OpenWRT/model/cbi/cronosagent/configure.lua $(1)/usr/lib/lua/luci/model/cbi/cronosagent/ +endef + +$(eval $(call BuildPackage,cronosagent)) + diff --git a/cronosagent.sh b/cronosagent.sh index d30b06c..ce8148e 100755 --- a/cronosagent.sh +++ b/cronosagent.sh @@ -6,9 +6,9 @@ then source cronosagent.conf fi -if [ -f /etc/config/brandmeister ] +if [ -f /etc/config/cronosagent ] then - # Read configuration from uCI/LuCI on OpenWRT + # Read configuration from uci/LuCI on OpenWRT REPEATER_NUMBER=$(uci get cronosagent.@cronosagent[0].number) REPEATER_ADDRESS=$(uci get cronosagent.@cronosagent[0].repeaterAddress) SERVER_ADDRESS=$(uci get cronosagent.@cronosagent[0].serverAddress)