Soit un paquet pour diffuser helloworld, dans un terminal :
mkdir -p helloworld/DEBIAN
Maintent copier les fichiers avec leur nom depuis la racine, par exemple :
mkdir -p helloworld/usr/local/bin
cp /usr/local/bin/helloworld.sh helloworld/usr/local/bin/
Après avoir copier les fichiers, vous devez créer un fichier de controle dans le répertoire DEBIAN. Ce fichier nommé controlcontient des informations importantes :
Package: helloworld
Version: 0.2
Maintainer: King Foo
Architecture: all
Description: hello world
Package: helloworld
Version: 0.2
Maintainer: King Foo
Architecture: all
Description: hello world
Ci-dessus sont reprises les informations minimales, pour voir toutes les options disponibles se référer à ce site
Vous pouvez ajouter un script nommé postinst dans le répertoire DEBIAN qui sera exécuté après l’instalation.
NB: ce fichier doit être exécutable
Enfin pour créer le .deb :
dpkg-deb --build helloworld
Cela crée un fichier helloworld.deb dans le répertoire courant. Il pourra être installé via :
dpkg -i helloworld.deb