newapkbuild(1)
π newapkbuild β generate a new APKBUILD π
okay so bestie, welcome to newapkbuild(1), from the General Commands Manual section of your fave Unix docs. this is the little tool that spawns a fresh APKBUILD for you. let's get into it π
β¨ SYNOPSIS β¨
newapkbuild options... [pkgname[-pkgver] | source_url]
π DESCRIPTION π
so newapkbuild generates a new APKBUILD for use with abuild(1). that's the whole vibe.
pkgname is where you tell it the package name β unless you already specified the name with -n, in which case you're covered. and if you follow that name with a dash (-) and a valid version string pkgver, you also get to specify the package's version. cute, right? β¨
here's the actually-iconic part: if you give it a source_url, newapkbuild will lowkey try to auto-detect the build system by inspecting the source directory, and then write out typical build instructions for whatever build system it found. main character energy tbh π
if you don't specify a source URL, or you wanna override the auto-detection (respect π
), you can just specify the build system yourself with the appropriate option. and if you specify no source_url and no option at all? then the generated APKBUILD file will not contain any build instructions. none. zero. empty. that's just how it is π«Ά
πΈ OPTIONS πΈ
-aβ says the package uses autotools. that's it, that's the tweet π¦-Cβ says the package uses CMake. and heads up, CMake gets added to themakedepends.-cβ makesnewapkbuildadditionally copy aninit.dscript, aconf.dfile, and samplepre-andpost-install scripts into the APKBUILD directory. it's giving "quick start for daemon packages" π and honestly? yes. see the FILES section below for the details.-dDESCβ sets the description (pkgdesc=) for your new package.-e,-yβ says the package uses a Python PEP517 build system. Python'sgpep517,setuptoolsandwheelget added to themakedepends. two flags, same slay β¨-fβ forcesnewapkbuildto overwrite an existingAPKBUILD, if one already exists in the package directory. bold move, bestie π₯-hβ displays usage information. the "help me help you" flag π«Ά-lLICENSEβ sets the license under which your new package is distributed. this should match an SPDX Identifier, okurrr π-mβ says the package uses Meson. Meson gets added to themakedepends.-nNAMEβ sets the name of the new package. a new directory calledNAMEgets created in the current directory, with theAPKBUILDfile inside it. a whole new home for your package π-pβ says the package uses a PerlMakefile.PLfile. the CPAN template gets used and Perl gets added to thedepends.-rβ says the package uses Cargo. Cargo gets added to themakedepends.-sβ creates an automatic SourceForge URL for the package based on its name and version. this is only valid ifpkgname-pkgveris specified on the command line β no name+version, no dice π-uURLβ sets the Web page (url=) for the new package. and listen, this should not be the source package URL β it should be the project's main Web page. read that again bestie, it matters π
π¦ FILES π¦
all the files generated get placed in a pkgname directory inside the current working directory, and pkgname gets created if it doesn't already exist. lowkey tidy of it β¨
APKBUILDβnewapkbuildwill create anAPKBUILDwith the details gathered from the invocation ofnewapkbuild, plus introspection of the downloaded package source ifsource_urlis provided. for more info aboutAPKBUILDand its format, see APKBUILD(5).pkgname.initdβ if-cis given,newapkbuildcreatespkgname.initdwith example data to assist in the creation of aninit.dscript for a daemon. a lil starter kit πpkgname.confdβ if-cis given,newapkbuildcreatespkgname.confdto assist in the creation of aconf.dfile for a daemon, used byinit.dscripts.conf.dfiles are used to configureinit.dscripts; for more info, see openrc(8) and rc_config(3).pkgname.pre-installβ if-cis given,newapkbuildcreatespkgname.pre-install, and the contents of it will be run by apk(8) before the package is installed.pkgname.post-installβ if-cis given,newapkbuildcreatespkgname.post-install, and the contents of it will be run by apk(8) after the package is successfully installed. want more on apk install hooks? go consult the apk(8) manual, iykyk π«Ά
π EXAMPLES π
okay here's a full-on example, look at her go:
newapkbuild \
-n sharutils \
-d "Utilities for manipulating shell archives" \
-l "GPL-3.0+" \
-u "https://www.gnu.org/software/sharutils/" \
-a \
"https://ftp.gnu.org/gnu/sharutils/sharutils-4.15.2.tar.xz"
ate. no notes π₯
β SEE ALSO β
SPDX license reference (on the Web at <https://spdx.org/licenses/>), abuild(1), apk(8), APKBUILD(5).
π AUTHORS π
newapkbuild: Natanael Copa <ncopa@alpinelinux.org>
Documentation: A. Wilcox <wilfox@adelielinux.org>
and that's the whole thing bestie, hope this helped π«Ά mwah π
this page is from the General Commands Manual, dated 2026-06-05 β screenshot it, cite it, love it π
π¦ where this page comes from
- alpine 3.24: abuild-doc 3.17.0-r0 Β· GPL-2.0-only
- arch rolling: abuild 3.17.0-1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms