ALPM-SOURCE-REPO(7)
π alpm-source-repo(7) β the group chat guide to source repos π
okay so bestie, picture this: you've got a repo β like, an actual directory β and its whole entire job is holding the sources you need to build one (or more!!) Arch Linux Package Management (ALPM) based packages. that's it. that's the vibe. it's giving β¨source materialβ¨.
πΈ DESCRIPTION πΈ
so ALPM based packages (go peek at alpm-package if you haven't, iykyk) don't just appear, right? they get created from package sources using package build software, like makepkg. yeah. that one. π«Ά
the Contents section below has the full rundown of which files are required and which are just the optional little extras you'll lowkey wanna have. and if you're doing Arch Linux specific stuff, go look at devtools and pkgctl β those are your girls.
π Contents π
so package sources are represented by a single PKGBUILD per alpm-source-repo. one. singular. iconic behavior honestly. that PKGBUILD may define stuff and/or require additional files β think an alpm-install-scriptlet, or literally arbitrary custom local source files for the package build process, or files for tooling (configuration files, that kinda thing π).
and the PKGBUILD script may be accompanied by a SRCINFO file, which is a parseable data format that exposes the relevant metadata defined by the PKGBUILD. slay.
β Required files β
PKGBUILD: The package build script.
π¦ Optional files π¦
.SRCINFO: The data representation of the package build script metadata (seeSRCINFO)..nvchecker.toml: A minimal configuration file fornvchecker(supported bypkgctl) to allow detection of new upstream versions. new version alert!! πLICENSES/: A directory containing license files used byreuse(see RFC 0040[1] and RFC 0052[2]).REUSE.toml: A configuration file forreusewhich covers the license information of all files in the alpm-source-repo (see RFC 0040[1] and RFC 0052[2]).alpm-install-scriptlet: An installation scriptlet that is added to a resultingalpm-package(needs to be specified in thePKGBUILD). β οΈ yes, it needs to be in thePKGBUILD, don't forget, i'm serious.keys/pgp/: A directory containing ASCII-armored[3] OpenPGP certificates[4] that represent verifiers for OpenPGP signatures[5] created by upstreams for their release artifacts.
apart from all those specific files up there, an alpm-source-repo may contain a list of arbitrary, custom source files that get used with the PKGBUILD when you build package files with package build software. the common ones? patches, systemd.service, systemd.socket, sysusers.d, tmpfiles.d, or other configuration files. love that for us π
π Version control π
okay so real talk: it is advisable to keep the contents of an alpm-source-repo in a version control system such as git. why? because doing that lets you establish the relationship between a PKGBUILD and its resulting list of alpm-package files β by associating a (preferably signed) git commit hash with the package. and that? that's important for reproducible builds[6]. no cap. π₯
upstream sources and build artifacts (think build logs, or package files) should not be included in the git repository. nope. not them. you can ignore them using agitignorefile. alternatively,makepkg.confcan be used to instruct themakepkgpackage build tool to store artifacts elsewhere. either way, keep that repo clean bestie π§Ήβ¨
π Best practices π
technically a basic setup only requires a PKGBUILD file. technically. but like⦠further components are considered best practice and honestly they eat:
.SRCINFO: creating this file (seeSRCINFOfor the description of the format) and keeping it in sync with thePKGBUILDfile allows consumers of the alpm-source-repo to extract metadata of thePKGBUILDwithout requiring bash. no bash required, we love a low-effort queen..nvchecker.toml: usingnvchecker(e.g. throughpkgctl) enables users to check for new releases of an upstream project. πLICENSES/andREUSE.toml: areusesetup ensures that licensing is clearly defined for all files in the alpm-source-repo, which enables others to use it and adapt it. sharing is caring fr fr.keys/pgp/: if thePKGBUILDdefines analpm-package-sourcewith OpenPGP signature verification[7], storing current versions of relevant ASCII-armored[3] OpenPGP certificates[4] allows users of the alpm-source-repo to authenticate the upstream artifacts using OpenPGP signatures[5]. secure AND cute π
β¨ EXAMPLES β¨
first up, the baby version. a basic alpm-source-repo:
.
βββ PKGBUILD
and now the glow-up π β a more complete alpm-source-repo with best practices applied for a package named example:
.
βββ .SRCINFO
βββ .nvchecker.toml
βββ LICENSES
β βββ 0BSD.txt
βββ PKGBUILD
βββ REUSE.toml
βββ example.install
βββ keys
βββ pgp
βββ F1D2D2F924E986AC86FDF7B36C94BCDF32BEEC15.asc
look at that tree. immaculate. π³
π¦ SEE ALSO π¦
bash(1), git(1), nvchecker(1), pkgctl(1), reuse(1), PKGBUILD(5), SRCINFO(5), alpm-install-scriptlet(5), gitignore(5), makepkg.conf(5), systemd.service(5), systemd.socket(5), sysusers.d(5), tmpfiles.d(5), alpm-package(7), alpm-package-source(7), devtools(7), makepkg(8)
π NOTES π
https://rfc.archlinux.page/0040-license-package-sources/
https://rfc.archlinux.page/0052-reuse/
- ASCII armored
https://openpgp.dev/book/armor.html
- OpenPGP certificates
https://openpgp.dev/book/certificates.html
- OpenPGP signatures
https://openpgp.dev/book/signatures.html
- reproducible builds
https://reproducible-builds.org/
- OpenPGP signature verification
https://openpgp.dev/book/verification.html
and that's the whole page bestie!! πβ¨ this little gem lives in the Miscellaneous Information Manual (section 7, she's fancy π ), and this version is dated 2025-11-21 β so if you're reading this way past that, go check for a glow-up, mwah π«Άπ π
π¦ where this page comes from
- arch rolling: alpm-docs 0.13.0-1 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms