Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary heading Template:Article summary link Template:Article summary end
makepkg is used for compiling and building packages suitable for installation with pacman, Arch Linux's package manager. makepkg is a script that automates the building of packages; it can download and validate source files, check dependencies, configure build-time settings, compile the sources, install into a temporary root, make customizations, generate meta-info, and package everything together.
makepkg is provided by the Template:Package Official package.
Template:Filename is the main configuration file for makepkg. Most users will wish to fine-tune makepkg configuration options prior to building any packages. (For example, modifying the Template:Codeline variable on SMP systems for a reduction in compile times, or modifying the Template:Codeline variable to personalize packages.) See makepkg.conf for detailed information.
USER_NAME ALL=(ALL) NOPASSWD: /usr/bin/pacman
The above will negate the need to enter a password with pacman. See the sudo wiki article for detailed information.
Next, one can configure where finished packages should be placed. This step is optional; packages will be created in the working directory where makepkg is run by default.
Create the directory:
$ mkdir /home/$USER/packages
Template:Codeline simply allows a normal user the necessary root permissions to create packages in the build environment without being able to alter the wider system. If the build process attempts to alter files outside of the build environment then errors are produced and the build fails -- this is very useful for checking the quality/safety/integrity of PKGBUILDs for distribution. By default, Template:Codeline is enabled in Template:Filename; users can prefix the option with a Template:Codeline in the Template:Codeline array to disable it.
Before continuing, ensure the "base-devel" group is installed. Packages belonging to this group are not required to be listed as dependencies in PKGBUILD files. Install the "base-devel" group by issuing (as root):
# pacman -S base-devel
If required dependencies are missing, makepkg will issue a warning before failing. To build the package and install needed dependencies automatically, simply use the command:
$ makepkg -s
Note that these dependencies must be available in the configured repositories; see pacman#Repositories for details. Alternatively, one can manually install dependencies prior to building (Template:Codeline).
Once all dependencies are satisfied and the package builds successfully, a package file (Template:Filename) will be created in the working directory. To install, run (as root):
# pacman -U pkgname-pkgver.pkg.tar.gz