NEWAPKBUILD(1)

NAME
newapkbuild - generate a new APKBUILD

SYNOPSIS
newapkbuild [-n NAME] [-d DESC] [-l LICENSE] [-u URL] [-aCmpy] [-cfhs] [pkgname [-pkgver]]
newapkbuild [-n NAME] [-d DESC] [-l LICENSE] [-u URL] [-aCmpy] [-cfhs] [source_url]

DESCRIPTION
newapkbuild generates a new APKBUILD for use with abuild(1).
-n NAME
    Specifies the name of the new package. A new directory called NAME will be created in the current directory, with the APKBUILD file.
-d DESC
    Specifies the description (pkgdesc=) for the new package.
-l LICENSE
    Specifies the license under which the new package is distributed. This should match an SPDX Identifier.
-u URL
    Specifies the Web page (url=) for the new package. This should not be the source package URL; it should be the project's main Web page.
-c  Causes newapkbuild to additionally copy an init.d script, conf.d file, and sample pre- and post- install scripts to the APKBUILD directory. This allows you to have a quick start for daemon packages.
-f  Forces newapkbuild to overwrite an existing APKBUILD, if one already exists in the package directory.
-h  Displays usage information.
-s  Create 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.
pkgname-pkgver
    Specify the package name, if not already specified by -n. If followed by a dash (-) and a valid version string, additionally specify the package's version.

  Build system type
newapkbuild will try to automatically detect the build system by inspecting the source directory if source_url is specified, and write out typical build instructions for that build system. If you do not specify the source URL, or you want to override auto-detection, you may specify one of the following four flags:
-a  Specifies that the package uses autotools. The APKBUILD will contain a typical invocation of ./configure, make, and make install.
-C  Specifies that the package uses CMake. CMake will be added to the makedepends and a typical CMake invocation will be added to the APKBUILD.
-m  Specifies that the package uses Meson. A typical Meson and Ninja invocation will be added to the APKBUILD.
-p  Specifies that the package uses a Perl Makefile.PL file. The CPAN template will be used.
-y  Specifies that the package uses a Python setup.py build system. Python will be added to the makedepends.
If you do not specify any option, and you do not specify the source URL, the generated APKBUILD file will not contain any build instructions.

FILES
All files generated will be placed in a pkgname directory inside the current working directory, with pkgname being created if it does not exist.
APKBUILD
    newapkbuild will create APKBUILD with the details gathered from the invocation of newapkbuild, and introspection of the downloaded package source if source_url is provided. For more information about APKBUILD and its format, see APKBUILD(5).
pkgname.initd
    If -c is given, newapkbuild will create pkgname.initd with example data to assist in the creation of an init.d script for a daemon.
pkgname.confd
    If -c is given, newapkbuild will create 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 information, see openrc(8) and rc_config(3).
pkgname.pre-install
    If -c is given, newapkbuild will create pkgname.pre-install, the contents of which will be run by apk(8) before the package is installed.
pkgname.post-install
    If -c is given, newapkbuild will create pkgname.post-install, the contents of which will be run by apk(8) after the package is successfully installed. For more information about apk install hooks, consult the apk(8) manual.

EXAMPLES
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

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 <awilfox@adelielinux.org>