diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100644 index 0000000..0b99886 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,69 @@ +## Packaging rules + +Every `pkgs//` recipe must satisfy (enforced by `./check`): + +1. **Tracked-upstream source, by suffix.** Every `pkgname` ends in one of: + - `-git` — `source=()` is a `git+` VCS source (built from a clone), or + - `-rel` — `source=()` is a `releases/download/` URL (a published git tag). + + Both track upstream git; they differ only in whether we build the clone or + install a published release artifact. No other source suffix is allowed. + A trailing `-sys` may be appended to either (`-git-sys` / `-rel-sys`) — see + rule 2. +2. **No `.install` scriptlets, unless the package is `-sys`.** By default a + recipe may have no `install=` line and no `*.install` file. A package that + genuinely needs pre/post scriptlets (systemd units, user creation, cache + refresh, …) must opt in by appending `-sys` to its `pkgname` + (e.g. `foo-git-sys`). Only `*-sys/` dirs can commit a `*.install` — the + allowlist forbids it everywhere else. +3. **At least one `# Maintainer:` line** in the PKGBUILD. + +Run `./check` before committing; CI runs it on every PR. + +## Recipe allowlist + +Under `pkgs/`, only packaging files are tracked — all source code and build +artifacts are ignored, whatever the language. The `.gitignore` allowlist: + +- `PKGBUILD`, `.SRCINFO`, `.nvchecker.toml`, `REUSE.toml` +- `*.patch`, `*.diff`, `*.hook` +- `*.service`, `*.sysusers`, `*.tmpfiles`, `*.desktop` +- `keys/**/*.asc` +- `*.install` — **only** inside a `*-sys/` recipe dir (see rule 2) + +Anything else in a recipe dir (`.sh`, `.py`, `.rs`, tests, downloaded +tarballs, `pkg/`, `src/`, built packages) is never committed. + +## Version tracking & licensing + +Each recipe carries two metadata files, mirroring Arch's packaging repos: + +- `.nvchecker.toml` — how to find the latest upstream version. `-rel` packages + track a GitHub release; `-git` packages use the `git` source (`use_commit`) + to follow the built repo/branch. `./bump` consumes this for `-rel`. +- `REUSE.toml` — declares the packaging files themselves as `0BSD` (Arch + convention), independent of the upstream project's own license. + +## Tooling + +Repo-root helper scripts: + +- `./check` — validate every recipe against the package rules above. Exits + non-zero on any violation. +- `./dco []` — verify every non-merge commit in `` (default + `origin/master..HEAD`) carries a `Signed-off-by:` trailer matching its + author. Homebaked DCO check; CI runs it on every push and PR. +- `./clean` — remove all git-ignored build debris (`pkg/`, `src/`, fetched + sources, built packages) repo-wide, after a confirmation prompt. +- `./bump [pkg...]` — refresh packages to the latest upstream state, by tier: + `*-rel` runs `pkgctl version upgrade` + `updpkgsums`; `*-git` re-clones and + reruns `pkgver()` (no hashes to bump — git's ref is the integrity check). + Both regenerate `.SRCINFO`. With no args, refreshes them all. + +`./check` and `./bump` source `acrlib`, the single source of truth for the +suffix scheme (`acr_tier`, `acr_is_sys`) — so the tools can't drift on what +`-git`/`-rel`/`-sys` mean. Both treat `-git-sys`/`-rel-sys` as their base tier. + +Packaging you'll want: `nvchecker`, `devtools`, `base-devel` and `pacman-contrib`. + +--- \ No newline at end of file diff --git a/.gitignore b/.gitignore index 1b46976..41846aa 100644 --- a/.gitignore +++ b/.gitignore @@ -21,6 +21,7 @@ pkgs/**/src/ !pkgs/**/.SRCINFO !pkgs/**/.gitignore !pkgs/**/.nvchecker.toml +!pkgs/**/REUSE.toml !pkgs/**/*.patch !pkgs/**/*.diff !pkgs/**/*.hook diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..dd70085 --- /dev/null +++ b/LICENSE @@ -0,0 +1,13 @@ +Copyright h8d13 + +Permission to use, copy, modify, and/or distribute this software for +any purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED “AS IS” AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN +AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/acrlib b/acrlib new file mode 100644 index 0000000..34c5030 --- /dev/null +++ b/acrlib @@ -0,0 +1,23 @@ +# acrlib shared ACR helpers, sourced by ./check and ./bump. +# Single source of truth for the package-suffix scheme so the tools can't +# drift apart (e.g. one of them forgetting the -sys variants). +# +# -git[-sys] -> tier "git" (git+ VCS source) +# -rel[-sys] -> tier "rel" (releases/download/ source) +# trailing -sys -> opts in to .install scriptlets +# +# Usage: source "$(dirname "$0")/acrlib" + +# acr_tier -> prints "git" | "rel" | "" (unknown), ignoring -sys. +acr_tier() { + case "$1" in + *-git|*-git-sys) echo git ;; + *-rel|*-rel-sys) echo rel ;; + *) echo "" ;; + esac +} + +# acr_is_sys -> exit 0 if the package opts in to install scriptlets. +acr_is_sys() { + [[ "$1" == *-sys ]] +} diff --git a/bump b/bump index bd71f3b..54fdfc8 100755 --- a/bump +++ b/bump @@ -12,6 +12,8 @@ set -u shopt -s nullglob +source "$(dirname "$0")/acrlib" + targets=() if (( $# > 0 )); then for n in "$@"; do targets+=("pkgs/$n"); done @@ -29,13 +31,13 @@ for dir in "${targets[@]}"; do old=$(sed -n "s/^pkgver=//p" "$dir/PKGBUILD" | head -1) echo "==> $name (current $old)" - case "$name" in - *-rel) + case "$(acr_tier "$name")" in + rel) ( cd "$dir" && pkgctl version upgrade && updpkgsums \ && makepkg --printsrcinfo > .SRCINFO ) ok=$? ;; - *-git) + git) ( cd "$dir" && makepkg -od --noprepare \ && makepkg --printsrcinfo > .SRCINFO ) ok=$? diff --git a/check b/check index 726fbad..22e250a 100755 --- a/check +++ b/check @@ -11,6 +11,8 @@ set -u shopt -s nullglob +source "$(dirname "$0")/acrlib" + fail=0 checked=0 @@ -22,14 +24,14 @@ for pkgbuild in pkgs/*/PKGBUILD; do # Rule 1: tracked-upstream source, validated against the pkgname suffix pkgname=$(sed -n "s/^pkgname=//p" "$pkgbuild" | tr -d "'\"" | head -1) - case "$pkgname" in - *-git|*-git-sys) + case "$(acr_tier "$pkgname")" in + git) if ! grep -qE '^[[:space:]]*source.*=.*git\+' "$pkgbuild"; then echo "FAIL [$name]: -git package has no git+ VCS source" fail=1 fi ;; - *-rel|*-rel-sys) + rel) if ! grep -qE '^[[:space:]]*source.*=.*releases/download/' "$pkgbuild"; then echo "FAIL [$name]: -rel package has no releases/download/ source" fail=1 @@ -42,7 +44,7 @@ for pkgbuild in pkgs/*/PKGBUILD; do esac # Rule 2: no install scriptlets, unless the pkgname opts in with a -sys suffix - if [[ "$pkgname" != *-sys ]]; then + if ! acr_is_sys "$pkgname"; then if grep -qE '^[[:space:]]*install=' "$pkgbuild"; then echo "FAIL [$name]: install= scriptlet declared in PKGBUILD (use a -sys suffix to allow)" fail=1 diff --git a/pkgs/apc-git/.nvchecker.toml b/pkgs/apc-git/.nvchecker.toml new file mode 100644 index 0000000..c32db7f --- /dev/null +++ b/pkgs/apc-git/.nvchecker.toml @@ -0,0 +1,4 @@ +[apc-git] +source = "git" +git = "https://github.com/h8d13/apc.git" +use_commit = true diff --git a/pkgs/apc-git/REUSE.toml b/pkgs/apc-git/REUSE.toml new file mode 100644 index 0000000..33a395a --- /dev/null +++ b/pkgs/apc-git/REUSE.toml @@ -0,0 +1,9 @@ +version = 1 + +# Packaging files in this recipe are licensed 0BSD (Arch convention), +# independent of the upstream project's own license. +[[annotations]] +path = "**" +precedence = "aggregate" +SPDX-FileCopyrightText = "2026 Eihdran Lego " +SPDX-License-Identifier = "0BSD" diff --git a/pkgs/grimoire-git/.nvchecker.toml b/pkgs/grimoire-git/.nvchecker.toml new file mode 100644 index 0000000..0ef2800 --- /dev/null +++ b/pkgs/grimoire-git/.nvchecker.toml @@ -0,0 +1,5 @@ +[grimoire-git] +source = "git" +git = "https://github.com/h8d13/grimoire.git" +use_commit = true +branch = "dot-cache" diff --git a/pkgs/grimoire-git/REUSE.toml b/pkgs/grimoire-git/REUSE.toml new file mode 100644 index 0000000..33a395a --- /dev/null +++ b/pkgs/grimoire-git/REUSE.toml @@ -0,0 +1,9 @@ +version = 1 + +# Packaging files in this recipe are licensed 0BSD (Arch convention), +# independent of the upstream project's own license. +[[annotations]] +path = "**" +precedence = "aggregate" +SPDX-FileCopyrightText = "2026 Eihdran Lego " +SPDX-License-Identifier = "0BSD" diff --git a/pkgs/speedtest-cli-git/.nvchecker.toml b/pkgs/speedtest-cli-git/.nvchecker.toml new file mode 100644 index 0000000..9453f80 --- /dev/null +++ b/pkgs/speedtest-cli-git/.nvchecker.toml @@ -0,0 +1,4 @@ +[speedtest-cli-git] +source = "git" +git = "https://github.com/h8d13/speedtest-cli.git" +use_commit = true diff --git a/pkgs/speedtest-cli-git/REUSE.toml b/pkgs/speedtest-cli-git/REUSE.toml new file mode 100644 index 0000000..33a395a --- /dev/null +++ b/pkgs/speedtest-cli-git/REUSE.toml @@ -0,0 +1,9 @@ +version = 1 + +# Packaging files in this recipe are licensed 0BSD (Arch convention), +# independent of the upstream project's own license. +[[annotations]] +path = "**" +precedence = "aggregate" +SPDX-FileCopyrightText = "2026 Eihdran Lego " +SPDX-License-Identifier = "0BSD" diff --git a/pkgs/vscodium-rel/REUSE.toml b/pkgs/vscodium-rel/REUSE.toml new file mode 100644 index 0000000..33a395a --- /dev/null +++ b/pkgs/vscodium-rel/REUSE.toml @@ -0,0 +1,9 @@ +version = 1 + +# Packaging files in this recipe are licensed 0BSD (Arch convention), +# independent of the upstream project's own license. +[[annotations]] +path = "**" +precedence = "aggregate" +SPDX-FileCopyrightText = "2026 Eihdran Lego " +SPDX-License-Identifier = "0BSD" diff --git a/readme.md b/readme.md index 45d50ce..6c997d0 100644 --- a/readme.md +++ b/readme.md @@ -4,69 +4,14 @@ - A valid `GPG` key to sign all commits + SSH setup _(pure web commits will not be accepted)_ - A valid DCO trailer: using `--signoff` or `-s` with `git` - Any web commits require an email linked and verified - - A valid review from the dictator himself - All commits on `master`: - Require linear history - Only through PRs with a valid review -## Package rules - -Every `pkgs//` recipe must satisfy (enforced by `./check`): - -1. **Tracked-upstream source, by suffix.** Every `pkgname` ends in one of: - - `-git` — `source=()` is a `git+` VCS source (built from a clone), or - - `-rel` — `source=()` is a `releases/download/` URL (a published git tag). - - Both track upstream git; they differ only in whether we build the clone or - install a published release artifact. No other source suffix is allowed. - A trailing `-sys` may be appended to either (`-git-sys` / `-rel-sys`) — see - rule 2. -2. **No `.install` scriptlets, unless the package is `-sys`.** By default a - recipe may have no `install=` line and no `*.install` file. A package that - genuinely needs pre/post scriptlets (systemd units, user creation, cache - refresh, …) must opt in by appending `-sys` to its `pkgname` - (e.g. `foo-git-sys`). Only `*-sys/` dirs can commit a `*.install` — the - allowlist forbids it everywhere else. -3. **At least one `# Maintainer:` line** in the PKGBUILD. - -Run `./check` before committing; CI runs it on every PR. - -## Recipe allowlist - -Under `pkgs/`, only packaging files are tracked — all source code and build -artifacts are ignored, whatever the language. The `.gitignore` allowlist: - -- `PKGBUILD`, `.SRCINFO`, `.nvchecker.toml` -- `*.patch`, `*.diff`, `*.hook` -- `*.service`, `*.sysusers`, `*.tmpfiles`, `*.desktop` -- `keys/**/*.asc` - -Anything else in a recipe dir (`.sh`, `.py`, `.rs`, tests, downloaded -tarballs, `pkg/`, `src/`, built packages) is never committed. - -## Tooling - -Repo-root helper scripts: - -- `./check` — validate every recipe against the package rules above. Exits - non-zero on any violation. -- `./dco []` — verify every non-merge commit in `` (default - `origin/master..HEAD`) carries a `Signed-off-by:` trailer matching its - author. Homebaked DCO check; CI runs it on every push and PR. -- `./clean` — remove all git-ignored build debris (`pkg/`, `src/`, fetched - sources, built packages) repo-wide, after a confirmation prompt. -- `./bump [pkg...]` — refresh packages to the latest upstream state, by tier: - `*-rel` runs `pkgctl version upgrade` + `updpkgsums`; `*-git` re-clones and - reruns `pkgver()` (no hashes to bump — git's ref is the integrity check). - Both regenerate `.SRCINFO`. With no args, refreshes them all. - -Packaging you'll want: `nvchecker`, `devtools`, `base-devel` and `pacman-contrib`. - ---- - ## Ruleset The current GitHub ruleset can be freely consulted through this [file](./ruleset.json) +The full packaging guidelines, tools, can also be seen here [CONTRIB](./.github/CONTRIBUTING.md) ---