|
|
@@ -101,52 +101,75 @@ POSTRM
|
|
|
echo " IPK: $(ls "$OUT_DIR"/luci-app-netpulse_*.ipk)"
|
|
|
|
|
|
elif [ "$FORMAT" = "apk" ]; then
|
|
|
- echo " Building .apk (arch all via ipkg-build)..."
|
|
|
- # El .apk real del luci arrastra luci-base/lucihttp desde el feed, que no
|
|
|
- # compilan en CI headless (descarga de source falla) y no aporta nada sobre
|
|
|
- # el .ipk arch-all: el contenido es el mismo (solo ficheros, sin binario).
|
|
|
- # Se genera el paquete con ipkg-build y se renombra a .apk para que el job
|
|
|
- # CI lo suba con la extensión que espera.
|
|
|
- PKG_DIR="$WORK_DIR/luci-app-netpulse-pkg"
|
|
|
- mkdir -p "$PKG_DIR/CONTROL"
|
|
|
- cp -r "$APP_DIR/files/." "$PKG_DIR/"
|
|
|
- chmod 755 "$PKG_DIR/usr/libexec/rpcd/luci.netpulse"
|
|
|
-
|
|
|
- cat > "$PKG_DIR/CONTROL/control" << CTRL
|
|
|
-Package: luci-app-netpulse
|
|
|
-Version: ${PKG_VERSION:-0.0.0}-${PKG_RELEASE:-1}
|
|
|
-Depends: luci-base, netpulse-agent
|
|
|
-License: AGPL-3.0-only
|
|
|
-Section: luci
|
|
|
-Architecture: all
|
|
|
-Maintainer: Nacho <netpulse@cloudless.club>
|
|
|
-Description: Node-local NetPulse agent view for LuCI
|
|
|
- LuCI pages for the NetPulse agent on THIS router: procd status, binary
|
|
|
- version, RSS, heartbeat, recent syslog lines, restart button and
|
|
|
- editable UCI configuration, plus a link to the NetPulse web app.
|
|
|
-CTRL
|
|
|
-
|
|
|
- cat > "$PKG_DIR/CONTROL/postinst" << 'POSTINST'
|
|
|
+ echo " Building .apk (real apk v3 via 25.12 SDK)..."
|
|
|
+ # #468: renaming an ipk to .apk does NOT work: apk-tools v3 on the router
|
|
|
+ # refuses the ipk bytes with "v2 package format error". Build a real v3
|
|
|
+ # package with the SDK, same source-less Makefile pattern package.sh uses
|
|
|
+ # for netpulse-agent: files staged under files/, no-op Build/Compile, and
|
|
|
+ # the SDK's own `apk mkpkg` produces the signed-v3 tarball. Dependencies
|
|
|
+ # are recorded as metadata; the SDK does not need them present.
|
|
|
+ PKG_DIR_SDK="$SDK_DIR/package/utils/luci-app-netpulse"
|
|
|
+ mkdir -p "$PKG_DIR_SDK/files"
|
|
|
+ cp -r "$APP_DIR/files/." "$PKG_DIR_SDK/files/"
|
|
|
+ chmod 755 "$PKG_DIR_SDK/files/usr/libexec/rpcd/luci.netpulse"
|
|
|
+ cat > "$PKG_DIR_SDK/Makefile" << 'MAKE'
|
|
|
+include $(TOPDIR)/rules.mk
|
|
|
+
|
|
|
+PKG_NAME:=luci-app-netpulse
|
|
|
+PKG_VERSION:=@PKG_VERSION@
|
|
|
+PKG_RELEASE:=@PKG_RELEASE@
|
|
|
+
|
|
|
+PKG_LICENSE:=AGPL-3.0-only
|
|
|
+PKG_MAINTAINER:=Nacho <netpulse@cloudless.club>
|
|
|
+
|
|
|
+include $(INCLUDE_DIR)/package.mk
|
|
|
+
|
|
|
+define Package/luci-app-netpulse
|
|
|
+ SECTION:=luci
|
|
|
+ CATEGORY:=LuCI
|
|
|
+ TITLE:=Node-local NetPulse agent view for LuCI
|
|
|
+ URL:=https://github.com/gnacho/netpulse
|
|
|
+ DEPENDS:=+luci-base +netpulse-agent
|
|
|
+ PKGARCH:=all
|
|
|
+endef
|
|
|
+
|
|
|
+define Package/luci-app-netpulse/description
|
|
|
+ LuCI pages for the NetPulse agent on this router: procd status,
|
|
|
+ binary version, RSS, heartbeat, recent syslog lines, restart button
|
|
|
+ and editable UCI configuration, plus a link to the NetPulse web app.
|
|
|
+endef
|
|
|
+
|
|
|
+define Build/Compile
|
|
|
+endef
|
|
|
+
|
|
|
+define Package/luci-app-netpulse/install
|
|
|
+ $(INSTALL_DIR) $(1)/usr/share/luci/menu.d
|
|
|
+ $(INSTALL_DATA) ./files/usr/share/luci/menu.d/luci-app-netpulse.json $(1)/usr/share/luci/menu.d/
|
|
|
+ $(INSTALL_DIR) $(1)/usr/share/rpcd/acl.d
|
|
|
+ $(INSTALL_DATA) ./files/usr/share/rpcd/acl.d/luci-app-netpulse.json $(1)/usr/share/rpcd/acl.d/
|
|
|
+ $(INSTALL_DIR) $(1)/usr/libexec/rpcd
|
|
|
+ $(INSTALL_BIN) ./files/usr/libexec/rpcd/luci.netpulse $(1)/usr/libexec/rpcd/
|
|
|
+ $(INSTALL_DIR) $(1)/www/luci-static/resources/view/netpulse
|
|
|
+ $(INSTALL_DATA) ./files/www/luci-static/resources/view/netpulse/*.js $(1)/www/luci-static/resources/view/netpulse/
|
|
|
+endef
|
|
|
+
|
|
|
+define Package/luci-app-netpulse/postinst
|
|
|
#!/bin/sh
|
|
|
-[ -n "$IPKG_INSTROOT" ] && exit 0
|
|
|
+[ -n "$${IPKG_INSTROOT}" ] && exit 0
|
|
|
/etc/init.d/rpcd restart 2>/dev/null || true
|
|
|
rm -f /tmp/luci-indexcache* 2>/dev/null || true
|
|
|
exit 0
|
|
|
-POSTINST
|
|
|
- chmod 755 "$PKG_DIR/CONTROL/postinst"
|
|
|
+endef
|
|
|
|
|
|
- cat > "$PKG_DIR/CONTROL/postrm" << 'POSTRM'
|
|
|
-#!/bin/sh
|
|
|
-[ -n "$IPKG_INSTROOT" ] && exit 0
|
|
|
-/etc/init.d/rpcd restart 2>/dev/null || true
|
|
|
-rm -f /tmp/luci-indexcache* 2>/dev/null || true
|
|
|
-exit 0
|
|
|
-POSTRM
|
|
|
- chmod 755 "$PKG_DIR/CONTROL/postrm"
|
|
|
+$(eval $(call BuildPackage,luci-app-netpulse))
|
|
|
+MAKE
|
|
|
+ sed -i "s/@PKG_VERSION@/${PKG_VERSION:-0.0.0}/; s/@PKG_RELEASE@/${PKG_RELEASE:-1}/" "$PKG_DIR_SDK/Makefile"
|
|
|
|
|
|
- "$SDK_DIR/scripts/ipkg-build" "$PKG_DIR" "$OUT_DIR"
|
|
|
- # Renombra el .ipk arch-all a .apk para el upload del job CI.
|
|
|
- cp "$OUT_DIR"/luci-app-netpulse_*.ipk "$OUT_DIR/luci-app-netpulse_${PKG_VERSION:-0.0.0}-${PKG_RELEASE:-1}_all.apk"
|
|
|
+ cd "$SDK_DIR"
|
|
|
+ # .config válido sin terminal (menuconfig muere en CI headless).
|
|
|
+ make defconfig >/dev/null 2>&1 || true
|
|
|
+ make package/luci-app-netpulse/compile V=s 2>&1 | tail -20
|
|
|
+ find bin/packages -name "luci-app-netpulse*.apk" -exec cp {} "$OUT_DIR/" \;
|
|
|
echo " APK: $(ls "$OUT_DIR"/luci-app-netpulse*.apk 2>/dev/null || echo 'NOT FOUND')"
|
|
|
|
|
|
else
|