commit 1ea92dba1e57fba9f5a43b550931427a3ea59d3a Author: Olivier Date: Wed Aug 6 20:04:03 2025 -0300 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..035a9ff --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +# Personal APT repository + +This directory is a minimal Debian/apt repository that hosts personal +packages for the Clockwork Pi image. + +Currently it contains only **clockworkpi-theme**. + +## Structure +``` +apt-repository/ +├── build-repo.sh # helper to rebuild the index +├── pool/main/c/clockworkpi-theme/ +│ └── clockworkpi-theme_*.deb # package files live here +└── dists/bookworm/stable/main/binary-all/ + ├── Packages + └── Packages.gz +``` + +## Usage +1. Build / rebuild your theme package in *pi-gen* (e.g. via + `scripts/package-custom-theme.sh`). +2. Run the helper here: + ```bash + cd apt-repository + ./build-repo.sh + ``` +3. Commit & push this repo – the raw URL of the repo root is the apt + source, e.g. + ``` + deb [arch=all] https://gitea.example.com/olivier/apt-repository bookworm stable main + ``` + +## Adding more packages +Just copy additional `.deb` files into an appropriate sub-directory +under `pool/` (follow the first letter scheme) and run +`./build-repo.sh` – the script rescans the entire pool each time. diff --git a/build-repo.sh b/build-repo.sh new file mode 100755 index 0000000..e5d7a13 --- /dev/null +++ b/build-repo.sh @@ -0,0 +1,56 @@ +#!/usr/bin/env bash +# ----------------------------------------------------------------------------- +# build-repo.sh – regenerate minimal Debian/apt repository +# ----------------------------------------------------------------------------- +# 1. copies the current custom-theme.deb from ../ClockworkPi-pi-gen/custom-theme/ +# (edit PKG_SRC below if your path is different) +# 2. puts it into pool/main/c/clockworkpi-theme/ +# 3. runs dpkg-scanpackages to create Packages & Packages.gz +# 4. writes a small Release stub (not signed – fine for private use, add gpg +# signing later if you wish) +# +# After running, commit & push this repo – the raw URLs will be usable as an +# apt source on any machine. +# ----------------------------------------------------------------------------- +set -euo pipefail + +PKG_SRC="../ClockworkPi-pi-gen/custom-theme/custom-theme.deb" # location of .deb +POOL_DIR="pool/main/c/clockworkpi-theme" +DIST="bookworm" +COMP="stable" +ARCH="all" + +if [[ ! -f "${PKG_SRC}" ]]; then + echo "ERROR: ${PKG_SRC} not found – build your theme package first." >&2 + exit 1 +fi + +mkdir -p "${POOL_DIR}" +cp -u "${PKG_SRC}" "${POOL_DIR}/" # copy only if newer (keeps history) + +BIN_DIR="dists/${DIST}/${COMP}/main/binary-${ARCH}" +mkdir -p "${BIN_DIR}" + +# Generate Packages & Packages.gz +if ! command -v dpkg-scanpackages >/dev/null; then + echo "ERROR: dpkg-scanpackages not found – install dpkg-dev." >&2 + exit 1 +fi + +dpkg-scanpackages --arch "${ARCH}" pool /dev/null > "${BIN_DIR}/Packages" + gzip -9c "${BIN_DIR}/Packages" > "${BIN_DIR}/Packages.gz" + +# Minimal Release file (unsigned) +mkdir -p "dists/${DIST}" +cat > "dists/${DIST}/Release" <