Makefile 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. # luci-app-netpulse OpenWrt Makefile (Fase 11)
  2. # Paquete LuCI de solo ficheros (JS/JSON/ucode, PKGARCH:=all): vista de nodo
  3. # del agente NetPulse. Makefile plano a propósito (no luci.mk): construye en
  4. # el SDK pelado igual que netpulse-agent, sin necesitar el feed luci en el
  5. # host de build. Las dependencias (luci-base) se resuelven al instalar.
  6. #
  7. # Uso (desde el SDK o buildroot de OpenWrt):
  8. # cp -r luci-app-netpulse package/
  9. # make package/luci-app-netpulse/compile V=s
  10. #
  11. # O empaquetado directo sin buildroot: deploy/openwrt/package-luci.sh
  12. include $(TOPDIR)/rules.mk
  13. PKG_NAME:=luci-app-netpulse
  14. # ?= so the CI can override the version from the release tag via the env
  15. # (PKG_VERSION / PKG_RELEASE); falls back to these defaults for local builds.
  16. PKG_VERSION?=2.7.2
  17. PKG_RELEASE?=1
  18. PKG_LICENSE:=AGPL-3.0-only
  19. PKG_MAINTAINER:=Nacho <netpulse@cloudless.club>
  20. PKGARCH:=all
  21. include $(INCLUDE_DIR)/package.mk
  22. define Package/luci-app-netpulse
  23. SECTION:=luci
  24. CATEGORY:=LuCI
  25. SUBMENU:=3. Applications
  26. TITLE:=Node-local NetPulse agent view for LuCI
  27. URL:=https://github.com/gnacho/netpulse
  28. DEPENDS:=+luci-base +netpulse-agent
  29. PKGARCH:=all
  30. endef
  31. define Package/luci-app-netpulse/description
  32. LuCI pages for the NetPulse agent on THIS router: procd status,
  33. binary version, RSS, heartbeat, recent syslog lines, restart button
  34. and editable UCI configuration, plus a link to the NetPulse web app
  35. (network-wide view). Modern client-rendered LuCI (JS views + ucode
  36. rpcd plugin); adds no HTTP listener or resident memory to the agent.
  37. endef
  38. # Sin compilación: todo son ficheros de texto.
  39. define Build/Compile
  40. endef
  41. define Package/luci-app-netpulse/install
  42. $(INSTALL_DIR) $(1)/www/luci-static/resources/view/netpulse
  43. $(INSTALL_DATA) ./files/www/luci-static/resources/view/netpulse/status.js $(1)/www/luci-static/resources/view/netpulse/
  44. $(INSTALL_DATA) ./files/www/luci-static/resources/view/netpulse/settings.js $(1)/www/luci-static/resources/view/netpulse/
  45. $(INSTALL_DIR) $(1)/usr/share/luci/menu.d
  46. $(INSTALL_DATA) ./files/usr/share/luci/menu.d/luci-app-netpulse.json $(1)/usr/share/luci/menu.d/
  47. $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
  48. $(INSTALL_DATA) ./files/usr/share/rpcd/acl.d/luci-app-netpulse.json $(1)/usr/share/rpcd/acl.d/
  49. $(INSTALL_DIR) $(1)/usr/libexec/rpcd
  50. $(INSTALL_BIN) ./files/usr/libexec/rpcd/luci.netpulse $(1)/usr/libexec/rpcd/luci.netpulse
  51. endef
  52. # rpcd descubre los plugins exec al arrancar y LuCI cachea el menú:
  53. # recargar ambos en instalación real (no en imagebuilder, $IPKG_INSTROOT).
  54. define Package/luci-app-netpulse/postinst
  55. #!/bin/sh
  56. if [ -z "$${IPKG_INSTROOT}" ]; then
  57. /etc/init.d/rpcd restart 2>/dev/null || true
  58. rm -f /tmp/luci-indexcache* 2>/dev/null || true
  59. fi
  60. exit 0
  61. endef
  62. define Package/luci-app-netpulse/postrm
  63. #!/bin/sh
  64. if [ -z "$${IPKG_INSTROOT}" ]; then
  65. /etc/init.d/rpcd restart 2>/dev/null || true
  66. rm -f /tmp/luci-indexcache* 2>/dev/null || true
  67. fi
  68. exit 0
  69. endef
  70. $(eval $(call BuildPackage,luci-app-netpulse))