¡Esta es una revisión vieja del documento!
Tabla de Contenidos
Construyendo un paquete
Este es un esquema aproximado para construir paquetes de Slackware. Algunos pasos pueden no ser necesarios, use la página de discusión para al margen, como el uso de slacktrack (Cuando DESTDIR falle) y otras herramientas como checkinstall.
The good and decent way
Configurar y compilar el código fuente como normalmente lo hace:
./configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc make
Crear un directorio temporal de destino:
mkdir /tmp/build
Instalar en el directorio temporal:
make install DESTDIR=/tmp/build
Poner los libs/bins dentro del directorio temporal:
strip -s /tmp/build/usr/lib/* /tmp/build/usr/bin/*
También deseará asegurarse que cualquier cosa en <tt>/usr/man</tt> sea comprimida antes de hacer el paquete.
gzip -9 /tmp/build/usr/man/man?/*.?
Crear el directorio <tt>install</tt>, aquí es donde se almacenará la descripción y el script de instalación:
cd /tmp/build mkdir install cd install
El mismo código en una linea (para las personas de copiar y pegar)
cd /tmp/build; mkdir install; cd install
Usando un editor de texto (or a tool), crea un archivo llamado slack-desc, con el siguiente contenido:
- slack-desc
|-----handy-ruler------------------------------------------------------| appname: appname (Short description of the application) appname: <this line is generally left blank> appname: Description of application - this description should be fairly appname: in-depth; in other words, make it clear what the package does (and appname: maybe include relevant links and/or instructions if there's room), appname: but don't get too verbose. appname: This file can have a maximum of eleven (11) lines of text preceded by appname: the "appname: " designation. appname: appname: It's a good idea to include a link to the application's homepage too. appname:
The “appname” string must *exactly* match the application name portion of the Slackware package (for example, a package titled “gaim-1.5-i486-1.tgz” must have a slack-desc file with the <appname> string of “gaim: ” rather than “Gaim: ” or “GAIM: ” or something else.
The first line must show the application name followed by a short description (enclosed in parentheses).
Create the actual package:
cd /tmp/build makepkg ../app-version-arch-tag.tgz
(The dashes should appear as above, so if the version has a subversion like say “1.0 RC2” make sure you use 1.0_RC2 not 1.0-RC2. The arch should be something like “i486” for example. The tag should consist of the build number and your initals, e.g. 1zb for Zaphod Beeblebrox's first build, 2zb for his second build, etc. Official slackware packages have only numbers as tags.)
When prompted to recreate symbolic links, say <tt>yes</tt><br> When prompted to reset permissions, say <tt>no</tt>
Note: Using makepkg -l y -c n will give you the same behaviour as answering yes to the symlinks question, and no to the permissions question.
If all went well, you can now install the package. cd .. installpkg app-version-arch-tag.tgz
The "I don't have time" way
Fortunately, Slackware are pretty flexible too. If you don't mind much about what is the source (beware!) that you're compiling you can burn some stages and do something like this:
./configure --prefix=/usr make install DESTDIR=$(pwd)/PACKAGE cd $(pwd)/PACKAGE makepkg -l y -c n ../app-version-arch-tag.tgz installpkg ../app-version-arch-tag.tgz
Of course, you will have a package without description, (probably) uncompressed man pages and unstripped binaries.
Sources
* Original source: http://www.slackwiki.com/Building_A_Package
* Contributions by arfon