Skip to content

ACBS Tree

Tianhao Chai edited this page Jan 20, 2017 · 2 revisions

Trees?

ACBS reads build configurations from a repository, and its content is stored in one or multiple trees depending on ACBS configuration, discussed in the "Planting a forest" chapter.

For the sake of demonstration, here is an example ACBS tree layout stored in /usr/lib/acbs/repo.

$ find /usr/lib/acbs/repo
/usr/lib/acbs/repo
/usr/lib/acbs/repo/base-utils
/usr/lib/acbs/repo/base-utils/screen
/usr/lib/acbs/repo/base-utils/screen/autobuild
/usr/lib/acbs/repo/base-utils/screen/autobuild/defines
/usr/lib/acbs/repo/base-utils/screen/spec

Breaking down the path shows:

  • base-utils/ - a category/section of packages, all section should be prefixed with extra- or base-.
  • screen/ - the screen package inside of the base-util category.
  • spec - base package specifications of screen.
  • autobuild - autobuild configurations, see the Autobuild3 section.

So, to acbs-build, this is a package named base-utils/screen. A two-layer-deep tree repository.

ACBS trees are usually managed with a version control system.

Management

This section discusses some basic management knowledge of an ACBS tree.

Planting a tree

Planting an ABBS tree/repository is simple, simply create a directory, create different sections, and packages inside of the sections accompanied with a spec file and an autobuild/ directory.

For example, if we want to introduce the package atom-editor to the ACBS tree, we will first create a category for it, say extra-editors.

cd "$ABBS"/repo
mkdir extra-editors/

Then, we will create a directory for atom-editor itself.

cd github-editors/
mkdir atom-editor/

Then, create a spec file for atom-editor. The spec file contains version and source information of the package.

VER=1.5.2
SRCTBL="https://github.com/atom/atom/archive/v1.5.2.tar.gz"
CHKSUM="sha256::1143189accbb7dc09fb045e739eb5ba41f6a7563da89baa62d785b70da53798b"

SRCTBL defines the "source tarball" of the package. We also strongly recommend specifying CHKSUM="<hash-algorithm>::<checksum>" to verify downloaded tarballs. Other kinds of source are also supported:

  • Git checkouts
    • GITSRC= defines the Git repository address.
    • GITBRCH= defines the Git branch to use.
    • GITCO= defines the checkout to use.
  • SVN checkouts
    • SVNSRC= defines the SVN repository address.
    • SVNCO= defines the SVN checkout to use.
  • HG/Mercurial checkouts
    • HGSRC= defines the HG repository address.
  • BZR/Bazaar checkouts
    • BZRSRC= defines the BZR repository address.
    • BZRCO= defines the BZR checkout to use.
  • Dummy sources
    • DUMMYSRC= expects a binary value (0/1) to decide whether dummy source should be used. Useful when creating dummy/meta packages.

Packagers may also specify source subdirectory with the SUBDIR= option, or otherwise automatically detected by acbs-build.

The spec file is sourced by Bash, therefore you may substitute any variables to save work in the future. Now, you will introduce the autobuild/ directory with all necessary Autobuild3 configurations. See the Autobuild3 section for information on how to create an Autobuild3 configuration.

Repeat the action for packages you would like to import to the repository.

Building from a tree

Building a package from an ACBS tree/repository is as simple as the command below.

abbs-build github-editors/atom-editor

Or by using the short form.

abbs-build atom-editor

Maintaining a tree

Understanding the nature of an ACBS tree/repository, you will see that if a large amount of packages are included in a tree, you may find it difficult to maintain such a tree.

There is nothing wrong with a huge tree, but using a Version Control System (VCS) like Git usually helps.