一键导入
aur-vcs-packages
Comprehensive guide for creating and maintaining Version Control System (VCS) packages in the AUR, covering git, svn, hg, bzr, and darcs packages.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Comprehensive guide for creating and maintaining Version Control System (VCS) packages in the AUR, covering git, svn, hg, bzr, and darcs packages.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Master skill for AUR (Arch User Repository) package development, serving as a comprehensive guide and dispatcher for creating, auditing, and submitting Arch Linux packages.
Comprehensive guide for auditing and validating Arch Linux packages and PKGBUILDs using automated tools and manual verification.
Comprehensive guide for using AUR helper tools like yay, paru, pikaur, and aura for automating package management.
Comprehensive guide for building Arch Linux packages using makepkg, covering the build process, configuration, debugging, and optimization.
Comprehensive guide to Arch Linux package guidelines and standards for consistency, quality, and interoperability across the Arch Linux ecosystem.
Comprehensive guide for using pacman, the Arch Linux package manager, covering installation, removal, queries, and troubleshooting.
| name | aur-vcs-packages |
| description | Comprehensive guide for creating and maintaining Version Control System (VCS) packages in the AUR, covering git, svn, hg, bzr, and darcs packages. |
Comprehensive guide for creating and maintaining Version Control System (VCS) packages in the AUR. Covers git, svn, hg, bzr, and darcs packages, pkgver updates, and VCS package best practices.
This skill should be used when:
VCS packages track development versions of software using version control systems. They use suffixes like -git, -svn, -hg to indicate the VCS type.
-git - Git repositories-svn - Subversion repositories-hg - Mercurial repositories-bzr - Bazaar repositories-darcs - Darcs repositoriespkgname=package-name-git
pkgver=1.2.3.r123.gabcdef
pkgrel=1
pkgdesc="Description of the package"
arch=('x86_64')
url="https://github.com/user/repo"
license=('MIT')
depends=('some-dependency')
makedepends=('git' 'some-dev-package')
provides=("package-name=${pkgver}")
conflicts=('package-name')
source=("${pkgname}::git+https://github.com/user/repo.git")
sha256sums=('SKIP')
pkgver() {
cd "$srcdir/${pkgname}"
# Extract version with r delimiter for monotonicity
printf "%s.r%s.g%s" \
"$(git tag --sort=-version:refname | head -1 | sed 's/^v//')" \
"$(git rev-list --count HEAD)" \
"$(git rev-parse --short HEAD)"
}
build() {
cd "$srcdir/${pkgname}"
./configure --prefix=/usr
make
}
package() {
cd "$srcdir/${pkgname}"
make DESTDIR="$pkgdir" install
}
The pkgver function updates the version string automatically. Use the r delimiter to ensure version monotonicity.
# Tag-based versioning with r delimiter (recommended standard)
pkgver() {
cd "$srcdir/${pkgname}"
printf "%s.r%s.g%s" \
"$(git describe --tags | sed 's/^v//')" \
"$(git rev-list --count HEAD)" \
"$(git rev-parse --short HEAD)"
}
# Alternative: Tag-based with version:refname sorting
pkgver() {
cd "$srcdir/${pkgname}"
printf "%s.r%s.g%s" \
"$(git tag --sort=-version:refname | head -1 | sed 's/^v//')" \
"$(git rev-list --count HEAD)" \
"$(git rev-parse --short HEAD)"
}
# Simpler tag-based
pkgver() {
cd "$srcdir/${pkgname}"
git describe --tags | sed 's/^v//'
}
# Date-based versioning
pkgver() {
cd "$srcdir/${pkgname}"
date +%Y%m%d
}
pkgver() {
cd "$srcdir/${pkgname}"
printf "r%s" "$(svn info | grep Revision | awk '{print $2}')"
}
pkgver() {
cd "$srcdir/${pkgname}"
printf "r%s" "$(hg identify -n)"
}
# Clone specific branch (use fragment, not query)
source=("${pkgname}::git+https://github.com/user/repo.git#branch=main")
# Clone specific tag (use fragment)
source=("${pkgname}::git+https://github.com/user/repo.git#tag=v1.0.0")
# Clone at specific commit (use fragment)
source=("${pkgname}::git+https://github.com/user/repo.git#commit=abc123")
# PGP-signed revision
source=("${pkgname}::git+https://github.com/user/repo.git?signed#branch=main")
# With submodules (use prepare())
source=("${pkgname}::git+https://github.com/user/repo.git")
options=('!emptydirs')
source=("svn+svn://svn.example.com/repo/trunk")
source=("hg+https://bitbucket.org/user/repo")
Note: Use fragments (#) for branches/tags/commits, not query strings (?). Query (?) is reserved for signed revisions.
pkgbase = package-name-git
pkgdesc = Description
url = https://github.com/user/repo
makedepends = git
provides = package-name=1.2.3.r123.gabcdef
conflicts = package-name
arch = x86_64
license = MIT
pkgname = package-name-git
pkgver = 1.2.3.r123.gabcdef
pkgrel = 1
depends = some-dep
Important: Keep .SRCINFO in sync with PKGBUILD. If using versioned provides in PKGBUILD (provides=("package-name=${pkgver}")), the .SRCINFO must also include the version to avoid metadata mismatches on the AUR web interface.
# Clone the repository
git clone ssh://aur@aur.archlinux.org/package-name-git.git
cd package-name-git
# Pull latest changes
git pull
# Run pkgver to test
makepkg -o
# Update checksums (if needed)
updpkgsums
# Build and test
makepkg -s
# Regenerate .SRCINFO
makepkg --printsrcinfo > .SRCINFO
# Only commit if there are structural PKGBUILD changes:
# - New dependencies
# - Build system changes
# - Not just pkgver bumps!
git add PKGBUILD .SRCINFO
git commit -m "Add new dependency or fix build"
git push
Important: Do not commit mere pkgver bumps. VCS packages are not considered "out of date" simply because upstream has new commits.
The pkgver function runs automatically during build:
makepkg -s
# pkgver() is called automatically
build() {
cd "$srcdir/${pkgname}"
[[ -f configure ]] || autoreconf -fi
./configure --prefix=/usr
make
}
build() {
cd "$srcdir/${pkgname}"
meson setup build --prefix=/usr
ninja -C build
}
package() {
cd "$srcdir/${pkgname}"
DESTDIR="$pkgdir" ninja -C build install
}
build() {
cd "$srcdir/${pkgname}"
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr
cmake --build build
}
package() {
cd "$srcdir/${pkgname}"
DESTDIR="$pkgdir" cmake --install build
}
Tracks the latest commit on a branch:
pkgname=package-name-git
source=("${pkgname}::git+https://github.com/user/repo.git#branch=main")
Tracks specific releases:
pkgname=package-name
source=("${pkgname}::git+https://github.com/user/repo.git#tag=v1.0.0")
-git, -svn, -hg suffix for VCS packagesprovides=("package-name=${pkgver}")1.2.3.r123) for version monotonicity#branch=main):: syntax to avoid SRCDEST conflicts# Note: Shallow clones (#depth=1) are NOT supported by Arch
# Build will fail if upstream rebases history
# Use git-fetch-submodules for large repos
source=("${pkgname}::git+https://github.com/user/repo.git")
options=('!emptydirs')
# Add submodule URLs directly to source array (recommended)
source=("${pkgname}::git+https://github.com/user/repo.git"
"git+https://github.com/user/submodule1.git"
"git+https://github.com/user/submodule2.git")
sha256sums=('SKIP' 'SKIP' 'SKIP')
prepare() {
cd "$srcdir/${pkgname}"
git submodule update --init --recursive
}
prepare() {
cd "$srcdir/${pkgname}"
git checkout master # or main
}
# Check VCS sources are valid
makepkg --verifysource
# Build package
makepkg -s
# Update version
makepkg -o
pkgver
# Generate .SRCINFO
makepkg --printsrcinfo > .SRCINFO