From a4d4dca08dbe06a87a6362526d9710004eba7f2e Mon Sep 17 00:00:00 2001 From: Carlo Baratto Date: Mon, 12 Oct 2026 15:58:10 +0200 Subject: [PATCH] Pacchetto armv7hl e pubblicazione per architettura - publish-rpm.sh: pubblica harbour-thinq-.rpm e verifica l'impronta di ogni architettura; per aarch64 aggiorna anche harbour-thinq.rpm, cosi' il link storico salvato sul telefono continua a servire la versione giusta - store/: documentate le due architetture con i link di download - store/: note su come compilare i due target in sequenza Il pacchetto armv7hl della 0.2.5 e' stato ricompilato dopo la correzione dello script di build: conteneva un binario aarch64 (make non ricompilava riusando gli oggetti della build precedente). Ora verificato: ELF ARM 32 bit, licenza MIT. --- scripts/publish-rpm.sh | 94 +++++++++++++++++++++++++----------------- store/README.md | 24 +++++++++++ store/description.md | 7 +++- 3 files changed, 86 insertions(+), 39 deletions(-) diff --git a/scripts/publish-rpm.sh b/scripts/publish-rpm.sh index d3ec316..9ff68a2 100644 --- a/scripts/publish-rpm.sh +++ b/scripts/publish-rpm.sh @@ -1,7 +1,8 @@ #!/bin/sh -# Pubblica l'RPM di harbour-thinq su Nextcloud a un percorso FISSO, cosi' il -# link pubblico resta lo stesso ad ogni versione (l'utente lo scarica dal -# telefono con un tocco solo). +# Pubblica l'RPM di harbour-thinq su Nextcloud a percorsi FISSI, uno per +# architettura, cosi' il link pubblico resta lo stesso ad ogni versione. +# Per aarch64 aggiorna anche il nome storico harbour-thinq.rpm: il link gia' +# salvato sul telefono deve continuare a funzionare. # # Uso: sh scripts/publish-rpm.sh [percorso-rpm] set -e @@ -10,26 +11,36 @@ APP=harbour-thinq TOKEN=$(cat /home/kaneda/.hermes/profiles/carlo/skills/nextcloud-calendar/token.secret) NC=https://nextcloud.hackatoniclife.com DAV="$NC/remote.php/dav/files/carlo/ThinQ" -RPM_DIR=/home/kaneda/workspace/Carlo/AppSailfish/pacchetti/rpm-SailfishOS-5.1.0.11-aarch64 +BASE=/home/kaneda/workspace/Carlo/AppSailfish/pacchetti -RPM=${1:-$(ls -t "$RPM_DIR"/$APP-*.aarch64.rpm 2>/dev/null | head -1)} +# senza argomento: il pacchetto piu' recente fra tutti i target compilati +if [ -n "$1" ]; then + RPM="$1" +else + RPM=$(ls -t "$BASE"/rpm-*/$APP-*.rpm 2>/dev/null | head -1) +fi [ -f "$RPM" ] || { echo "RPM non trovato: $RPM" >&2; exit 1; } +case "$RPM" in + *armv7hl*) ARCH=armv7hl ;; + *aarch64*) ARCH=aarch64 ;; + *) echo "architettura non riconosciuta in $RPM" >&2; exit 1 ;; +esac + LOCAL_SHA=$(sha256sum "$RPM" | cut -d' ' -f1) echo "RPM locale: $RPM" -echo "sha256 : $LOCAL_SHA" +echo "arch : $ARCH" +echo "sha256 : $LOCAL_SHA" -# cartella remota (MKCOL e' idempotente: 405 se esiste gia') -curl -s -o /dev/null -w "MKCOL %{http_code}\n" -u "carlo:$TOKEN" -X MKCOL "$DAV/" - -# upload: PUT sullo stesso percorso mantiene lo share esistente -curl -s -o /dev/null -w "PUT %{http_code}\n" -u "carlo:$TOKEN" \ - -T "$RPM" -H "Content-Type: application/x-rpm" "$DAV/$APP.rpm" - -# share pubblico: lo si riusa se esiste, altrimenti lo si crea (shareType=3) -SHARE=$(curl -s -u "carlo:$TOKEN" -H "OCS-APIRequest: true" \ - "$NC/ocs/v2.php/apps/files_sharing/api/v1/shares?path=/ThinQ/$APP.rpm&format=json") -TOK=$(printf '%s' "$SHARE" | python3 -c " +# carica un file col nome dato, riusa o crea lo share pubblico e verifica +# che il download anonimo serva proprio quella impronta +publish() { + REMOTE_NAME="$1" + curl -s -o /dev/null -w "PUT %{http_code} $REMOTE_NAME\n" -u "carlo:$TOKEN" \ + -T "$RPM" -H "Content-Type: application/x-rpm" "$DAV/$REMOTE_NAME" + SHARE=$(curl -s -u "carlo:$TOKEN" -H "OCS-APIRequest: true" \ + "$NC/ocs/v2.php/apps/files_sharing/api/v1/shares?path=/ThinQ/$REMOTE_NAME&format=json") + TOK=$(printf '%s' "$SHARE" | python3 -c " import json,sys try: d = json.load(sys.stdin) @@ -37,29 +48,36 @@ try: print(items[0]['token'] if items else '') except Exception: print('')") - -if [ -z "$TOK" ]; then - SHARE=$(curl -s -X POST "$NC/ocs/v2.php/apps/files_sharing/api/v1/shares" \ - -u "carlo:$TOKEN" -H "OCS-APIRequest: true" \ - -d "path=/ThinQ/$APP.rpm" -d "shareType=3" -d "permissions=1" -d "format=json") - TOK=$(printf '%s' "$SHARE" | python3 -c " + if [ -z "$TOK" ]; then + SHARE=$(curl -s -X POST "$NC/ocs/v2.php/apps/files_sharing/api/v1/shares" \ + -u "carlo:$TOKEN" -H "OCS-APIRequest: true" \ + -d "path=/ThinQ/$REMOTE_NAME" -d "shareType=3" -d "permissions=1" -d "format=json") + TOK=$(printf '%s' "$SHARE" | python3 -c " import json,sys print(json.load(sys.stdin)['ocs']['data']['token'])") - echo "share creato" -else - echo "share riusato" -fi + echo "share creato" + else + echo "share riusato" + fi + echo "link: $NC/s/$TOK" + curl -sL -o /tmp/$APP-$ARCH-check.rpm "$NC/s/$TOK/download" + curl -s -o /dev/null -w "pagina pubblica %{http_code}\n" "$NC/s/$TOK" + REMOTE_SHA=$(sha256sum /tmp/$APP-$ARCH-check.rpm | cut -d' ' -f1) + echo "sha256 scaricato: $REMOTE_SHA" + if [ "$LOCAL_SHA" = "$REMOTE_SHA" ]; then + echo "OK: il link serve la versione compilata" + else + echo "ATTENZIONE: impronte diverse" >&2 + exit 1 + fi +} -echo "link: $NC/s/$TOK" +# cartella remota (MKCOL e' idempotente: 405 se esiste gia') +curl -s -o /dev/null -w "MKCOL %{http_code}\n" -u "carlo:$TOKEN" -X MKCOL "$DAV/" -# verifica anonima: il download deve dare 200 e la STESSA impronta -curl -sL -o /tmp/$APP-check.rpm "$NC/s/$TOK/download" -curl -s -o /dev/null -w "pagina pubblica %{http_code}\n" "$NC/s/$TOK" -REMOTE_SHA=$(sha256sum /tmp/$APP-check.rpm | cut -d' ' -f1) -echo "sha256 scaricato: $REMOTE_SHA" -if [ "$LOCAL_SHA" = "$REMOTE_SHA" ]; then - echo "OK: il link serve la versione compilata" -else - echo "ATTENZIONE: impronte diverse" >&2 - exit 1 +publish "$APP-$ARCH.rpm" + +# nome storico: il link gia' salvato sul telefono continua a servire aarch64 +if [ "$ARCH" = aarch64 ]; then + publish "$APP.rpm" fi diff --git a/store/README.md b/store/README.md index 33ddce4..f555a68 100644 --- a/store/README.md +++ b/store/README.md @@ -48,3 +48,27 @@ Harbour ammette l'installazione solo in `/usr/bin/`, `/usr/share/applications/.desktop`, `/usr/share/icons/hicolor/...` e `/usr/share//*`. La licenza sta quindi in `/usr/share/harbour-thinq/LICENSE` e non in `/usr/share/doc/`, che non รจ un percorso ammesso. + +## I due pacchetti da caricare + +Servono entrambe le architetture, compilate dagli stessi sorgenti: + +``` +SFOS_TARGET=SailfishOS-5.1.0.11-aarch64 ./build-rpm.sh harbour-thinq +SFOS_TARGET=SailfishOS-5.1.0.11-armv7hl ./build-rpm.sh harbour-thinq +``` + +| architettura | file | download | +|---|---|---| +| aarch64 (telefoni a 64 bit) | `harbour-thinq-0.2.5-1.aarch64.rpm` | https://nextcloud.hackatoniclife.com/s/kXmJFokw9Ld6HNs | +| armv7hl (telefoni a 32 bit) | `harbour-thinq-0.2.5-1.armv7hl.rpm` | https://nextcloud.hackatoniclife.com/s/MPHaQLmfLSrZkMR | + +Il link storico `https://nextcloud.hackatoniclife.com/s/CEa532KmSKKRrrn` resta +valido e serve sempre la versione aarch64. + +**Attenzione alle due build in sequenza**: la compilazione avviene dentro la +cartella del progetto, quindi la seconda trova gli oggetti della prima, `make` +non ricompila e il pacchetto esce con il binario dell'altra architettura dentro. +`build-rpm.sh` ora pulisce gli artefatti prima di ogni build; se compili a mano, +pulisci (`*.o`, `moc_*.cpp`, `Makefile`, binario) e verifica l'architettura del +pacchetto prima di caricarlo. diff --git a/store/description.md b/store/description.md index c3d39b5..1c49037 100644 --- a/store/description.md +++ b/store/description.md @@ -67,7 +67,12 @@ MIT. Source code available. ## Notes for the submission form -* **Binary**: `harbour-thinq--1.aarch64.rpm`. +* **Binary**: one package per architecture, both from the same sources: + `harbour-thinq--1.aarch64.rpm` (64-bit devices) and + `harbour-thinq--1.armv7hl.rpm` (32-bit devices). Compile them one + after the other only after cleaning the build artefacts: the build happens + inside the project folder, and a second target reusing the first target's + object files silently produces a package with the wrong binary inside. * **Icon**: taken from the package (86, 108, 128, 172 px). * **Screenshots**: the store wants real screenshots. Take them on the phone (volume down + power), then crop away the status bar. Vertical, 540x960 or