BlueGit

timfa posprint

Files

posprint / scripts / bootstrap-aur-repo.sh

bootstrap-aur-repo.sh

9611cde4 History
bootstrap-aur-repo.sh 968 B Download Raw
1#!/usr/bin/env bash
2# One-time: create the AUR package repo and push initial PKGBUILD + .SRCINFO.
3# Run on a machine where your AUR SSH key works (same key as on aur.archlinux.org).
4set -euo pipefail
5
6ROOT="$(cd "$(dirname "$0")/.." && pwd)"
7PKGBASE="${AUR_PKGBASE:-posprint}"
8AUR_REMOTE="ssh://aur@aur.archlinux.org/${PKGBASE}.git"
9WORKDIR="${TMPDIR:-/tmp}/${PKGBASE}-aur-bootstrap-$$"
10cleanup() { rm -rf "$WORKDIR"; }
11trap cleanup EXIT
12
13for cmd in git ssh; do
14 command -v "$cmd" >/dev/null || { echo "Missing: $cmd" >&2; exit 1; }
15done
16
17"$ROOT/scripts/aur-ssh-setup.sh"
18
19mkdir -p "$WORKDIR/repo"
20cd "$WORKDIR/repo"
21git init
22git remote add origin "$AUR_REMOTE"
23git checkout -b master
24
25cp "$ROOT/packaging/aur/PKGBUILD" .
26cp "$ROOT/packaging/aur/.SRCINFO" .
27
28git add PKGBUILD .SRCINFO
29git commit -m "initial import"
30
31echo "Pushing to $AUR_REMOTE ..."
32git push -u origin master
33
34echo "Done. AUR package should appear at: https://aur.archlinux.org/packages/${PKGBASE}"