Include:Newapkbuild: Difference between revisions

From Alpine Linux
(fixed typo "pakckage" to "package")
(added comment not to make changes in transluded pages without checking target pages)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Cmd|newapkbuild ''packagename''}}
<!---This source page is transcluded in multiple pages. Please check all target pages before adding content here. Sometimes adding content in the target page may be more appropriate. Never change a transcluded page as REDIRECT as the target page will start transcluding the entire REDIRECT page -->
The <code>newapkbuild</code> tool, which is installed as part of the {{Pkg|abuild}} package, can generate a new APKBUILD template to use as a starting point. The [https://git.alpinelinux.org/abuild/tree/newapkbuild.1.scd manual page] (available via <code>man newapkbuild</code>) describes all options for <code>newapkbuild</code>.


'''newapkbuild options'''
If you doubt to which repository your package belongs to you can safely use testing. Building package in your aports/testing directory is not mandatory but this way the package is already at the right place.
{{Tip|Follow the package naming conventions mentioned in [[Package_policies|package policies]] while choosing a ''packagename''.}}


* '''-n'''  Set package name to NAME
The following command will create a directory with the given package name, place an example/template APKBUILD file in the directory, and fill some variables if those are provided. {{Cmd|newapkbuild ''packagename''}}
* '''-d'''  Set package description (pkgdesc) to DESC
* '''-l'''  Set package license to LICENSE
* '''-u'''  Set package URL
* '''-a'''  Create autotools package (use ./configure ...)
* '''-C'''  Create CMake package (Assume cmake/ is there)
* '''-m'''  Create meson package (Assume meson.build is there)
* '''-p'''  Create perl package (Assume Makefile.PL is there)
* '''-y'''  Create python package (Assume setup.py is there)
* '''-s'''  Use sourceforge source URL
* '''-c'''  Copy a sample init.d, conf.d, and install script to new directory
* '''-f'''  Force even if directory already exist
* '''-h''' Show this help


[[Category:Development]]
If you are creating a daemon package which needs initd scripts you can add the '''-c''' option as follows:{{Cmd|newapkbuild -c packagename}}
 
This will copy the sample ''initd'' and ''confd'' files to the build directory. A third file ''sample.install'' file will be copied as well (we will discuss this later on).

Latest revision as of 09:02, 26 February 2025

The newapkbuild tool, which is installed as part of the abuild package, can generate a new APKBUILD template to use as a starting point. The manual page (available via man newapkbuild) describes all options for newapkbuild.

If you doubt to which repository your package belongs to you can safely use testing. Building package in your aports/testing directory is not mandatory but this way the package is already at the right place.

Tip: Follow the package naming conventions mentioned in package policies while choosing a packagename.

The following command will create a directory with the given package name, place an example/template APKBUILD file in the directory, and fill some variables if those are provided.

newapkbuild packagename

If you are creating a daemon package which needs initd scripts you can add the -c option as follows:

newapkbuild -c packagename

This will copy the sample initd and confd files to the build directory. A third file sample.install file will be copied as well (we will discuss this later on).