Próxima revisión | Revisión previa |
es:slackware:slackbuild_scripts [2019/02/12 12:09 (UTC)] – creado slackwarespanol | es:slackware:slackbuild_scripts [2019/02/12 12:27 (UTC)] (actual) – slackwarespanol |
---|
<note warning>En proceso. Victor</note> | |
====== SlackBuild scripts ====== | ====== SlackBuild scripts ====== |
| |
A SlackBuild script is a shell script (usually Bourne shell compatible) that automates the process of configuring, compiling and creating a Slackware package (*.tgz, *.txz, *.tbz files) from source archives. | Un script de SlackBuild es un script de shell (generalmente compatible con el shell Bourne) que automatiza el proceso de configuración, compilación y creación de un paquete de Slackware (* .tgz, * .txz, * .tbz) desde los archivos de origen. |
| |
===== Overview ===== | ===== Descripción general ===== |
| |
The basic process of creating a Slackware package from source can be summarized as follows, while details may vary from one build system to another. | El proceso básico de crear un paquete Slackware desde la fuente se puede resumir de la siguiente manera, mientras que los detalles pueden variar de un sistema de compilación a otro. |
| |
- Uncompress the source archive (usually .tar.gz or .tar.bz2 file) into a "work directory." | - Descomprima el archivo fuente (generalmente el archivo .tar.gz o .tar.bz2) en un "directorio de trabajo". |
- Create a ''slack-desc'' file, with the description of the software in the correct format. | - Cree un archivo '' slack-desc '', con la descripción del software en el formato correcto. |
- Configure the source, and apply patches if needed. | - Configure la fuente y aplique parches si es necesario. |
- Compile/build the source and generate the binaries. | - Compilar/construir la fuente y generar los binarios. |
- Install the program to a temporary directory. This step may be a little bit tricky, depending on how the ''make install'' (or similar functionality) of the build system works. In standard GNU Makefiles, the ''DESTDIR'' variable passed to the ''make install'' command should be sufficient. In non-standard Makefiles and build systems which don't support that option, this might involve patching the ''Makefile'' (or similar file) or editing a build configuration setting of the build system. | - Instalar el programa en un directorio temporal. Este paso puede ser un poco complicado, dependiendo de cómo funciona el '' make install '' (o funcionalidad similar) del sistema de compilación. En los archivos GNU estándar, la variable '' DESTDIR '' que se pasa al comando '' make install '' debería ser suficiente. En los Makefiles y sistemas de compilación no estándar que no admiten esa opción, esto podría implicar parchear el '' Makefile '' (o archivo similar) o editar una configuración de configuración de compilación del sistema de compilación. |
- Copy the program documentation and other necessary files (including post-installation scripts) to the appropriate subdirectories in the temporary installation directory. These locations should adhere to default directory structure used by Slackware to store applications installed by the package manager, viz. inside the ''/usr/'' folder. | - Copie la documentación del programa y otros archivos necesarios (incluidos los scripts posteriores a la instalación) a los subdirectorios apropiados en el directorio de instalación temporal. Estas ubicaciones deben adherirse a la estructura de directorios predeterminada utilizada por Slackware para almacenar aplicaciones instaladas por el administrador de paquetes, a saber. dentro de la carpeta '' /usr/ ''. |
- Use the ''makepkg'' utility from the temporary directory (installation location) to create a Slackware package that can then be installed using the ''installpkg'' utility. | - Use la utilidad '' makepkg '' del directorio temporal (ubicación de instalación) para crear un paquete Slackware que luego puede instalarse usando la utilidad '' installpkg ''. |
| |
While the above steps can be done by hand, the process is tedious, sometimes complex, and involves typing in a lot of commands. Automating the process by a shell script allows the user to share the process with the community at large. It also makes sense to use and modify existing SlackBuild scripts for upgrading the same program to a newer version. | Si bien los pasos anteriores se pueden hacer a mano, el proceso es tedioso, a veces complejo, e implica escribir muchos comandos. La automatización del proceso mediante un script de shell permite al usuario compartir el proceso con la comunidad en general. También tiene sentido utilizar y modificar los scripts existentes de SlackBuild para actualizar el mismo programa a una versión más nueva. |
===== Creating SlackBuild scripts ===== | ===== Creando scripts SlackBuild ===== |
| |
A good hands-on tutorial on creating a SlackBuild script can be found [[http://www.slackwiki.com/Writing_A_SlackBuild_Script|here]], and there are also a few [[http://slackbuilds.org/templates/|templates]] available to get a feeling for what is needed from a script. | Se puede encontrar un buen tutorial práctico sobre cómo crear un script SlackBuild [[http://www.slackwiki.com/Writing_A_SlackBuild_Script|aquí]], y también hay algunos [[http://slackbuilds.org/templates/ | plantillas]] disponible para tener una idea de lo que se necesita de un script. |
| |
However, software may be written in different programming languages, use different build systems, or may even simply be written in an interpreted programming language with no obvious way to "install" it. In such cases, many steps involved in writing a SlackBuild script will differ from the standard way. Blindly copying and pasting commands from other SlackBuild scripts may or may not work. | Sin embargo, el software puede estar escrito en diferentes lenguajes de programación, usar diferentes sistemas de compilación, o simplemente puede estar escrito en un lenguaje de programación interpretado sin una forma obvia de "instalarlo". En tales casos, muchos pasos involucrados en la escritura de un script de SlackBuild diferirán de la forma estándar. Copiar y pegar a ciegas comandos de otros scripts de SlackBuild puede o no funcionar. |
| |
It is recommended that anybody who wishes to write a SlackBuild script, study and understand the build system of a software project before attempting to write a SlackBuild script for it. A degree of proficiency in writing shell scripts is also a definite benefit, as it is the practice to use Bourne shell compatible scripts for SlackBuilds. Ideally, simple C projects which use the standard GNU Make system is a good way to start practicing writing SlackBuild scripts. | Se recomienda que cualquiera que desee escribir un script de SlackBuild, estudie y comprenda el sistema de compilación de un proyecto de software antes de intentar escribir un script de SlackBuild para él. Un grado de dominio en la escritura de scripts de shell también es un beneficio definitivo, ya que es una práctica utilizar scripts compatibles con el shell Bourne para SlackBuilds. Idealmente, los proyectos C simples que utilizan el sistema GNU Make estándar son una buena manera de comenzar a practicar la escritura de scripts SlackBuild. |
<note tip>For new script writers, it is a good idea to perform the above steps manually to create the package from source, before actually writing a SlackBuild script. This reduces the chances of bugs and unexpected behaviour in the script.</note> | |
| |
Submitting SlackBuild scripts to a public repository such as http://www.slackbuilds.org may additionally require adherence to certain conventions and coding standards. For instance, it would be necessary for the script to determine the target architecture at runtime rather than hard-coding it into the script. These standards attempt to make SlackBuild scripts as portable as possible. | <note tip>Para los nuevos escritores de scripts, es una buena idea realizar los pasos anteriores manualmente para crear el paquete desde la fuente, antes de escribir un guión SlackBuild. Esto reduce las posibilidades de errores y comportamiento inesperado en el script.</note> |
| |
| El envío de scripts de SlackBuild a un repositorio público como http://www.slackbuilds.org también puede requerir el cumplimiento de ciertas convenciones y estándares de codificación. Por ejemplo, sería necesario que el script determinara la arquitectura de destino en tiempo de ejecución en lugar de codificarla en el script. Estos estándares intentan hacer que los scripts de SlackBuild sean lo más portátiles posible. |
| |
===== Automated SlackBuild generators ===== | |
| |
Some tools exist that can assist you with creating a SlackBuild script. Here are a few examples. | ===== Generadores automatizados de SlackBuild ===== |
| |
* [[http://alien.slackbook.org/AST/ | Alien's SlackBuild Toolkit (AST)]] \\ A web-based "wizard" tool by [[wiki:user:alienbob|Eric Hameleers]] | Existen algunas herramientas que pueden ayudarle a crear un script de SlackBuild. Aquí están algunos ejemplos. |
* [[http://www.dawoodfall.net/slackbuilds/noversion/mkslack/ | mkslack]] \\ A SlackBuild generator script by David Woodfall | |
| |
===== External Links ===== | * [[http://alien.slackbook.org/AST/ | Alien's SlackBuild Toolkit (AST)]] \\ A web-based “wizard” tool by [[wiki:user:alienbob|Eric Hameleers]] |
| * [[http://www.dawoodfall.net/slackbuilds/noversion/mkslack/ | mkslack]] \\ Un script generador de SlackBuild por David Woodfall |
| ===== Enlaces externos ===== |
| |
* SlackBuilds Repository - http://www.slackbuilds.org/ | * SlackBuilds Repository - http://www.slackbuilds.org/ |
| |
| |
===== Sources ===== | ===== Fuentes ===== |
* Originally written by [[wiki:user:vharishankar|V.Harishankar]] for the SlackDocs Wiki Project | * Escrito originalmente por[[wiki:user:vharishankar|V.Harishankar]] for the SlackDocs Wiki Project |
| * Traducido por: [[wiki:user: slackwarespanol | Victor]] 2019/02/12 12:24 (UTC) |
| |
<!-- Please do not change anything below this line--> | <!-- Please do not change anything below this line--> |
{{tag>slackware slackbuild}} | {{tag>slackware slackbuild}} |