Arch User Repository は、ビルド済みパッケージではなくパッケージレシピを含む Git
リポジトリを保存します。したがって AUR パッケージの保守とは、レビュー可能な
PKGBUILD と対応する .SRCINFO を公開し、そのレシピを分離されたビルド環境で
検証することです。
パッケージを正しくモデル化する #
PKGBUILD は pkgname、pkgver、pkgrel、arch、ライセンス、ソース、チェック
サム、依存関係配列などのメタデータを定義します。その関数は段階を分離します。
prepare()はパッチを適用するか、ソースを準備します。build()はソフトウェアをコンパイルまたは生成します。check()はテストを実行し、checkdependsを必要とします。package()は$pkgdir以下にだけインストールします。
ソースとビルド状態には $srcdir を使用し、パッケージ関数からホストファイル
システムへ書き込まないでください。実行時依存関係は depends、ビルド専用ツールは
makedepends、テスト専用パッケージは checkdepends に記述します。宣言の不足は
開発者のワークステーションでは隠れたまま、ユーザー環境で失敗する可能性があります。
makepkg は呼び出し元ユーザーの権限でレシピを実行するため、すべてのソース URL、
パッチ、シェル式をレビューします。リリースパッケージは不変の上流アーティファクト
に固定し、チェックサムを使用します。上流が署名済みリリースを公開している場合は
validpgpkeys で署名を検証します。チェックサムは変更されたバイトを検出しますが、
ソースの信頼性を確立するものではありません。
クリーンな chroot でビルドと検査を行う #
makepkg を root として実行しないでください。ホストの依存関係、設定、古いビルド
アーティファクトによって不完全なレシピが通らないよう、クリーンな chroot でビルド
します。devtools を設定済みなら次を実行します。
extra-x86_64-buildchroot 外でローカル反復を行う場合は、クリーンなソースツリーから開始し、makepkg に リポジトリ依存関係を解決させます。
makepkg --cleanbuild --syncdeps--syncdeps は pacman を呼び出すため、AUR 依存関係を取得できません。まず依存関係を
レビューしてビルドし、その後、ローカルリポジトリまたは chroot ワークフローを通じて
検証済みパッケージを提供します。
インストール前にパッケージのペイロードを検査し、静的チェックを適用します。
bsdtar -tf ./*.pkg.tar.zst
namcap PKGBUILD ./*.pkg.tar.zstnamcap はヒューリスティックを報告するもので、証明ではありません。使い捨て環境で
インストール、アップグレード、削除、実行時依存関係、サービス、デスクトップ統合を
テストします。
Update Versions and VCS Packages #
For a release update, change pkgver, reset pkgrel when appropriate, update
sources and checksums after reviewing them, and rebuild. Do not use
--skipinteg to make a changed source pass.
A VCS package conventionally uses a suffix such as -git and a pkgver()
function derived from repository history. Its source must resolve to a
reproducible revision during one build. Avoid converting a release package into
a moving branch: users need versioned, reviewable source inputs and predictable
upgrade behavior.
Compare repeated clean-chroot builds where practical. Differences in output can expose timestamps, locale, build paths, or undeclared inputs that prevent reproducibility.
Publish Matching AUR Metadata #
Generate .SRCINFO from the current PKGBUILD; do not hand-edit it. Commit
only tracked AUR packaging files and inspect the staged diff before pushing:
makepkg --printsrcinfo > .SRCINFO
git add PKGBUILD .SRCINFO
git diff --cached
git commit
git pushUpdate .SRCINFO for every metadata change, including dependencies, sources,
and split packages. Respond to reports with reproducible evidence, state
breaking changes in commit messages or package comments, and avoid pushing
unreviewed user patches. AUR orphaning and deletion are repository maintenance
procedures; they do not make a package part of an official Arch repository.
コメント
GitHub で閲覧・コメントする(投稿にはログインが必要です)