Abuild and Helpers: Difference between revisions
WhyNotHugo (talk | contribs) (→Updating a package release: Flatten title hierarchy) |
WhyNotHugo (talk | contribs) (→Generating new APKBUILDs: Link to man page instead of duplicating it) |
||
Line 53: | Line 53: | ||
To create the actual APKBUILD file {{Pkg|newapkbuild}} can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file in the given directory, and fill some variables if those are provided. | To create the actual APKBUILD file {{Pkg|newapkbuild}} can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file in the given directory, and fill some variables if those are provided. | ||
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>. | |||
=== apkbuild-cpan === | === apkbuild-cpan === | ||
Line 62: | Line 62: | ||
=== apkbuild-pypi === | === apkbuild-pypi === | ||
{{:Include:Apkbuild-pypi}} | {{:Include:Apkbuild-pypi}} | ||
== Signing packages and indexes == | == Signing packages and indexes == |
Revision as of 15:06, 19 November 2023
The abuild
package provides scripts necessary for creating packages for Alpine Linux. It implements functionality for building packages as well as additional commands and options for package maintenance.
For package development and maintenance, it is recommended to install the alpine-sdk
, which will install abuild
in addition to other relevant tools.
apk add alpine-sdk
The git repository always contains the latest version of the scripts, example-files, and makefiles.
Building packages
Prerequisites
In order to use abuild
:
- Your user account must be a member of the
abuild
group. - The environment must be set up for abuild.
Basic usage
If you just want to build a package from an APKBUILD file, only two command are needed. Both commands operate on an APKBUILD file in the current directory, so you should cd
into the directory before running them.
abuild checksum
: updates the checksums for source files.abuild -r
: builds the package.
The manual page (available via man abuild
) describes all options and commands for abuild
.
Building in a chroot
Install package abuild-rootbld
:
apk add abuild-rootbld
You may now build your packages from source in an unprivileged sandbox based on bubblewrap with the command:
abuild rootbld
rootbld
assumes your APKBUILD file is in a directory structure like aports or you need to set environment variable APORTSDIR
to current directory.
If the build process needs network access there has to bet set the net option in APKBUILD.
Note that using rootbld
inside a docker container requires additional configuration.
Bumping a package version
The abuild
package provides scripts necessary for creating packages for Alpine Linux. It implements functionality for building packages as well as additional commands and options for package maintenance.
For package development and maintenance, it is recommended to install the alpine-sdk
, which will install abuild
in addition to other relevant tools.
apk add alpine-sdk
The git repository always contains the latest version of the scripts, example-files, and makefiles.
Building packages
Prerequisites
In order to use abuild
:
- Your user account must be a member of the
abuild
group. - The environment must be set up for abuild.
Basic usage
If you just want to build a package from an APKBUILD file, only two command are needed. Both commands operate on an APKBUILD file in the current directory, so you should cd
into the directory before running them.
abuild checksum
: updates the checksums for source files.abuild -r
: builds the package.
The manual page (available via man abuild
) describes all options and commands for abuild
.
Building in a chroot
Install package abuild-rootbld
:
apk add abuild-rootbld
You may now build your packages from source in an unprivileged sandbox based on bubblewrap with the command:
abuild rootbld
rootbld
assumes your APKBUILD file is in a directory structure like aports or you need to set environment variable APORTSDIR
to current directory.
If the build process needs network access there has to bet set the net option in APKBUILD.
Note that using rootbld
inside a docker container requires additional configuration.
Bumping a package version
Template loop detected: Include:Abump
Updating a package release
If you want to bump or reset the pkgrel value of your APKBUILD or test your APKBUILD files, apkgrel can assist you.
apkgrel -a|-h|-s NUM|-t|-z [-f] FILE...
apkgrel options
- -a Add 1 to current pkgrel
- -f Force, even if given files are not in proper format
- -h Show this help
- -s Set pkgrel to NUM
- -t Only verify that files are in proper format
- -z Set pkgrel to 0
Generating new APKBUILDs
newapkbuild
To create the actual APKBUILD file newapkbuild can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file in the given directory, and fill some variables if those are provided.
The manual page (available via man newapkbuild
) describes all options for newapkbuild
.
apkbuild-cpan
The Comprehensive Perl Archive Network (CPAN) provides a large collection of perl software and documentation. apkbuild-cpan helps with the creation of APKBUILD for perl modules from CPAN.
apkbuild-cpan [create <Module::Name> | check | recreate | update | upgrade]
apkbuild-pypi
Template loop detected: Include:Apkbuild-pypi
Signing packages and indexes
abuild-sign
abuild-sign is for signing indexes.
abuild-sign [-hq] [-k PRIVKEY] [-p PUBKEY] INDEXFILE...
abuild-sign options
- -h Show this help
- -k The private key to use for signing
- -p The name of public key. apk add will look for /etc/apk/keys/PUBKEY
abuild-tar
abuild-tar [--hash[=<algorithm>]] [--cut]
abuild-tar options
- --hash[=sha1|md5] Read tar archive from stdin, precalculate hash for regular entries and output tar archive on stdout
- --cut Remove the end of file tar record
buildrepo
Template loop detected: Include:Buildrepo
Setting up the build environment
abuild-keygen
For abuild a public/private rsa key pair is needed. The abuild-keygen
command from abuild package generates and configures the security keys.
$ doas abuild-keygen -a -i
abuild-keygen options
- -a Set PACKAGER_PRIVKEY=<generated key> in abuild.conf
- -i Install public key into /etc/apk/keys using sudo
- -h Show this help
- -n Non-interactive. Use defaults
- -q Quiet mode
Updating a package release
If you want to bump or reset the pkgrel value of your APKBUILD or test your APKBUILD files, apkgrel can assist you.
apkgrel -a|-h|-s NUM|-t|-z [-f] FILE...
apkgrel options
- -a Add 1 to current pkgrel
- -f Force, even if given files are not in proper format
- -h Show this help
- -s Set pkgrel to NUM
- -t Only verify that files are in proper format
- -z Set pkgrel to 0
Generating new APKBUILDs
newapkbuild
To create the actual APKBUILD file newapkbuild can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file in the given directory, and fill some variables if those are provided.
The manual page (available via man newapkbuild
) describes all options for newapkbuild
.
apkbuild-cpan
The Comprehensive Perl Archive Network (CPAN) provides a large collection of perl software and documentation. apkbuild-cpan helps with the creation of APKBUILD for perl modules from CPAN.
apkbuild-cpan [create <Module::Name> | check | recreate | update | upgrade]
apkbuild-pypi
The abuild
package provides scripts necessary for creating packages for Alpine Linux. It implements functionality for building packages as well as additional commands and options for package maintenance.
For package development and maintenance, it is recommended to install the alpine-sdk
, which will install abuild
in addition to other relevant tools.
apk add alpine-sdk
The git repository always contains the latest version of the scripts, example-files, and makefiles.
Building packages
Prerequisites
In order to use abuild
:
- Your user account must be a member of the
abuild
group. - The environment must be set up for abuild.
Basic usage
If you just want to build a package from an APKBUILD file, only two command are needed. Both commands operate on an APKBUILD file in the current directory, so you should cd
into the directory before running them.
abuild checksum
: updates the checksums for source files.abuild -r
: builds the package.
The manual page (available via man abuild
) describes all options and commands for abuild
.
Building in a chroot
Install package abuild-rootbld
:
apk add abuild-rootbld
You may now build your packages from source in an unprivileged sandbox based on bubblewrap with the command:
abuild rootbld
rootbld
assumes your APKBUILD file is in a directory structure like aports or you need to set environment variable APORTSDIR
to current directory.
If the build process needs network access there has to bet set the net option in APKBUILD.
Note that using rootbld
inside a docker container requires additional configuration.
Bumping a package version
Template loop detected: Include:Abump
Updating a package release
If you want to bump or reset the pkgrel value of your APKBUILD or test your APKBUILD files, apkgrel can assist you.
apkgrel -a|-h|-s NUM|-t|-z [-f] FILE...
apkgrel options
- -a Add 1 to current pkgrel
- -f Force, even if given files are not in proper format
- -h Show this help
- -s Set pkgrel to NUM
- -t Only verify that files are in proper format
- -z Set pkgrel to 0
Generating new APKBUILDs
newapkbuild
To create the actual APKBUILD file newapkbuild can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file in the given directory, and fill some variables if those are provided.
The manual page (available via man newapkbuild
) describes all options for newapkbuild
.
apkbuild-cpan
The Comprehensive Perl Archive Network (CPAN) provides a large collection of perl software and documentation. apkbuild-cpan helps with the creation of APKBUILD for perl modules from CPAN.
apkbuild-cpan [create <Module::Name> | check | recreate | update | upgrade]
apkbuild-pypi
Template loop detected: Include:Apkbuild-pypi
Signing packages and indexes
abuild-sign
abuild-sign is for signing indexes.
abuild-sign [-hq] [-k PRIVKEY] [-p PUBKEY] INDEXFILE...
abuild-sign options
- -h Show this help
- -k The private key to use for signing
- -p The name of public key. apk add will look for /etc/apk/keys/PUBKEY
abuild-tar
abuild-tar [--hash[=<algorithm>]] [--cut]
abuild-tar options
- --hash[=sha1|md5] Read tar archive from stdin, precalculate hash for regular entries and output tar archive on stdout
- --cut Remove the end of file tar record
buildrepo
Template loop detected: Include:Buildrepo
Setting up the build environment
abuild-keygen
For abuild a public/private rsa key pair is needed. The abuild-keygen
command from abuild package generates and configures the security keys.
$ doas abuild-keygen -a -i
abuild-keygen options
- -a Set PACKAGER_PRIVKEY=<generated key> in abuild.conf
- -i Install public key into /etc/apk/keys using sudo
- -h Show this help
- -n Non-interactive. Use defaults
- -q Quiet mode
Signing packages and indexes
abuild-sign
abuild-sign is for signing indexes.
abuild-sign [-hq] [-k PRIVKEY] [-p PUBKEY] INDEXFILE...
abuild-sign options
- -h Show this help
- -k The private key to use for signing
- -p The name of public key. apk add will look for /etc/apk/keys/PUBKEY
abuild-tar
abuild-tar [--hash[=<algorithm>]] [--cut]
abuild-tar options
- --hash[=sha1|md5] Read tar archive from stdin, precalculate hash for regular entries and output tar archive on stdout
- --cut Remove the end of file tar record
buildrepo
The abuild
package provides scripts necessary for creating packages for Alpine Linux. It implements functionality for building packages as well as additional commands and options for package maintenance.
For package development and maintenance, it is recommended to install the alpine-sdk
, which will install abuild
in addition to other relevant tools.
apk add alpine-sdk
The git repository always contains the latest version of the scripts, example-files, and makefiles.
Building packages
Prerequisites
In order to use abuild
:
- Your user account must be a member of the
abuild
group. - The environment must be set up for abuild.
Basic usage
If you just want to build a package from an APKBUILD file, only two command are needed. Both commands operate on an APKBUILD file in the current directory, so you should cd
into the directory before running them.
abuild checksum
: updates the checksums for source files.abuild -r
: builds the package.
The manual page (available via man abuild
) describes all options and commands for abuild
.
Building in a chroot
Install package abuild-rootbld
:
apk add abuild-rootbld
You may now build your packages from source in an unprivileged sandbox based on bubblewrap with the command:
abuild rootbld
rootbld
assumes your APKBUILD file is in a directory structure like aports or you need to set environment variable APORTSDIR
to current directory.
If the build process needs network access there has to bet set the net option in APKBUILD.
Note that using rootbld
inside a docker container requires additional configuration.
Bumping a package version
Template loop detected: Include:Abump
Updating a package release
If you want to bump or reset the pkgrel value of your APKBUILD or test your APKBUILD files, apkgrel can assist you.
apkgrel -a|-h|-s NUM|-t|-z [-f] FILE...
apkgrel options
- -a Add 1 to current pkgrel
- -f Force, even if given files are not in proper format
- -h Show this help
- -s Set pkgrel to NUM
- -t Only verify that files are in proper format
- -z Set pkgrel to 0
Generating new APKBUILDs
newapkbuild
To create the actual APKBUILD file newapkbuild can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file in the given directory, and fill some variables if those are provided.
The manual page (available via man newapkbuild
) describes all options for newapkbuild
.
apkbuild-cpan
The Comprehensive Perl Archive Network (CPAN) provides a large collection of perl software and documentation. apkbuild-cpan helps with the creation of APKBUILD for perl modules from CPAN.
apkbuild-cpan [create <Module::Name> | check | recreate | update | upgrade]
apkbuild-pypi
Template loop detected: Include:Apkbuild-pypi
Signing packages and indexes
abuild-sign
abuild-sign is for signing indexes.
abuild-sign [-hq] [-k PRIVKEY] [-p PUBKEY] INDEXFILE...
abuild-sign options
- -h Show this help
- -k The private key to use for signing
- -p The name of public key. apk add will look for /etc/apk/keys/PUBKEY
abuild-tar
abuild-tar [--hash[=<algorithm>]] [--cut]
abuild-tar options
- --hash[=sha1|md5] Read tar archive from stdin, precalculate hash for regular entries and output tar archive on stdout
- --cut Remove the end of file tar record
buildrepo
Template loop detected: Include:Buildrepo
Setting up the build environment
abuild-keygen
For abuild a public/private rsa key pair is needed. The abuild-keygen
command from abuild package generates and configures the security keys.
$ doas abuild-keygen -a -i
abuild-keygen options
- -a Set PACKAGER_PRIVKEY=<generated key> in abuild.conf
- -i Install public key into /etc/apk/keys using sudo
- -h Show this help
- -n Non-interactive. Use defaults
- -q Quiet mode
Setting up the build environment
abuild-keygen
For abuild a public/private rsa key pair is needed. The abuild-keygen
command from abuild package generates and configures the security keys.
$ doas abuild-keygen -a -i
abuild-keygen options
- -a Set PACKAGER_PRIVKEY=<generated key> in abuild.conf
- -i Install public key into /etc/apk/keys using sudo
- -h Show this help
- -n Non-interactive. Use defaults
- -q Quiet mode