Difference between revisions of "PKGBUILD (Italiano)"

From ArchWiki
Jump to: navigation, search
m
m
Line 10: Line 10:
 
{{Article summary text|Una spiegazione delle variabili dei PKGBUILD usate durante la [[Creating Packages (Italiano)|creazione dei pacchetti]].}}
 
{{Article summary text|Una spiegazione delle variabili dei PKGBUILD usate durante la [[Creating Packages (Italiano)|creazione dei pacchetti]].}}
 
{{Article summary heading|Overview}}
 
{{Article summary heading|Overview}}
{{Article summary text|I pacchetti in Arch Linux sono costruiti usando  [[makepkg (Italiano)]] e uno script di costruzione personalizzato per ogni pacchetto (noto come [[PKGBUILD (Italiano)]]). Una volta pacchettizzato, il software può essere installato e gestito con [[Pacman (Italiano)]]. I PKGBUILD per il software dei [[official repositories]] sono disponibili nell'albero [[ABS (Italiano)]]; altre migliaia sono disponibili in (unsupported) [[Arch User Repository (Italiano)]].}}
+
{{Article summary text|I pacchetti in Arch Linux sono costruiti usando  [[makepkg (Italiano)]] e uno script di costruzione personalizzato per ogni pacchetto noto come [[PKGBUILD (Italiano)]]. Una volta pacchettizzato, il software può essere installato e gestito con [[Pacman (Italiano)]]. I PKGBUILD per il software dei [[official repositories]] sono disponibili nell'albero [[Arch Build System (Italiano))]]; altre migliaia sono disponibili in (unsupported) [[Arch User Repository (Italiano)]].}}
 
{{Article summary heading|Related}}
 
{{Article summary heading|Related}}
 
{{Article summary wiki|Creating Packages (Italiano)|creazione dei pacchetti}}
 
{{Article summary wiki|Creating Packages (Italiano)|creazione dei pacchetti}}

Revision as of 11:24, 22 May 2010

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 – فارسی

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:PKGBUILD (Italiano)#)
Note: Questo articolo è in fase di traduzione. Seguite per ora le istruzioni della versione inglese.

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 wiki Template:Article summary end

Un Template:Filename è un file di descrizione della costruzione di pacchetti di Arch Linux, usato durante la creazione dei pacchetti. Questo articolo descrive le possibili variabili del Template:Filename.

Costruire i pacchetti

I pacchetti in Arch Linux sono costruiti utilizzando il comando makepkg e le informazioni sono memorizzate in un file Template:Filename. Quando Template:Codeline viene eseguito, cerca un Template:Filename nella directory corrente e segue le istruzioni ivi contenute per compilare o altrimenti acquisire i file necessari per essere confezionati all'interno di un pacchetto (Template:Filename). Il pacchetto risultante contiene i file binari e le istruzioni di installazione e può essere facilmente installato con pacman. Vedere la creazione dei pacchetti per ulteriori informazioni.

Variabili

Seguono le variabili che si possono utilizzare nel file Template:Filename:

Template:Codeline
Il nome del pacchetto. Dovrebbe consistere nei soli caratteri alfanumerici e tutte le lettere dovrebbero essere in minuscolo. Per motivi di coerenza, il Template:Codeline dovrebbe corrispondere al nome dell'archivio dei sorgenti del software che si sta impacchettando. Per esempio, se il software è in Template:Filename, il valore di Template:Codeline dovrebbe essere foobar. Anche la directory di lavoro in cui risiede il file Template:Filename dovrebbe corrispondere al Template:Codeline.
Template:Codeline
La versione del pacchetto. Il valore dovrebbe essere lo stesso della versione rilasciata dell'autore del pacchetto. Può contenere lettere, numeri e punti ma NON può contenere trattini. Se l'autore del pacchetto usa i trattini nello schema di numerazione della versione, si deve sostituirli con degli underscore. Per esempio, se la versione è 0.99-10, dovrebbe essere cambiata in 0.99_10. Se la variabile pkgver viene usata successivamente nel PKGBUILD, allora l'underscore può essere facilmente sostituito con un trattino, per esempio:
 source=($pkgname-${pkgver/_/-}.tar.gz)
Template:Codeline
Il numero della versione di rilascio del pacchetto specifico di Arch Linux. Questo valore permette agli utenti di distinguere tra build consecutive della stessa versione del pacchetto. Quando una nuova versione del pacchetto viene rilasciata, il numero di rilascio parte da 1. Nel caso in cui si apportino aggiustamenti e ottimizzazioni al file Template:Filename, allora il pacchetto verrà ri-rilasciato e il numero di rilascio verrà incrementato di 1. Nel caso in cui esca una nuova versione del pacchetto, il numero di rilascio verrà resettato a 1.
Template:Codeline
La descrizione del pacchetto. La descrizione dovrebbe essere di circa 80 caratteri o meno e non dovrebbe includere il nome del pacchetto The description should be about 80 characters or less and should not include the package name in modo autoreferenziale. Per esempio, "Nedit è un editor di testo per X11" si dovrebbe scrivere come "un editor di testo per X11."
Template:Codeline 
An array of architectures that the Template:Filename file is known to build and work on. Currently, it should contain i686 and/or x86_64, Template:Codeline. The value any can also be used for architechture-independent packages. You can access this value with the variable Template:Codeline during the build.
Template:Codeline 
The URL of the official site of the software being packaged.
Template:Codeline 
The license under which the software is distributed. A Template:Package Official package has been created in Template:Codeline that stores common licenses in Template:Filename, i.e. Template:Filename. If a package is licensed under one of these licenses, the value should be set to the directory name, e.g. Template:Codeline. If the appropriate license is not included in the official Template:Package Official package, several things must be done:
  1. The license file(s) should be included in: Template:Filename, e.g. Template:Filename.
  2. If the source tarball does NOT contain the license details and the license is only displayed elsewhere, e.g. a website, then you need to copy the license to a file and include it.
  3. Add custom to the Template:Codeline array. Optionally, you can replace custom with custom:name of license. Once a license is used in two or more packages in an official repository (including Template:Codeline), it becomes a part of the Template:Package Official package.
  • The BSD, MIT, zlib/png and Python licenses are special cases and could not be included in the Template:Package Official package. For the sake of the Template:Codeline array, it is treated as a common license (Template:Codeline, Template:Codeline, Template:Codeline and Template:Codeline) but technically each one is a custom license because each one has its own copyright line. Any packages licensed under these four should have its own unique license stored in Template:Filename. Some packages may not be covered by a single license. In these cases, multiple entries may be made in the license array, e.g. Template:Codeline.
  • Additionally, the (L)GPL has many versions and permutations of those versions. For (L)GPL software, the convention is:
    • (L)GPL - (L)GPLv2 or any later version
    • (L)GPL2 - (L)GPL2 only
    • (L)GPL3 - (L)GPL3 or any later version
Template:Codeline 
The group the package belongs in. For instance, when you install the Template:Package Official package, it installs all packages that belong in the kde group.
Template:Codeline 
An array of package names that must be installed before this software can be run. If a software requires a minimum version of a dependency, the >= operator should be used to point this out, e.g. Template:Codeline. You do not need to list packages that your software depends on if other packages your software depends on already have those packages listed in their dependency. For instance, gtk2 depends on glib2 and glibc. However, glibc does not need to be listed as a dependency for gtk2 because it is a dependency for glib2.
Template:Codeline 
An array of package names that must be installed to build the software but unnecessary for using the software after installation. You can specify the minimum version dependency of the packages in the same format as the Template:Codeline array.
Warning: The group "base-devel" is assumed already installed when building with makepkg . Members of "base-devel" should not be included in makedepends arrays.
Template:Codeline 
An array of package names that are not needed for the software to function but provides additional features. A short description of what each package provides should also be noted. An Template:Codeline may look like this:
optdepends=('cups: printing support'
'sane: scanners support'
'libgphoto2: digital cameras support'
'alsa-lib: sound support'
'giflib: GIF images support'
'libjpeg: JPEG images support'
'libpng: PNG images support')
Template:Codeline 
An array of package names that this package provides the features of (or a virtual package such as cron or sh). If you use this variable, you should add the version (Template:Codeline and perhaps the Template:Codeline) that this package will provide if dependencies may be affected by it. For instance, if you are providing a modified qt package named qt-foobar version 3.3.8 which provides qt then the Template:Codeline array should look like Template:Codeline. Putting Template:Codeline will cause to fail those dependencies that require a specific version of qt. Do not add Template:Codeline to your provides array, this is done automatically.
Template:Codeline 
An array of package names that may cause problems with this package if installed. You can also specify the version properties of the conflicting packages in the same format as the Template:Codeline array.
Template:Codeline 
An array of obsolete package name that are replaced by this package, e.g. Template:Codeline for the Template:Package Official package. After syncing with Template:Codeline, it will immediately replace an installed package upon encountering another package with the matching Template:Codeline in the repositories. If you are providing an alternate version of an already existing package, use the Template:Codeline variable which is only evaluated when actually installing the conflicting package.
Template:Codeline 
An array of files to be backed up as Template:Filename when the package is removed. This is commonly used for packages placing configuration files in Template:Filename. The file paths in this array should be relative paths (e.g. Template:Filename) not absolute paths (e.g. Template:Filename).
Template:Codeline 
This array allows you to override some of the default behavior of Template:Codeline. To set an option, include the option name in the array. To reverse the default behavior, place an ! at the front of the option. The following options may be placed in the array:
  • strip - Strips symbols from binaries and libraries.
  • docs - Save Template:Filename directories.
  • libtool - Leave libtool (Template:Filename) files in packages.
  • emptydirs - Leave empty directories in packages.
  • zipman - Compress man and info pages with gzip.
  • ccache - Allow the use of Template:Codeline during build. More useful in its negative form Template:Codeline with select packages that have problems building with Template:Codeline.
  • distcc - Allow the use of Template:Codeline during build. More useful in its negative form Template:Codeline with select packages that have problems building with Template:Codeline.
  • makeflags - Allow the use of user-specific Template:Codeline during build. More useful in its negative form Template:Codeline with select packages that have problems building with custom Template:Codeline.
  • force - Force the package to be upgraded by a pacman system upgrade operation, even if the version number would normally not trigger such an upgrade. This is useful when the version numbering scheme of a package changes (or is alphanumeric) or when a downgrade is required for security reasons.
Template:Codeline 
The name of the Template:Filename script to be included in the package. pacman has the ability to store and execute a package-specific script when it installs, removes or upgrades a package. The script contains the following functions which run at different times:
  • pre_install - The script is run right before files are extracted. One argument is passed: new package version.
  • post_install - The script is run right after files are extracted. One argument is passed: new package version.
  • pre_upgrade - The script is run right before files are extracted. Two arguments are passed in the following order: new package version, old package version.
  • post_upgrade - The script is run after files are extracted. Two arguments are passed in the following order: new package version, old package version.
  • pre_remove - The script is run right before files are removed. One argument is passed: old package version.
  • post_remove - The script is run right after files are removed. One argument is passed: old package version.
Tip: A prototype Template:Filename is provided at Template:Filename.
Template:Codeline 
An array of files which are needed to build the package. It must contain the location of the software source, which in most cases is a full HTTP or FTP URL. The previously set variables Template:Codeline and Template:Codeline can be used effectively here (e.g. Template:Codeline)
Note: If you need to supply files which are not downloadable on the fly, e.g. self-made patches, you simply put those into the same directory where your Template:Filename file is in and add the filename to this array. Any paths you add here are resolved relative to the directory where the Template:Filename lies. Before the actual build process is started, all of the files referenced in this array will be downloaded or checked for existence, and Template:Codeline will not proceed if any are missing.
Template:Codeline 
An array of files listed under the Template:Codeline array which should not be extracted from their archive format by Template:Codeline. This most commonly applies to certain zip files which cannot be handled by bsdtar because libarchive processes all files as streams rather than random access as unzip does. In these situations unzip should be added in the Template:Codeline array and the first line of the Template:Codeline function should contain:
cd $srcdir/$pkgname-$pkgver
unzip [source].zip
Template:Codeline 
An array of MD5 checksums of the files listed in the Template:Codeline array. Once all files in the Template:Codeline array are available, an MD5 hash of each file will be automatically generated and compared with the values of this array in the same order they appear in the Template:Codeline array. While the order of the source files itself does not matter, it is important that it matches the order of this array since Template:Codeline cannot guess which checksum belongs to what source file. You can generate this array quickly and easily using the command Template:Codeline in the directory that contains the Template:Filename file. Note that the MD5 algorithm is known to have weaknesses, so you should consider using a stronger alternative.
Template:Codeline 
An array of SHA-1 160-bit checksums. This is an alternative to md5sums described above, but is also known to have weaknesses, so you should consider using a stronger alternative. To enable use and generation of these checksums, be sure to set up the INTEGRITY_CHECK option in makepkg.conf. See man makepkg.conf.
Template:Codeline 
An array of SHA-2 checksums with digest sizes 256, 384 and 512 bits respectively. These are alternatives to md5sums described above and are generally believed to be stronger. To enable use and generation of these checksums, be sure to set up the INTEGRITY_CHECK option in makepkg.conf. See man makepkg.conf.

It is common practice to preserve the order of the Template:Filename variables as shown above. However, this is not mandatory, as the only requirement in this context is correct Bash syntax.