FreeBSD : Le port d'un logiciel
Exemple de port : Jeu 0verkill
1/ Liste des fichiers de configuration.
[util01@station66 ~]$ cd /usr/ports/games/0verkill/
[util01@station66 /usr/ports/games/0verkill]$ ls
Makefile distinfo files pkg-descr pkg-plist
- Fichier : Makefile
Permet de compiler et de résoudre les dépendances du paquet.
- Fichier : distinfo
Où sont stockées les tailles et sha256sum des archives et des patchs.
- Répertoire : files
Liste des patchs permettant la compilation de FreeBSD.
[util01@station66 /usr/ports/games/0verkill]$ ls -l files/
total 23
-rw-r--r-- 1 root wheel 725 Dec 23 2013 patch-client.c
-rw-r--r-- 1 root wheel 548 Dec 23 2013 patch-data.c
-rw-r--r-- 1 root wheel 503 Dec 23 2013 patch-net.c
-rw-r--r-- 1 root wheel 1233 Dec 23 2013 patch-server.c
-rw-r--r-- 1 root wheel 535 Dec 23 2013 patch-sprite.c
- Fichier : pkg-descr
Décrit précisement le paquet en anglais
- Fichier : pkg-list
Indique où placer les fichiers dans l'arborescence lors de l'installation
Le logiciel installé depuis son port est installé dans le répertoire : /usr/local/ La configuration est dans le répertoire : /usr/local/etc/ Les binaires sont dans le répertoire : /ust/local/bin/
2/ Compilation et installation.
[util01@station66 /usr/ports/games/0verkill]$ sudo su
Password:
root@station66:/usr/ports/games/0verkill #
root@station66:/usr/ports/games/0verkill # make install
...
This port has installed the following files which may act as network
servers and may therefore pose a remote security risk to the system.
/usr/local/bin/x0verkill
/usr/local/bin/0verkill
/usr/local/bin/0verkill-bot
/usr/local/bin/0verkill-test_server
/usr/local/bin/0verkill-server
...
3/ Afficher la configuration.
root@station66:/usr/ports/games/0verkill # make showconfig
===> The following configuration options are available for 0verkill-0.16_2:
DOCS=on: Build and/or install documentation
X11=on: X11 (graphics) support
===> Use 'make config' to modify these settings
4/ Refaire la configuration.
root@station66:/usr/ports/games/0verkill # make config
5/ Lancement du jeu.
root@station66:/usr/ports/games/0verkill # exit
[util01@station66 /usr/ports/games/0verkill]$ cd
[util01@station66 ~]$
- Lancement du serveur :
[util01@station66 ~]$ 0verkill-server
3. 9.2021 14:01:29 Running 0verkill server version 0.16
3. 9.2021 14:01:29 Initialization.
3. 9.2021 14:01:29 Loading sprites.
3. 9.2021 14:01:29 Loading level "level1"....
3. 9.2021 14:01:29 Loading level graphics.
3. 9.2021 14:01:29 Loading level map.
3. 9.2021 14:01:29 Loading level objects.
3. 9.2021 14:01:29 Initializing socket.
3. 9.2021 14:01:29 Installing signal handlers.
3. 9.2021 14:01:29 Game started.
3. 9.2021 14:01:29 Sleep
- Lancement du client :
[util01@station66 ~]$ 0verkill
Appuyer sur [S] pour entrer le nom du serveur, ici : 192.168.1.66
6/ Fichier de configuration.
- Répertoire de configuration :
[util01@station66 ~]$ cd /var/db/ports/games_0verkill/
[util01@station66 /var/db/ports/games_0verkill]$
- Fichier de configuration :
[util01@station66 /var/db/ports/games_0verkill]$ cat options
# This file is auto-generated by 'make config'.
# Options for 0verkill-0.16_2
_OPTIONS_READ=0verkill-0.16_2
_FILE_COMPLETE_OPTIONS_LIST=DOCS X11
OPTIONS_FILE_SET+=DOCS
OPTIONS_FILE_SET+=X11