From d67c046eff29d39be9b32ad39b44cab6b54d9fcf Mon Sep 17 00:00:00 2001 From: syui Date: Tue, 3 Mar 2026 16:03:02 +0900 Subject: [PATCH] fix pkg ver --- .gitignore | 2 +- cfg/repo.sh | 73 ++++++++++++++++++++++++++++++++++++++++++++ pkg/aigpt/PKGBUILD | 9 ++++++ pkg/ailog/PKGBUILD | 9 ++++++ pkg/aishell/PKGBUILD | 9 ++++++ 5 files changed, 101 insertions(+), 1 deletion(-) create mode 100755 cfg/repo.sh diff --git a/.gitignore b/.gitignore index ff8707e..591b7bd 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,4 @@ root.x86_64/ archiso/ build.log .claude -/cfg/repo.sh +/.env diff --git a/cfg/repo.sh b/cfg/repo.sh new file mode 100755 index 0000000..c92716a --- /dev/null +++ b/cfg/repo.sh @@ -0,0 +1,73 @@ +#!/bin/zsh +set -e + +d=${0:a:h:h} +source $d/.env + +echo "=== Building and publishing packages on $HOST ===" +ssh "$HOST" zsh -s -- "$GPG_KEY" <<'REMOTE' +set -e +GPG_KEY="$1" +REPO_NAME="aios" +REPO_DIR="${HOME}/ai/repo" +WORK="${HOME}/aios-pkg" + +if [ ! -d "$REPO_DIR/.git" ]; then + git clone git@git.syui.ai:ai/repo.git "$REPO_DIR" + cd "$REPO_DIR" + git config user.email 'syui@syui.ai' + git config user.name 'syui' +fi + +cd "$REPO_DIR" +git config user.signingkey "$GPG_KEY" +git config commit.gpgsign true + +rm -rf "$WORK" +mkdir -p "$WORK" + +cd "$WORK" +git clone --depth 1 https://git.syui.ai/ai/os.git + +for pkg in ailog aigpt aishell; do + echo "=== Building $pkg ===" + cp -r "$WORK/os/pkg/$pkg" "$WORK/$pkg" + cd "$WORK/$pkg" + makepkg -sf --noconfirm --sign --key "$GPG_KEY" + cd "$WORK" +done + +mkdir -p "$REPO_DIR/x86_64" + +for pkg in ailog aigpt aishell; do + rm -f "$REPO_DIR/x86_64/${pkg}"-*.pkg.tar.zst + rm -f "$REPO_DIR/x86_64/${pkg}"-*.pkg.tar.zst.sig + rm -f "$REPO_DIR/x86_64/${pkg}-debug"-*.pkg.tar.zst + rm -f "$REPO_DIR/x86_64/${pkg}-debug"-*.pkg.tar.zst.sig + cp "$WORK"/"$pkg"/*.pkg.tar.zst "$REPO_DIR/x86_64/" + cp "$WORK"/"$pkg"/*.pkg.tar.zst.sig "$REPO_DIR/x86_64/" 2>/dev/null || true +done + +cd "$REPO_DIR/x86_64" +rm -f "${REPO_NAME}".{db,files}* +repo-add --sign --key "$GPG_KEY" "${REPO_NAME}.db.tar.gz" *.pkg.tar.zst +gpg --export "$GPG_KEY" > "$REPO_DIR/aios.gpg" + +for f in "${REPO_NAME}.db" "${REPO_NAME}.files" "${REPO_NAME}.db.sig" "${REPO_NAME}.files.sig"; do + if [ -L "$f" ]; then + target=$(readlink "$f") + rm "$f" + cp "$target" "$f" + fi +done +rm -f *.old *.old.sig + +cd "$REPO_DIR" +git add -A +git commit -m "update $(date +%Y.%m.%d)" || true +git push + +rm -rf "$WORK" + +echo "=== Done ===" +REMOTE diff --git a/pkg/aigpt/PKGBUILD b/pkg/aigpt/PKGBUILD index 51d5cb0..d1abe68 100644 --- a/pkg/aigpt/PKGBUILD +++ b/pkg/aigpt/PKGBUILD @@ -1,6 +1,7 @@ pkgname=aigpt pkgver=0.0.1 pkgrel=1 + pkgdesc='ai memory and personality system for aios' arch=('x86_64') url='https://git.syui.ai/ai/gpt' @@ -11,6 +12,14 @@ options=('!lto') source=("git+https://git.syui.ai/ai/gpt.git#branch=main") sha256sums=('SKIP') +pkgver() { + cd gpt + printf "%s.r%s.g%s" \ + "$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')" \ + "$(git rev-list --count HEAD)" \ + "$(git rev-parse --short HEAD)" +} + build() { cd gpt export CC=gcc diff --git a/pkg/ailog/PKGBUILD b/pkg/ailog/PKGBUILD index c2f0fb3..a5bed5b 100644 --- a/pkg/ailog/PKGBUILD +++ b/pkg/ailog/PKGBUILD @@ -1,6 +1,7 @@ pkgname=ailog pkgver=0.0.1 pkgrel=1 + pkgdesc='atproto blog cli for aios' arch=('x86_64') url='https://git.syui.ai/ai/log' @@ -11,6 +12,14 @@ options=('!lto') source=("git+https://git.syui.ai/ai/log.git#branch=main") sha256sums=('SKIP') +pkgver() { + cd log + printf "%s.r%s.g%s" \ + "$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')" \ + "$(git rev-list --count HEAD)" \ + "$(git rev-parse --short HEAD)" +} + build() { cd log export CC=gcc diff --git a/pkg/aishell/PKGBUILD b/pkg/aishell/PKGBUILD index 235b031..8d2618c 100644 --- a/pkg/aishell/PKGBUILD +++ b/pkg/aishell/PKGBUILD @@ -1,6 +1,7 @@ pkgname=aishell pkgver=0.0.1 pkgrel=1 + pkgdesc='custom shell for aios' arch=('x86_64') url='https://git.syui.ai/ai/shell' @@ -11,6 +12,14 @@ options=('!lto') source=("git+https://git.syui.ai/ai/shell.git#branch=main") sha256sums=('SKIP') +pkgver() { + cd shell + printf "%s.r%s.g%s" \ + "$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')" \ + "$(git rev-list --count HEAD)" \ + "$(git rev-parse --short HEAD)" +} + build() { cd shell export CC=gcc