# # Copyright (C) 2015-2016 OpenWrt.org # Copyright (C) 2020 jjm2473@gmail.com # # This is free software, licensed under the GNU General Public License v3. # include $(TOPDIR)/rules.mk PKG_ARCH_kai:=$(ARCH) PKG_NAME:=kai PKG_VERSION:=0.0.28 PKG_RELEASE:=14 PKG_SOURCE:=$(PKG_NAME)-binary-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://github.com/istoreos/istoreos-app-hub/releases/download/kai-runtime-v$(PKG_VERSION)/ PKG_HASH:=skip PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-binary-$(PKG_VERSION) PKG_BUILD_PARALLEL:=1 PKG_USE_MIPS16:=0 include $(INCLUDE_DIR)/package.mk define Package/$(PKG_NAME) SECTION:=net CATEGORY:=System SUBMENU:= TITLE:=KAI DEPENDS:=+kai_session +kai-agent +luci-lib-linkeaseauth URL:=https://github.com/linkease/istore-ai-helper endef define Package/$(PKG_NAME)/description KAI provides the OpenCode gateway and embedded Web UI with packaged local skills. endef define Package/$(PKG_NAME)/conffiles /etc/config/kai endef define Package/$(PKG_NAME)/postinst #!/bin/sh # KaiPlus owns the desktop entry. Retire only links created by KAI. root="$${IPKG_INSTROOT:-}" for directory in /usr/share/linkease/apps.d /usr/share/linkeasefull/desktop-apps.d; do registration="$${root}$${directory}/05-kai-plugin.json" if [ "$$(readlink "$${registration}" 2>/dev/null)" = "/usr/share/kai/kai-plugin.json" ]; then rm -f "$${registration}" fi done rmdir "$${root}/usr/share/linkeasefull/desktop-apps.d" 2>/dev/null || true exit 0 endef define Package/$(PKG_NAME)/prerm #!/bin/sh root="$${IPKG_INSTROOT:-}" for directory in /usr/share/linkease/apps.d /usr/share/linkeasefull/desktop-apps.d; do registration="$${root}$${directory}/05-kai-plugin.json" if [ "$$(readlink "$${registration}" 2>/dev/null)" = "/usr/share/kai/kai-plugin.json" ]; then rm -f "$${registration}" fi done rmdir "$${root}/usr/share/linkeasefull/desktop-apps.d" 2>/dev/null || true exit 0 endef define Build/Configure endef define Build/Compile endef define Package/$(PKG_NAME)/install $(INSTALL_DIR) $(1)/usr/sbin $(1)/usr/libexec $(1)/etc/init.d $(1)/etc/config $(INSTALL_BIN) $(PKG_BUILD_DIR)/kai.$(PKG_ARCH_kai) $(1)/usr/sbin/kai_bin $(INSTALL_BIN) ./files/kai-session-launch $(1)/usr/libexec/kai-session-launch $(INSTALL_BIN) ./files/kai.init $(1)/etc/init.d/kai $(INSTALL_CONF) ./files/kai.config $(1)/etc/config/kai endef $(eval $(call BuildPackage,$(PKG_NAME)))