diff --git a/OpenWRT/build.sh b/OpenWRT/build.sh new file mode 100755 index 0000000..86e428e --- /dev/null +++ b/OpenWRT/build.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +PACKAGE=cronosagent + +PROJECT=$(pwd)/.. +OPENWRT=${HOME}/openwrt + +rm -rf $OPENWRT/package/$PACKAGE +mkdir -p $OPENWRT/package/$PACKAGE/source +cp -R $PROJECT $OPENWRT/package/$PACKAGE/source +rm $OPENWRT/package/$PACKAGE/source/OpenWRT/package/Makefile +rm -rf $OPENWRT/package/$PACKAGE/source/.git + +pushd . + +cd $OPENWRT +make + +popd \ No newline at end of file diff --git a/OpenWRT/model/cbi/cronosagent/configure.lua b/OpenWRT/model/cbi/cronosagent/configure.lua index 7d33e4d..a4043e4 100644 --- a/OpenWRT/model/cbi/cronosagent/configure.lua +++ b/OpenWRT/model/cbi/cronosagent/configure.lua @@ -5,7 +5,7 @@ local section = map:section(TypedSection, "cronosagent", "Configuration") local number = section:option(Value, "number", "Repeater ID", "DMR ID assigned to your repeater" ) local repeater = section:option(Value, "repeaterAddress", "Repeater Address", "Address of your KAIROS repeater" ) local server = section:option(Value, "serverAddress", "Server address", "Address of BrandMeister DMR Server") -local password = section:option(Value, "serverPassword", "Password", "Password to login" ) +local password = section:option(Value, "serverPassword", "Password", "Password to login to the server" ) number.datatype = "range(1,16777215)" repeater.datatype = "ip4addr" diff --git a/OpenWRT/package/Makefile b/OpenWRT/package/Makefile index 8f7a43d..b03a9dc 100644 --- a/OpenWRT/package/Makefile +++ b/OpenWRT/package/Makefile @@ -3,12 +3,8 @@ 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 +X_SOURCE_DIR:=$(CURDIR)/source include $(INCLUDE_DIR)/package.mk @@ -27,8 +23,14 @@ define Package/cronosagent/description which is available on firmware customization 008 (Radio Amateur community) endef -#define Build/cronosagent/Compile -#$(call Build/Compile/Default, -C $(PKG_BUILD_DIR) ) +define Build/Prepare + mkdir -p $(PKG_BUILD_DIR) + $(CP) -R $(X_SOURCE_DIR)/*.h $(PKG_BUILD_DIR)/ + $(CP) -R $(X_SOURCE_DIR)/*.c $(PKG_BUILD_DIR)/ +endef + +#define Build/Compile +# $(call Build/Compile/Default, -C $(PKG_BUILD_DIR) ) #endef define Package/cronosagent/conffiles @@ -51,12 +53,12 @@ define Package/cronosagent/install $(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) $(X_SOURCE_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/ + $(INSTALL_BIN) $(X_SOURCE_DIR)/OpenWRT/init.d/cronosagent $(1)/etc/init.d/ + $(INSTALL_DATA) $(X_SOURCE_DIR)/OpenWRT/config/cronosagent $(1)/etc/config/ + $(INSTALL_DATA) $(X_SOURCE_DIR)/OpenWRT/controller/cronosagent.lua $(1)/usr/lib/lua/luci/controller/ + $(INSTALL_DATA) $(X_SOURCE_DIR)/OpenWRT/model/cbi/cronosagent/configure.lua $(1)/usr/lib/lua/luci/model/cbi/cronosagent/ endef $(eval $(call BuildPackage,cronosagent)) diff --git a/OpenWRT/readme.txt b/OpenWRT/readme.txt index eabcdd2..17797da 100644 --- a/OpenWRT/readme.txt +++ b/OpenWRT/readme.txt @@ -2,3 +2,7 @@ /usr/lib/lua/luci/model/cbi/cronosagent/configure.lua /etc/config/cronosagent /etc/init.d/cronosagent + +Copy OpenWRT/package/Makefile -> ~/openwrt/packages/cronosagent/Makefile +Copy * -> ~/openwrt/packages/cronosagent/source/* +Remove ~/openwrt/packages/cronosagent/source/OpenWRT/package/Makefile \ No newline at end of file