newapkbuild(1)

πŸ“¦
version 3.17.0 Β· 5 versions
, in alpine 3.24, arch rolling

πŸŽ€ 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 the makedepends.
  • -c β€” makes newapkbuild additionally copy an init.d script, a conf.d file, and sample pre- and post- 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.
  • -d DESC β€” sets the description (pkgdesc=) for your new package.
  • -e, -y β€” says the package uses a Python PEP517 build system. Python's gpep517, setuptools and wheel get added to the makedepends. two flags, same slay ✨
  • -f β€” forces newapkbuild to overwrite an existing APKBUILD, if one already exists in the package directory. bold move, bestie πŸ”₯
  • -h β€” displays usage information. the "help me help you" flag 🫢
  • -l LICENSE β€” 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 the makedepends.
  • -n NAME β€” sets the name of the new package. a new directory called NAME gets created in the current directory, with the APKBUILD file inside it. a whole new home for your package 🏠
  • -p β€” says the package uses a Perl Makefile.PL file. the CPAN template gets used and Perl gets added to the depends.
  • -r β€” says the package uses Cargo. Cargo gets added to the makedepends.
  • -s β€” creates an automatic SourceForge URL for the package based on its name and version. this is only valid if pkgname-pkgver is specified on the command line β€” no name+version, no dice πŸ™ˆ
  • -u URL β€” 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 β€” newapkbuild will create an APKBUILD with the details gathered from the invocation of newapkbuild, plus introspection of the downloaded package source if source_url is provided. for more info about APKBUILD and its format, see APKBUILD(5).
  • pkgname.initd β€” if -c is given, newapkbuild creates pkgname.initd with example data to assist in the creation of an init.d script for a daemon. a lil starter kit πŸŽ€
  • pkgname.confd β€” if -c is given, newapkbuild creates pkgname.confd to assist in the creation of a conf.d file for a daemon, used by init.d scripts. conf.d files are used to configure init.d scripts; for more info, see openrc(8) and rc_config(3).
  • pkgname.pre-install β€” if -c is given, newapkbuild creates pkgname.pre-install, and the contents of it will be run by apk(8) before the package is installed.
  • pkgname.post-install β€” if -c is given, newapkbuild creates pkgname.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