Arch Build System: Home Packages Forums Bugs AUR Download
Arch Build System: Home Packages Forums Bugs AUR Download
open in browser PRO version Are you a developer? Try out the HTML to PDF API pdfcrowd.com
Page information 3.4.1.2 Showing only packages contained in repos
3.5 Create a build directory
in other languages
3.6 Build package
Čeština
3.6.1 fakeroot
Dansk
3.7 Preserve modified packages
Deutsch
Ελληνικά 4 Other tools
Español
Français What is the Arch Build System?
Italiano
日本語 The Arch Build System, ABS for short, is a ports-like system for building and packaging software from
한국어 source code. While pacman is the specialized Arch tool for binary package management (including
Polski packages built with the ABS), ABS is a collection of tools for compiling source into installable .pkg.tar.xz
Română
packages.
Русский
Türkçe
中文(中国大陆)
What is a ports-like system?
中文(台灣) Ports is a system used by *BSD to automate the process of building software from source code. The
system uses a port to download, unpack, patch, compile, and install the given software. A port is merely a
small directory on the user's computer, named after the corresponding software to be installed, that contains
a few files with the instructions for building and installing the software from source. This makes installing
software as simple as typing make or make install clean within the port's directory.
open in browser PRO version Are you a developer? Try out the HTML to PDF API pdfcrowd.com
most important component of ABS are PKGBUILDs.) By issuing the ABS makepkg command, the software
is first compiled and then packaged within the build directory before being installed. Now you may use
pacman, the Arch Linux package manager, to install, upgrade, and remove your new package.
ABS overview
'ABS' may be used as an umbrella term since it includes and relies on several other components; therefore,
though not technically accurate, 'ABS' can refer to the following tools as a complete toolkit:
ABS tree
The ABS directory structure; an SVN hierarchy under /var/abs/ on your (local) machine. It contains
many subdirectories, named for all available official Arch Linux software from repositories specified in
/etc/abs.conf , but not the packages themselves. The tree is created after installing the abs package
Note: The actual packages are available in svn and git repositories, and the abs script downloads
them using rsync.
PKGBUILDs
A Bash script that contains the URL of the source code along with the compilation and packaging
instructions.
makepkg
ABS shell command tool which reads the PKGBUILDs, automatically downloads and compiles the
sources and creates a .pkg.tar* according to the PKGEXT array in makepkg.conf . You may also use
makepkg to make your own custom packages from the AUR or third-party sources. (See the Creating
packages wiki article.)
pacman
pacman is completely separate, but is necessarily invoked either by makepkg or manually, to install and
remove the built packages and for fetching dependencies.
AUR
open in browser PRO version Are you a developer? Try out the HTML to PDF API pdfcrowd.com
The Arch User Repository is separate from ABS but AUR (unsupported) PKGBUILDs are built using
makepkg to compile and package up software. In contrast to the ABS tree on your local machine, the
AUR exists as a website interface. It contains many thousands of user-contributed PKGBUILDs for
software which is unavailable as an official Arch package. If you need to build a package outside the
official Arch tree, chances are it is in the AUR.
Install tools
To use the ABS, you first need to install abs from the official repositories.
This will grab the abs-sync scripts, various build scripts, and rsync (as a dependency, if you do not already
have it).
Before you can actually build anything, however, you will also need basic compiling tools. These are handily
collected in the package group base-devel. This group can be installed with pacman.
/etc/abs.conf
As root, edit /etc/abs.conf to include your desired repositories.
ABS tree
The ABS tree is an SVN directory hierarchy located under /var/abs and looks like this:
| -- core/
| || -- acl/
| || || -- PKGBUILD
| || -- attr/
| || || -- PKGBUILD
| || -- abs/
| || || -- PKGBUILD
| || -- autoconf/
| || || -- PKGBUILD
| || -- ...
| -- extra/
| || -- acpid/
| || || -- PKGBUILD
open in browser PRO version Are you a developer? Try out the HTML to PDF API pdfcrowd.com
| || || -- PKGBUILD
| || -- apache/
| || || -- PKGBUILD
| || -- ...
| -- community/
| || -- ...
The ABS tree has exactly the same structure as the package database:
First-level: Repository name
Second-level: Package name directories
Third level: PKGBUILD (contains information needed to build a package) and other related files (patches,
other files needed for building the package)
The source code for the package is not present in the ABS directory. Instead, the PKGBUILD file contains a
URL that will download the source code when the package is built. So the size of abs tree is quite small.
# abs
Your ABS tree is now created under /var/abs . Note the appropriate branches of the ABS tree now exist and
correspond to the ones you specified in /etc/abs.conf .
The abs command should be run periodically to keep in sync with the official repositories. Individual ABS
package files can also be downloaded with:
# abs <repository>/<package>
This way you do not have to check out the entire abs tree just to build one package.
/etc/makepkg.conf
makepkg's /etc/makepkg.conf specifies global environment variables and compiler flags which you may
wish to edit if you are using an SMP system, or to specify other desired optimizations. The default settings
open in browser PRO version Are you a developer? Try out the HTML to PDF API pdfcrowd.com
are for i686 and x86_64 optimizations which will work fine for those architectures on single-CPU systems.
(The defaults will work on SMP machines, but will only use one core/CPU when compiling -- see makepkg
for details.)
$ . /etc/makepkg.conf; grep -xvFf <(pacman -Qqm) <(expac "%n\t%p" | grep "$PACKAGER$" | cut -f1)
binutils
gcc
gcc-libs
glibc
tar
$ mkdir -p $HOME/abs
Copy the ABS from the tree ( /var/abs/<repository>/<pkgname> ) to the build directory.
Build package
In our example, we will build the slim display manager package.
Copy the slim ABS from the ABS tree to a build directory:
$ cp -r /var/abs/extra/slim/ ~/abs
$ cd ~/abs/slim
Modify the PKGBUILD to your liking, then run makepkg (with the -s flag to enable automatic build-time
dependency handling):
$ makepkg -s
Note: Before complaining about missing (make) dependencies, remember that the group base-devel is
assumed to be installed when building with makepkg. See #Install tools.
Install as root:
open in browser PRO version Are you a developer? Try out the HTML to PDF API pdfcrowd.com
# pacman -U slim-1.3.0-2-i686.pkg.tar.xz
That's it. You have just built slim from source and cleanly installed it to your system with pacman. Package
removal is also handled by pacman with pacman -R slim .
The ABS method adds a level of convenience and automation, while still maintaining complete transparency
and control of the build and installation functions by including them in the PKGBUILD.
fakeroot
Essentially, the same steps are being executed in the traditional method (generally including the
./configure, make, make install steps) but the software is installed into a fake root environment. (A fake
root is simply a subdirectory within the build directory that functions and behaves as the system's root
directory. In conjunction with the fakeroot program, makepkg creates a fake root directory, and installs the
compiled binaries and associated files into it, with root as owner.) The fake root, or subdirectory tree
containing the compiled software, is then compressed into an archive with the extension .pkg.tar.xz , or a
package. When invoked, pacman then extracts the package (installs it) into the system's real root directory
( / ).
PKGBUILD
groups=('modified')
/etc/pacman.conf
open in browser PRO version Are you a developer? Try out the HTML to PDF API pdfcrowd.com
IgnoreGroup = modified
If new versions are available in the official repositories during a system update, pacman prints a note that it
is skipping this update because it is in the IgnoreGroup section. At this point the modified package should
be rebuilt from ABS to avoid partial upgrades.
Other tools
pbget - retrieve PKGBUILDs for individual packages directly from the web interface. Includes AUR
support.
This page w as last modified on 19 January 2015, at 09:39. Content is available under GNU Free Documentation License 1.3
or later unless otherw ise noted. Privacy policy About ArchWiki Disclaimers
open in browser PRO version Are you a developer? Try out the HTML to PDF API pdfcrowd.com