# http://git.mdcc.cx/ad1810-doc.git # published at суб, 2. нов 2024. 12:06:10 CET # <------------------------------------------------------------------> -- Debian packaging using sbuild by Joost van Baal-Ilić http://ad1810.com/ 2024 -- We aim to produce something which is suitable for uploading to https://mentors.debian.net/ . We optimise for: Enabling offline work. Not using a webbrowser, but a local editor and command line. Maintaining work using git. You might prefer other choices, that's fine. There is more than one way to do it, in Debian. Not a native speaker of English. Voorkennis ---------- Assumed prior knowledge: it is assumed you are used to working with a Debian, Ubuntu or Devuan system, you are used to working on the command line, and with using git. It helps if you've compiled software before and if you know what a Makefile is. -- ┌───────────────────┤ tarballs ├─────────────────────┐ │ │ │ tar xf hello-5.3.tar.gz │ │ │ │ hello-5.3/Makefile* │ │ hello-5.3/configure │ │ │ │ hello-5.3/COPYING │ │ hello-5.3/ChangeLog │ │ │ │ ./configure && make && sudo make install │ │ │ │ Or: a (signed) git tag. Also: python, rust, go. │ │ │ │ 2 http://mdcc.cx/dps.txt │ └────────────────────────────────────────────────────┘ -- -- ┌───────────────────┤ why, source packages ├────────┐ │ │ │ Why packages? │ │ │ │ hello_2.10-1.dsc looks like: │ │ │ │ Checksums-Sha256: │ │ 31e0[...]516b 725946 hello_2.10.orig.tar.gz │ │ abdb[...]ec60 6072 hello_2.10-1.debian.tar.xz │ │ │ │ -----BEGIN PGP SIGNATURE----- │ │ iQEcBA[...]fwufG4syta0H/0h9wN/Aqp5XfY/XoAI5OoUR │ │ [...] │ │ =Qu4u │ │ -----END PGP SIGNATURE----- │ │ │ │ 3 http://mdcc.cx/dps.txt │ └────────────────────────────────────────────────────┘ -- -- ┌───────────────────┤ source en binary packages ├────┐ │ │ │ hello-5.3.tar.gz debian/{changelog,rules, │ │ control,copyright,..} │ │ ↓ ↓ │ │ hello_5.3.orig.tar.gz hello_5.3-1.debian.tar.xz │ │ ↓↓ │ │ hello_5.3-1_amd64.deb │ │ ↓ │ │ sudo dpkg -i hello_5.3-1_amd64.deb │ │ sudo apt install hello │ │ │ │ │ │ 4 http://mdcc.cx/dps.txt │ └────────────────────────────────────────────────────┘ -- -- ┌───────────────────┤ debian/* ├─────────────────────┐ │ │ │ debian/rules │ │ debian/control │ │ debian/{changelog,copyright} │ │ │ │ debian/source/format │ │ debian/{install,docs,watch} │ │ │ │ 5 http://mdcc.cx/dps.txt │ └────────────────────────────────────────────────────┘ -- -- ┌───────────────────┤ debian/control ├───────────────┐ │ vi debian/control │ │ │ │ Source: hello │ │ Maintainer: J.E. van Baal-Ilić │ │ Build-Depends: debhelper-compat (= 13) │ │ │ │ Package: hello │ │ Architecture: any │ │ Depends: ${shlibs:Depends}, ${misc:Depends} │ │ Description: GNU hello │ │ The GNU hello program produces a familiar, │ │ friendly greeting. │ │ │ │ 6 http://mdcc.cx/dps.txt │ └────────────────────────────────────────────────────┘ -- -- ┌───────────────────┤ debian/rules ├─────────────────┐ │ │ │ │ │ #!/usr/bin/make -f │ │ %: │ │ dh $@ │ │ │ │ │ │ 7 http://mdcc.cx/dps.txt │ └────────────────────────────────────────────────────┘ -- -- ┌───────────────────┤ debian/{changelog,copyright} ├─┐ │ │ │ sudo apt install devscripts cme │ │ │ │ export DEBEMAIL="Jouw Naam " │ │ dch -a │ │ vi debian/copyright (cme update dpkg-copyright) │ │ dch -a │ │ (debuild -uc -us) │ │ (sudo dpkg -i ../*.deb) │ │ │ │ 8 http://mdcc.cx/dps.txt │ └────────────────────────────────────────────────────┘ -- -- ┌───────────────────┤ sbuild, gbp ├──────────────────┐ │ │ │ gbp - git-buildpackage: maintain Debian source │ │ package using git (upstream, tarballs, tags) │ │ │ │ sbuild - build binary package using dedicated │ │ clean build environment, dealing sanely with │ │ build dependencies │ │ │ │ (alternatives: dgit, pbuilder, salsa autobuilder) │ │ │ │ https://wiki.debian.org/sbuild │ │ https://honk.sigxcpu.org/projects/ \ │ │ git-buildpackage/manual-html/ │ │ │ │ 9 http://mdcc.cx/dps.txt │ └────────────────────────────────────────────────────┘ -- -- ┌───────────────────┤ .sbuildrc, .gbp.conf ├─────────┐ │ │ │ sudo apt install \ │ │ sbuild mmdebstrap git-buildpackage │ │ │ │ echo "\$chroot_mode = 'unshare';" > ~/.sbuildrc │ │ │ │ cat < ~/.gbp.conf │ │ [DEFAULT] │ │ pristine-tar = True │ │ builder = sbuild │ │ EOT │ │ │ │ 10 http://mdcc.cx/dps.txt │ └────────────────────────────────────────────────────┘ -- -- ┌───────────────────┤ git workflow ├─────────────────┐ │ │ │ once we have a .dsc: │ │ │ │ git init │ │ gbp import-dsc .../hello_5.3-1.dsc │ │ │ │ [ vi, git commit, ... ] │ │ gbp buildpackage │ │ │ │ 11 http://mdcc.cx/dps.txt │ └────────────────────────────────────────────────────┘ -- -- ┌───────────────────┤ more, documentation ├──────────┐ │ │ │ more nice stuff: dgit, debusine, gitlab runners, │ │ tag2upload, debian janitor │ │ │ │ Debian Packaging Tutorial (packaging-tutorial) │ │ Guide for Debian Maintainers (debmake-doc) │ │ Debian Developer's Reference (developers-reference)│ │ Debian Policy Manual (debian-policy) │ │ │ │ https://mentors.debian.net/ │ │ │ │ 12 http://mdcc.cx/dps.txt │ └────────────────────────────────────────────────────┘ -- Auteursrechten, handelsmerken ----------------------------- Debian is a registered trademark owned by Software in the Public Interest, Inc. Copyright © 2024 Joost van Baal-Ilić Dit document is vrij; verspreiding en gebruik, met of zonder wijzigingen, zijn toegestaan mits bovenstaande vermelding van auteursrecht, deze voorwaarde en de volgende vrijwaring van aansprakelijkheid behouden blijven. Dit werk wordt verspreid in de hoop dat het bruikbaar zal zijn, maar ZONDER ENIGE GARANTIE; zelfs zonder de garantie van GESCHIKTHEID VOOR EEN SPECIFIEK DOEL. Dit document is beschikbaar op http://mdcc.cx/debian/debian-packaging-sbuild.txt en wordt tegen kostprijs door de auteur beschikbaar gesteld. Redistribution and use, with or without modification, are permitted provided that the above copyright notice, this condition and the following disclaimer are retained. This work is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.