Abuild and Helpers: Difference between revisions

From Alpine Linux
m (links updated)
(buildlab is broken, add rootbld to ToDo)
(20 intermediate revisions by 6 users not shown)
Line 1: Line 1:
== Introduction ==
The abuild package provides scripts you need when creating packages for Alpine Linux. The abuild package and its friends are installed automatically along with the <tt>alpine-sdk</tt> package.
The [http://dev.alpinelinux.org/cgit/abuild/ abuild] tree is a [http://dev.alpinelinux.org/cgit/abuild/tree/ directory tree] with scripts, example-files, makefiles and other things that you need when creating packages.
 
{{Cmd|apk add alpine-sdk}}
 
The [https://git.alpinelinux.org/cgit/abuild/tree/ git repository] always contains the latest version of the scripts, example-files, and makefiles.
 
 
== Building and maintaining packages ==


== File descriptions ==
=== abuild ===
=== abuild ===
* The ''[http://git.alpinelinux.org/cgit/abuild.git/ abuild]'' script reads the ''[http://git.alpinelinux.org/cgit/abuild.git/tree/sample.APKBUILD APKBUILD]'' and executes the steps needed to create a package.
{{:Include:Abuild}}
* ''[http://git.alpinelinux.org/cgit/abuild.git/ abuild]'' has a [http://git.alpinelinux.org/cgit/abuild.git/tree/abuild.conf config file] that you can modify for your own needs.
 
=== alpine.mk ===
=== abump ===
''[http://git.alpinelinux.org/cgit/abuild.git/tree/alpine.mk alpine.mk]'' is used when creating a Alpine Linux iso image or tar.gz.
{{:Include:Abump}}
<!--
 
=== mkalpine ===
=== apkgrel ===
[http://dev.alpinelinux.org/cgit/abuild/tree/mkalpine mkalpine] is a helper script that installs what you need to be able to create Alpine.
<!-- Shouldn't this be apkrel? None of the other packaging tools use "apkg...". Or perhaps it should be unified with abump? -->
-->
{{:Include:Apkgrel}}
== Fetch latest abuild ==  
 
While inside your [[Setting up the build environment 1.9|build environment]] you need to have the set of scripts/makefiles/etc.
 
{{Note|You only need to do these 2 steps once! Next time you can skip this part.}}
== Generating new APKBUILDs ==
 
=== newapkbuild ===
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.
 
{{:Include:Newapkbuild}}
 
=== apkbuild-cpan ===
{{:Include:Apkbuild-cpan}}
 
=== apkbuild-pypi ===
{{:Include:Apkbuild-pypi}}
 
 
 
== Signing packages and indexes ==
 
=== abuild-sign ===
{{:Include:Abuild-sign}}
 
=== abuild-tar ===
{{:Include:Abuild-tar}}
 
=== buildrepo ===
{{:Include:Buildrepo}}
 
 
== Setting up the build environment ==
 
=== abuild-keygen ===
{{:Include:Abuild-keygen}}
 
<!-- ToDo
=== cmp-apks-iso ===


{{Cmd|apk add alpine-sdk
=== devbuild ===
cd ~
git clone git://dev.alpinelinux.org/abuild}}


When the above is done you might be interested in fetching the latest updates.
=== initramfs-init ===


{{Cmd|cd ~
=== rootbld ===
git pull}}
-->

Revision as of 10:28, 24 April 2019

The abuild package provides scripts you need when creating packages for Alpine Linux. The abuild package and its friends are installed automatically along with the alpine-sdk package.

apk add alpine-sdk

The git repository always contains the latest version of the scripts, example-files, and makefiles.


Building and maintaining packages

abuild

The abuild package provides scripts you need when creating packages for Alpine Linux. The abuild package and its friends are installed automatically along with the alpine-sdk package.

apk add alpine-sdk

The git repository always contains the latest version of the scripts, example-files, and makefiles.


Building and maintaining packages

abuild

Template loop detected: Include:Abuild

abump

Template loop detected: Include:Abump

apkgrel

Include:Apkgrel


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.

Template loop detected: Include:Newapkbuild

apkbuild-cpan

Include:Apkbuild-cpan

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

apkbuild-tar [--hash[=<algorithm>]] [--cut]

apkbuild-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

buildrepo creates a local package repository for you.

buildrepo [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ] [-r DEPREPO] REPOSITORY...

buildrepo options

  • -a Set the aports base dir to APORTSDIR instead of $HOME/aports
  • -d Set destination repository base dir to REPODIR instead of $HOME/packages
  • -h Show this help and exit
  • -l Send build to logfile, prefixed by LOGPREFIX
  • -p Purge obsolete packages from REPODIR after build
  • -r Dependencies are found in DEPREPO


Setting up the build environment

abuild-keygen

For abuild a public/private rsa key pair is needed. abuild-keygen does the generation of those keys for you.

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


Creating keys manually

In older versions of Alpine, we had to manually create keys for signing packages and indexes. This explains how. Nowadays you can just use abuild-keygen.

Since the public key needs to be unique for each developer, the email address should be used as name for the public key.

Create the private key:

openssl genrsa -out emailaddress.priv 2048

Tip: Append -aes256 if you want it encrypted, but then you'll need to enter the password for every package you sign

Create the public key:

openssl rsa -in emailaddress.priv -pubout -out /etc/apk/keys/emailaddress

The public key should be distributed and installed into /etc/apk/keys on the alpine box that will install the packages. The private key, when created by abuild, is installed into ~/.abuild/$something.rsa. This basically means that the main developer's public keys should be in /etc/apk/keys on all Alpine boxes.


abump

The abuild package provides scripts you need when creating packages for Alpine Linux. The abuild package and its friends are installed automatically along with the alpine-sdk package.

apk add alpine-sdk

The git repository always contains the latest version of the scripts, example-files, and makefiles.


Building and maintaining packages

abuild

Template loop detected: Include:Abuild

abump

Template loop detected: Include:Abump

apkgrel

Include:Apkgrel


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.

Template loop detected: Include:Newapkbuild

apkbuild-cpan

Include:Apkbuild-cpan

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

apkbuild-tar [--hash[=<algorithm>]] [--cut]

apkbuild-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

buildrepo creates a local package repository for you.

buildrepo [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ] [-r DEPREPO] REPOSITORY...

buildrepo options

  • -a Set the aports base dir to APORTSDIR instead of $HOME/aports
  • -d Set destination repository base dir to REPODIR instead of $HOME/packages
  • -h Show this help and exit
  • -l Send build to logfile, prefixed by LOGPREFIX
  • -p Purge obsolete packages from REPODIR after build
  • -r Dependencies are found in DEPREPO


Setting up the build environment

abuild-keygen

For abuild a public/private rsa key pair is needed. abuild-keygen does the generation of those keys for you.

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


Creating keys manually

In older versions of Alpine, we had to manually create keys for signing packages and indexes. This explains how. Nowadays you can just use abuild-keygen.

Since the public key needs to be unique for each developer, the email address should be used as name for the public key.

Create the private key:

openssl genrsa -out emailaddress.priv 2048

Tip: Append -aes256 if you want it encrypted, but then you'll need to enter the password for every package you sign

Create the public key:

openssl rsa -in emailaddress.priv -pubout -out /etc/apk/keys/emailaddress

The public key should be distributed and installed into /etc/apk/keys on the alpine box that will install the packages. The private key, when created by abuild, is installed into ~/.abuild/$something.rsa. This basically means that the main developer's public keys should be in /etc/apk/keys on all Alpine boxes.


apkgrel

Include:Apkgrel


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 abuild package provides scripts you need when creating packages for Alpine Linux. The abuild package and its friends are installed automatically along with the alpine-sdk package.

apk add alpine-sdk

The git repository always contains the latest version of the scripts, example-files, and makefiles.


Building and maintaining packages

abuild

Template loop detected: Include:Abuild

abump

Template loop detected: Include:Abump

apkgrel

Include:Apkgrel


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.

Template loop detected: Include:Newapkbuild

apkbuild-cpan

Include:Apkbuild-cpan

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

apkbuild-tar [--hash[=<algorithm>]] [--cut]

apkbuild-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

buildrepo creates a local package repository for you.

buildrepo [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ] [-r DEPREPO] REPOSITORY...

buildrepo options

  • -a Set the aports base dir to APORTSDIR instead of $HOME/aports
  • -d Set destination repository base dir to REPODIR instead of $HOME/packages
  • -h Show this help and exit
  • -l Send build to logfile, prefixed by LOGPREFIX
  • -p Purge obsolete packages from REPODIR after build
  • -r Dependencies are found in DEPREPO


Setting up the build environment

abuild-keygen

For abuild a public/private rsa key pair is needed. abuild-keygen does the generation of those keys for you.

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


Creating keys manually

In older versions of Alpine, we had to manually create keys for signing packages and indexes. This explains how. Nowadays you can just use abuild-keygen.

Since the public key needs to be unique for each developer, the email address should be used as name for the public key.

Create the private key:

openssl genrsa -out emailaddress.priv 2048

Tip: Append -aes256 if you want it encrypted, but then you'll need to enter the password for every package you sign

Create the public key:

openssl rsa -in emailaddress.priv -pubout -out /etc/apk/keys/emailaddress

The public key should be distributed and installed into /etc/apk/keys on the alpine box that will install the packages. The private key, when created by abuild, is installed into ~/.abuild/$something.rsa. This basically means that the main developer's public keys should be in /etc/apk/keys on all Alpine boxes.


apkbuild-cpan

Include:Apkbuild-cpan

apkbuild-pypi

The abuild package provides scripts you need when creating packages for Alpine Linux. The abuild package and its friends are installed automatically along with the alpine-sdk package.

apk add alpine-sdk

The git repository always contains the latest version of the scripts, example-files, and makefiles.


Building and maintaining packages

abuild

Template loop detected: Include:Abuild

abump

Template loop detected: Include:Abump

apkgrel

Include:Apkgrel


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.

Template loop detected: Include:Newapkbuild

apkbuild-cpan

Include:Apkbuild-cpan

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

apkbuild-tar [--hash[=<algorithm>]] [--cut]

apkbuild-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

buildrepo creates a local package repository for you.

buildrepo [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ] [-r DEPREPO] REPOSITORY...

buildrepo options

  • -a Set the aports base dir to APORTSDIR instead of $HOME/aports
  • -d Set destination repository base dir to REPODIR instead of $HOME/packages
  • -h Show this help and exit
  • -l Send build to logfile, prefixed by LOGPREFIX
  • -p Purge obsolete packages from REPODIR after build
  • -r Dependencies are found in DEPREPO


Setting up the build environment

abuild-keygen

For abuild a public/private rsa key pair is needed. abuild-keygen does the generation of those keys for you.

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


Creating keys manually

In older versions of Alpine, we had to manually create keys for signing packages and indexes. This explains how. Nowadays you can just use abuild-keygen.

Since the public key needs to be unique for each developer, the email address should be used as name for the public key.

Create the private key:

openssl genrsa -out emailaddress.priv 2048

Tip: Append -aes256 if you want it encrypted, but then you'll need to enter the password for every package you sign

Create the public key:

openssl rsa -in emailaddress.priv -pubout -out /etc/apk/keys/emailaddress

The public key should be distributed and installed into /etc/apk/keys on the alpine box that will install the packages. The private key, when created by abuild, is installed into ~/.abuild/$something.rsa. This basically means that the main developer's public keys should be in /etc/apk/keys on all Alpine boxes.



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

apkbuild-tar [--hash[=<algorithm>]] [--cut]

apkbuild-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

buildrepo creates a local package repository for you.

buildrepo [-a APORTSDIR] [-d REPODIR] [-hp] [-l LOGPREFIX ] [-r DEPREPO] REPOSITORY...

buildrepo options

  • -a Set the aports base dir to APORTSDIR instead of $HOME/aports
  • -d Set destination repository base dir to REPODIR instead of $HOME/packages
  • -h Show this help and exit
  • -l Send build to logfile, prefixed by LOGPREFIX
  • -p Purge obsolete packages from REPODIR after build
  • -r Dependencies are found in DEPREPO


Setting up the build environment

abuild-keygen

For abuild a public/private rsa key pair is needed. abuild-keygen does the generation of those keys for you.

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


Creating keys manually

In older versions of Alpine, we had to manually create keys for signing packages and indexes. This explains how. Nowadays you can just use abuild-keygen.

Since the public key needs to be unique for each developer, the email address should be used as name for the public key.

Create the private key:

openssl genrsa -out emailaddress.priv 2048

Tip: Append -aes256 if you want it encrypted, but then you'll need to enter the password for every package you sign

Create the public key:

openssl rsa -in emailaddress.priv -pubout -out /etc/apk/keys/emailaddress

The public key should be distributed and installed into /etc/apk/keys on the alpine box that will install the packages. The private key, when created by abuild, is installed into ~/.abuild/$something.rsa. This basically means that the main developer's public keys should be in /etc/apk/keys on all Alpine boxes.