#
# luci-app-shater — thin LuCI launcher for the Shater v0.2 stack.
#
# A deliberately minimal, client-side-JS LuCI app (no server-side Lua CBI): one
# page under Services that shows a mini data-plane dashboard and an "Open panel"
# button. The RICH UI is the separate embedded admin panel served by shaterd on
# its own port; this app only (a) reads `shaterd status` and (b) mints a single-
# use handoff token so the browser can open the panel with a session
# (docs-shater/ARCHITECTURE.md §2).
#
# Backend: a tiny rpcd exec plugin (root/usr/libexec/rpcd/shater) that shells out
# to the `shaterd` CLI (`status`, `mint-token`) — no AF_UNIX client needed on the
# router. Pure data + scripts => PKGARCH:=all.
#
# luci.mk (auto package def, JS minify, i18n subpackages, cache-clear postinst)
# lives in the luci feed. This package is built OUT OF TREE (openwrt/), copied
# into the OpenWrt/SDK tree with the luci feed installed, so we include it via the
# canonical feeds path rather than the in-feed-relative `../../luci.mk`.
#

include $(TOPDIR)/rules.mk

LUCI_TITLE:=LuCI thin launcher for Shater (mini dashboard + panel handoff)
LUCI_DEPENDS:=+shater-core +rpcd
LUCI_PKGARCH:=all

# Version comes from the git tag via ci/version.sh -> SHATER_PKG_VERSION /
# SHATER_PKG_RELEASE in the SDK build env (see openwrt/shaterd/Makefile for the
# full rationale — bug B4). The literals are the manual/offline fallback only.
# These MUST stay above the luci.mk include: luci.mk only defaults PKG_VERSION/
# PKG_RELEASE when they are still unset, and the i18n subpackages inherit them.
PKG_VERSION:=$(if $(SHATER_PKG_VERSION),$(SHATER_PKG_VERSION),0.2.0)
PKG_RELEASE:=$(if $(SHATER_PKG_RELEASE),$(SHATER_PKG_RELEASE),1)

PKG_MAINTAINER:=Shater <maqrota@icloud.com>
PKG_LICENSE:=GPL-3.0-or-later

include $(TOPDIR)/feeds/luci/luci.mk

# call BuildPackage - OpenWrt buildroot signature to be used by luci.mk
