|
@@ -101,18 +101,52 @@ POSTRM
|
|
|
echo " IPK: $(ls "$OUT_DIR"/luci-app-netpulse_*.ipk)"
|
|
echo " IPK: $(ls "$OUT_DIR"/luci-app-netpulse_*.ipk)"
|
|
|
|
|
|
|
|
elif [ "$FORMAT" = "apk" ]; then
|
|
elif [ "$FORMAT" = "apk" ]; then
|
|
|
- echo " Building .apk via SDK..."
|
|
|
|
|
- cp -r "$APP_DIR" "$SDK_DIR/package/luci-app-netpulse"
|
|
|
|
|
-
|
|
|
|
|
- cd "$SDK_DIR"
|
|
|
|
|
- # luci-base is only an install dependency; index the luci feed so the SDK
|
|
|
|
|
- # resolver knows about it.
|
|
|
|
|
- ./scripts/feeds update luci 2>/dev/null || true
|
|
|
|
|
- ./scripts/feeds install luci-base 2>/dev/null || true
|
|
|
|
|
- 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 " 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'
|
|
|
|
|
+#!/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
|
|
|
|
|
+POSTINST
|
|
|
|
|
+ chmod 755 "$PKG_DIR/CONTROL/postinst"
|
|
|
|
|
+
|
|
|
|
|
+ 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"
|
|
|
|
|
+
|
|
|
|
|
+ "$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"
|
|
|
echo " APK: $(ls "$OUT_DIR"/luci-app-netpulse*.apk 2>/dev/null || echo 'NOT FOUND')"
|
|
echo " APK: $(ls "$OUT_DIR"/luci-app-netpulse*.apk 2>/dev/null || echo 'NOT FOUND')"
|
|
|
|
|
|
|
|
else
|
|
else
|