Makepkg (Español)

From ArchWiki
Revision as of 19:29, 21 July 2010 by Shider (Talk | contribs) (Created page with 'Category:Package development (English) Category:About Arch (English) Category:HOWTOs (English) {{i18n|makepkg}} {{DISPLAYTITLE:makepkg}} {{Article summary start}} {{…')

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This template has only maintenance purposes. For linking to local translations please use interlanguage links, see Help:i18n#Interlanguage links.


Local languages: Català – Dansk – English – Español – Esperanto – Hrvatski – Indonesia – Italiano – Lietuviškai – Magyar – Nederlands – Norsk Bokmål – Polski – Português – Slovenský – Česky – Ελληνικά – Български – Русский – Српски – Українська – עברית – العربية – ไทย – 日本語 – 正體中文 – 简体中文 – 한국어


External languages (all articles in these languages should be moved to the external wiki): Deutsch – Français – Română – Suomi – Svenska – Tiếng Việt – Türkçe – فارسی

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

Tango-preferences-desktop-locale.pngThis article or section needs to be translated.Tango-preferences-desktop-locale.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Makepkg (Español)#)

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.

Configuration

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.

To be able to install dependencies with makepkg as an unprivileged user (with Template:Codeline, see below) install sudo and add desired users to Template:Filename:

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

Then modify the Template:Codeline variable in Template:Filename accordingly.

Template:Codeline

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.

Usage

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
Note: Before complaining about missing (make)dependencies, remember that the "base" group is assumed to be installed on all Arch Linux systems. The group "base-devel" is assumed to be installed when building with makepkg.

To build a package, one must first create a PKGBUILD, or build script, as described in Creating Packages, or obtain one from the ABS tree, Arch User Repository, or some other source.

Warning: Only build/install packages from trusted sources.

Once in possession of a Template:Filename, change to the directory where it is saved and issue the following command to build the package described by said Template:Filename:

$ makepkg

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