Prochaine révision | Révision précédenteProchaine révisionLes deux révisions suivantes |
fr:slackware:slackbuild_scripts [2017/04/29 07:19 (UTC)] – premier jet de traduction pierreaverseng | fr:slackware:slackbuild_scripts [2017/05/08 07:07 (UTC)] – [Création de scripts SlackBuild] pierreaverseng |
---|
====== Les scripts SlackBuild ====== | ====== Les scripts SlackBuild ====== |
| |
Un script SlackBuild est un 'shell script' (généralement compatible avec le shell Bourne.) dont le rôle est d'automatiser la configuration, la compilation et la création de paquets Slackware (des fichiers *.tgz, *.txz, *.tbz) à partir d'archives du code source. | Un script SlackBuild est un 'shell script' (généralement compatible avec le shell bash: Bourne-Again SHell.) dont le rôle est d'automatiser la configuration, la compilation et la création de paquets Slackware (des fichiers *.tgz, *.txz, *.tbz) à partir d'archives du code source. |
| |
===== Sommaire ===== | ===== Sommaire ===== |
| |
La méthode générale pour créer un paquet Slackware package à partir des sources peut être résumée comme suit, même si certains détails peuvent varier d'un système de construction à l'autre. | La méthode générale pour créer un paquet Slackware à partir des sources peut être résumée comme suit, même si certains détails peuvent varier d'un système de construction à l'autre. |
| |
- Décompresser l'archive source (habituellement un fichier .tar.gz ou .tar.bz2) dans un "répertoire de travail." | - Décompresser l'archive source (habituellement un fichier .tar.gz ou .tar.bz2) dans un "répertoire de travail." |
- Créer un fichier ''slack-desc'', qui décrit le logiciel suivant un format normalisé. | - Créer un fichier ''slack-desc'', qui décrit le logiciel suivant un format normalisé. |
- Configurer le fichier source, et appliquer les correctifs si nécessaire. | - Configurer le fichier source, et appliquer les correctifs, si nécessaire. |
- Lancer la compilation/construction sur les fichiers-source afin de produire les fichiers binaires. | - Lancer la compilation/construction sur les fichiers-source afin de produire les fichiers binaires. |
- Installer le programme dans un répertoire provisoire. Cette étape est éventuellement un peu délicate, suivant comment le ''make install'' (ou un outil semblable) du système de "construction" travaille. 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. | - Installer le programme dans un répertoire provisoire. Cette étape peut s'avérer délicate, suivant quelle procédure dans ''make install'' (ou dans un outil semblable) est employée par le système d'agencement des paquets. Dans les Makefiles standards GNU, la variable ''DESTDIR'' passée à ''make install'' peut suffire. Dans le cas de Makefiles non-standards et de méthodes de construction de paquets où cette option n'est pas prévue, on devra envisager d'écrire des correctifs au Makefile (ou au fichier équivalent) on devra aussi adapter les réglages de la configuration du système de construction (build system). |
- 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. | - Copier la documentation du programme et les autres fichiers nécessaires (y compris les scripts de post-installation ) dans les sous-répertoires appropriés du répertoire temporaire d'installation. Le choix de ces emplacements doit respecter la structure adoptée par Slackware pour l'installation des programmes par le gestionnaire de paquets, à savoir dans le dossier ''/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. | - Employer l'utilitaire ''makepkg'' depuis le répertoire temporaire (où se fait l'installation, suivant le présent exemple) pour créer un paquet Slackware qu'on peut ensuite installer en appelant la commande ''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. | Bien qu'on puisse faire à la main, point par point, ce qui vient d'être décrit, la démarche est ennuyeuse, parfois compliquée, et elle nécessite la saisie au clavier de beaucoup de commandes. L'automatisation de ce travail par un script shell permet à l'utilisateur de partager son script, donc sa démarche, avec l'ensemble de la communauté. De plus il est logique d'utiliser et de modifier des scripts SlackBuilds existants pour la mise à jour d'un programme donné vers une version plus récente. |
===== Creating SlackBuild scripts ===== | ===== Création de 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. | Un bon tutoriel qui montre comment créer un script SlackBuild est disponible [[http://www.slackwiki.com/Writing_A_SlackBuild_Script|ici]], et plus loin vous trouverez quelques exemples ou [[http://slackbuilds.org/templates/|modèles]] qui permettent de voir précisément ce qu'on attend d'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. | Cependant, les logiciels peuvent être écrits dans différents langages de programmation, utiliser différents systèmes de construction, ou peuvent même être écrits tout simplement dans un langage interprété de sorte qu'on ne peut pas vraiment procéder à leur "installation". Dans ces cas là, un grand nombre d'étapes requises pour l'écriture d'un script SlackBuild différeront de la norme. Le copier-coller de commandes provenant d'autres scripts SlackBuild peut fonctionner, ou pas! |
| |
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. | Un bon conseil à donner à quiconque envisage d'écrire un script SlackBuild est d'étudier et comprendre la structure d'un project avant d'entreprendre l'écriture du script SlackBuild pour ce logiciel. Une bonne compétence dans l'écriture de shell scripts est également un bon atout, puisque en pratique l'écriture de SlackBuilds est faite avec des scripts compatibles avec le shell script 'bash' -''Bourne-again shell''-. La façon idéale de commencer à écrire des scripts SlackBuild est de s'exercer avec des projets simples en C employant le système standard ''GNU Make''. |
<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> | <note tip>Une bonne idée pour les novices en écriture de scripts est de suivre les étapes indiquées ci-dessus à la main, pour créer un paquet à partir des sources, avant de se lancer dans l'écriture d'un script SlackBuild. Il y aura ainsi moins de risques de bugs et de comportements inattendus provoqués par le 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. | La présentation de scripts SlackBuild sur un dépôt public comme http://www.slackbuilds.org peut en outre exiger le respect de certaines conventions et normes de codage. Par exemple, ce sera au script de déterminer l'architecture-cible à l'exécution, ce qui est mieux que d'avoir codé "en dur" une architecture de machine dans ce script. Ces standards ont pour but de rendre les scripts SlackBuild aussi portables que possible. |
| |
| |
===== Automated SlackBuild generators ===== | ===== Automated SlackBuild generators ===== |
| |
| Some tools exist that can assist you with creating a SlackBuild script. Here are a few examples. |
| |
| * [[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]] \\ A SlackBuild generator script by David Woodfall |
| |
| ===== External Links ===== |
| |
| * SlackBuilds Repository - http://www.slackbuilds.org/ |
| * SlackBuild templates - http://slackbuilds.org/templates/ |
| |
| |
| ===== Sources ===== |
| * Originally written by [[wiki:user:vharishankar|V.Harishankar]] for the SlackDocs Wiki Project, traduction française de [[wiki:user:pierreaverseng|P-M. Averseng]] |
| |
| <!-- Please do not change anything below this line--> |
| {{tag>slackware slackbuild translator:pierreaverseng}} |