tech:construire_un_paquet_debian_deb
Différences
Ci-dessous, les différences entre deux révisions de la page.
| Prochaine révision | Révision précédente | ||
| tech:construire_un_paquet_debian_deb [2025/03/24 15:06] – créée - modification externe 127.0.0.1 | tech:construire_un_paquet_debian_deb [2026/06/16 15:33] (Version actuelle) – Jean-Baptiste | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | < | ||
| + | {{tag> | ||
| + | |||
| + | # Construire un paquet Debian .deb | ||
| + | |||
| + | Voir : | ||
| + | * [Guide du nouveau responsable Debian](https:// | ||
| + | * [[compilation_opencv_sur_debian|Création d'un paquet Debian OpenCV]] | ||
| + | * http:// | ||
| + | |||
| + | |||
| + | ## Pour construire un paquet à partir des sources | ||
| + | |||
| + | |||
| + | |||
| + | Voir checkinstall http:// | ||
| + | |||
| + | Voir [[Debian - Construction d un paquet a partir des sources - wdfs]] | ||
| + | |||
| + | Construire un paquet Debian .deb | ||
| + | |||
| + | Créer un répertoire temporaire. Entrer dans ce répertoire. | ||
| + | Télécharger la source .tar.gz d' | ||
| + | Décompresser la source d' | ||
| + | À la racine du répertoire package-x.x.x, | ||
| + | Dans le répertoire temporaire (..), en plus du .deb on devrait maintenant avoir un diff.gz, en plus d'un .dsc | ||
| + | |||
| + | |||
| + | Et pour générer un .src.deb: | ||
| + | |||
| + | Créer le .src.deb avec: ar -r package_x.x.x-x_arch.src.deb package_x.x.x-x.diff.gz package_x.x.x-x.dsc package_x.x.x.orig.tar.gz | ||
| + | | ||
| + | ## Création d'un paquet Debian - Exemple avec NodeJS | ||
| + | |||
| + | Voir : https:// | ||
| + | |||
| + | ~~~bash | ||
| + | wget https:// | ||
| + | tar xvf node-v8.9.3.tar.gz | ||
| + | cd node-v8.9.3 | ||
| + | |||
| + | ./configure | ||
| + | make -j $(nproc) | ||
| + | |||
| + | cat > | ||
| + | evented I/O for V8 javascript | ||
| + | |||
| + | Node.js is a platform built on Chrome' | ||
| + | building fast, scalable network applications. Node.js uses an | ||
| + | event-driven, | ||
| + | efficient, perfect for data-intensive real-time applications that run | ||
| + | across distributed devices. | ||
| + | EOF | ||
| + | |||
| + | echo | fakeroot checkinstall --install=no \ | ||
| + | --strip \ | ||
| + | --nodoc \ | ||
| + | --exclude '/ | ||
| + | --gzman \ | ||
| + | --reset-uids \ | ||
| + | --maintainer 'Plop \< | ||
| + | --pkglicense ' | ||
| + | --pkgname nodejs \ | ||
| + | --pkgrelease 1 \ | ||
| + | --pkgversion 8.9.3 \ | ||
| + | --pkggroup web \ | ||
| + | --pkgsource ' | ||
| + | --requires ' | ||
| + | # | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Méthode 2 | ||
| + | |||
| + | |||
| + | Voir : | ||
| + | * dpkg-dev: / | ||
| + | * lintian | ||
| + | * dh-make | ||
| + | * debhelper | ||
| + | |||
| + | ~~~bash | ||
| + | apt-get install dh-make debhelper lintian | ||
| + | apt-get install dpkg-dev # dpkg-buildpackage | ||
| + | ~~~ | ||
| + | |||
| + | ~~~bash | ||
| + | dh_make --single --native --yes --email root@localhost | ||
| + | |||
| + | cd /debian/ | ||
| + | dos2unix preinst postinst prerm postrm copyright control | ||
| + | |||
| + | # Modification de la cible dh_install dans le fichier debian/ | ||
| + | cat >> debian/ | ||
| + | override_dh_install: | ||
| + | dh_install --sourcedir=$X_BASEDIR/ | ||
| + | FIN_AJOUT_debian_rules | ||
| + | |||
| + | dpkg-buildpackage -us -uc 2>&1 > /dev/null | ||
| + | |||
| + | # Vérification par lintian | ||
| + | lintian --suppress-tags dir-or-file-in-opt, | ||
| + | ~~~ | ||
| + | |||
| + | ## Notes | ||
| + | |||
| + | Les scripts de postinstall et autres sont dans `/ | ||
| + | ~~~ | ||
| + | # ls -1 / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | / | ||
| + | ~~~ | ||
| + | |||
| + | |||
| + | ## Autres | ||
| + | |||
| + | `/ | ||
| + | ~~~python | ||
| + | `' | ||
| + | |||
| + | (c) Canonical Ltd. | ||
| + | `' | ||
| + | |||
| + | import apport.hookutils | ||
| + | |||
| + | def add_info(report): | ||
| + | pass | ||
| + | ~~~ | ||
| + | |||
| + | |||
