Abuild and Helpers: Difference between revisions

From Alpine Linux
m (nothing todo here, this page is FYI only)
mNo edit summary
Line 1: Line 1:
{{Warning| This page is for information purposes only.  The abuild script is installed automatically along with the alpine-sdk package}}
The abuild script and its friends are installed automatically along with the <tt>alpine-sdk</tt> package. The [http://git.alpinelinux.org/cgit/abuild.git/tree/ git repository] contains always the lastest version of the scripts, example-files, and makefiles.
== Introduction ==
The [http://git.alpinelinux.org/cgit/abuild.git/tree/ abuild] tree is a directory tree with scripts, example-files, makefiles, and other things that you need when creating packages.


== File descriptions ==
=== 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.
* ''[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 ===
''[http://git.alpinelinux.org/cgit/abuild.git/tree/alpine.mk alpine.mk]'' is used when creating a Alpine Linux iso image or tar.gz.
<!--
=== mkalpine ===
[http://dev.alpinelinux.org/cgit/abuild/tree/mkalpine mkalpine] is a helper script that installs what you need to be able to create Alpine.
-->
== Fetch latest abuild ==  
== 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.
While inside your [[Setting up the build environment 1.9|build environment]] you need to have the set of scripts/makefiles/etc.
Line 25: Line 13:
{{Cmd|cd ~
{{Cmd|cd ~
  git pull}}
  git pull}}
== Package build helpers ==
=== abuild-keygen ===
{{:Abuild-keygen}}
=== abuild-sign ===
{{:Abuild-sign}}
=== abuild-tar ===
{{:Abuild-tar}}
=== abump ===
{{:Abump}}
=== apkgrel ===
{{:Apkgrel}}
=== abuild ===
{{:Abuild}}
== APKBUILD generation ==
=== newapkbuild ===
To create the actual APKBUILD file <tt>newapkbuild</tt> can serve you a template to start with. It will create a directory with the given package name, place an example/template APKBUILD file to the given directory, and fill some variables if those are provided.
{{:Newapkbuild}}
=== apkbuild-cpan ===
{{:Apkbuild-cpan}}
=== apkbuild-pypi ===
{{:Apkbuild-pypi}}
== Misc tools ==
=== buildlab ===
More details can be found at the [[Buildlab|buildlab]] page.
=== buildrepo ===
{{:Buildrepo}}
<!-- ToDo
=== cmp-apks-iso ===
=== devbuild ===
=== initramfs-init ===
-->

Revision as of 11:38, 6 December 2011

The abuild script and its friends are installed automatically along with the alpine-sdk package. The git repository contains always the lastest version of the scripts, example-files, and makefiles.

Fetch latest abuild

While inside your 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.

apk add alpine-sdk cd ~ git clone git://dev.alpinelinux.org/abuild

When the above is done you might be interested in fetching the latest updates.

cd ~ git pull

Package build helpers

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.

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

abump

The abuild script and its friends are installed automatically along with the alpine-sdk package. The git repository contains always the lastest version of the scripts, example-files, and makefiles.

Fetch latest abuild

While inside your 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.

apk add alpine-sdk cd ~ git clone git://dev.alpinelinux.org/abuild

When the above is done you might be interested in fetching the latest updates.

cd ~ git pull

Package build helpers

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.

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

abump

Template loop detected: Abump

apkgrel

Apkgrel

abuild

Template loop detected: Abuild

APKBUILD generation

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 to the given directory, and fill some variables if those are provided.

Template loop detected: Newapkbuild

apkbuild-cpan

Apkbuild-cpan

apkbuild-pypi

Template loop detected: Apkbuild-pypi


Misc tools

buildlab

More details can be found at the buildlab page.


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



apkgrel

Apkgrel

abuild

The abuild script and its friends are installed automatically along with the alpine-sdk package. The git repository contains always the lastest version of the scripts, example-files, and makefiles.

Fetch latest abuild

While inside your 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.

apk add alpine-sdk cd ~ git clone git://dev.alpinelinux.org/abuild

When the above is done you might be interested in fetching the latest updates.

cd ~ git pull

Package build helpers

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.

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

abump

Template loop detected: Abump

apkgrel

Apkgrel

abuild

Template loop detected: Abuild

APKBUILD generation

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 to the given directory, and fill some variables if those are provided.

Template loop detected: Newapkbuild

apkbuild-cpan

Apkbuild-cpan

apkbuild-pypi

Template loop detected: Apkbuild-pypi


Misc tools

buildlab

More details can be found at the buildlab page.


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



APKBUILD generation

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 to the given directory, and fill some variables if those are provided.

The abuild script and its friends are installed automatically along with the alpine-sdk package. The git repository contains always the lastest version of the scripts, example-files, and makefiles.

Fetch latest abuild

While inside your 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.

apk add alpine-sdk cd ~ git clone git://dev.alpinelinux.org/abuild

When the above is done you might be interested in fetching the latest updates.

cd ~ git pull

Package build helpers

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.

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

abump

Template loop detected: Abump

apkgrel

Apkgrel

abuild

Template loop detected: Abuild

APKBUILD generation

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 to the given directory, and fill some variables if those are provided.

Template loop detected: Newapkbuild

apkbuild-cpan

Apkbuild-cpan

apkbuild-pypi

Template loop detected: Apkbuild-pypi


Misc tools

buildlab

More details can be found at the buildlab page.


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



apkbuild-cpan

Apkbuild-cpan

apkbuild-pypi

The abuild script and its friends are installed automatically along with the alpine-sdk package. The git repository contains always the lastest version of the scripts, example-files, and makefiles.

Fetch latest abuild

While inside your 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.

apk add alpine-sdk cd ~ git clone git://dev.alpinelinux.org/abuild

When the above is done you might be interested in fetching the latest updates.

cd ~ git pull

Package build helpers

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.

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

abump

Template loop detected: Abump

apkgrel

Apkgrel

abuild

Template loop detected: Abuild

APKBUILD generation

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 to the given directory, and fill some variables if those are provided.

Template loop detected: Newapkbuild

apkbuild-cpan

Apkbuild-cpan

apkbuild-pypi

Template loop detected: Apkbuild-pypi


Misc tools

buildlab

More details can be found at the buildlab page.


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



Misc tools

buildlab

More details can be found at the buildlab page.


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