Differences between revisions 3 and 4
Revision 3 as of 2021-12-08 14:28:21
Size: 1763
Comment: Prerequisite packages
Revision 4 as of 2021-12-09 07:14:01
Size: 2300
Comment: DFSG compliance and various checks
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
Prerequisite packages: = Prerequisites =
Line 8: Line 8:
= Steps =
 0. Ensure the source package is [[DFSG]]-compatible (free software). Non-free source and binary packages will not enter Debian main.
Line 32: Line 34:
 7. Inspect [[Lintian|lintian]] messages. ''gbp buildpackage'' runs lintian after successful builds (if lintian is installed). Make sure the package is clean of both errors and warnings, although some warnings may be justified.
 8. To make sure the package will build on [[buildd|buildds]], build it for clean [[DebianUnstable|Debian Unstable]] with only the essential packages, possibly by using [[sbuild]].
 9. (Optional) Add [[ContinuousIntegration/autopkgtest|autopkgtest]].
 10. Upload/ask for sponsorship.
 7. Inspect the built binary packages. Check the contents, ensure everything is installed into the expected locations:
 {{{
 dpkg --contents ../hello_1.2.3-1_all.deb
 }}}
 Check the dependencies and other relationships with other packages:
 {{{
 dpkg --info ../hello_1.2.3-1_all.deb
 }}}
 Install the package and try using it:
 {{{
 sudo dpkg --install ../hello_1.2.3-1_all.deb
 }}}
 8
. Inspect [[Lintian|lintian]] messages. ''gbp buildpackage'' runs lintian after successful builds (if lintian is installed). Make sure the package is clean of both errors and warnings, although some warnings may be justified.
 9. To make sure the package will build on [[buildd|buildds]], build it for clean [[DebianUnstable|Debian Unstable]] with only the essential packages, possibly by using [[sbuild]].
 10. (Optional) Add [[ContinuousIntegration/autopkgtest|autopkgtest]].
 11. Upload/ask for sponsorship.

This small tutorial shows steps I would take to prepare packaging for most of the source packages. For the example hypothetical source package hello of version 1.2.3 is used.

Prerequisites

sudo apt-get install debhelper dh-make git git-buildpackage lintian

Steps

  1. Ensure the source package is DFSG-compatible (free software). Non-free source and binary packages will not enter Debian main.

  2. Create a packaging Git repository named after the source package:
     git init hello
     cd hello
  3. Import the source package from URL:
     gbp import-orig --pristine-tar https://example.org/hello.tar.gz

    gbp will ask some questions, but these are trivial to answer.

  4. Use dh_make to prepare packaging scaffold under debian/ directory. Source package name and its version has to be provided via --packagename option:

     dh_make --packagename hello_1.2.3
  5. Remove unneeded files from under debian/. Most of the files ending in .ex are not mandatory and could be added later if needed. Add debian/ and commit:

     git add debian
     git commit
  6. Build the package:
     gbp buildpackage -uc -us
  7. If the build fails, inspect the reasons of failure. Sometimes turning on the verbose mode in debian/rules helps. Repeat the build-fix-build cycle until successful build is achieved.
  8. Inspect the built binary packages. Check the contents, ensure everything is installed into the expected locations:
     dpkg --contents ../hello_1.2.3-1_all.deb
    Check the dependencies and other relationships with other packages:
     dpkg --info ../hello_1.2.3-1_all.deb
    Install the package and try using it:
     sudo dpkg --install ../hello_1.2.3-1_all.deb
  9. Inspect lintian messages. gbp buildpackage runs lintian after successful builds (if lintian is installed). Make sure the package is clean of both errors and warnings, although some warnings may be justified.

  10. To make sure the package will build on buildds, build it for clean Debian Unstable with only the essential packages, possibly by using sbuild.

  11. (Optional) Add autopkgtest.

  12. Upload/ask for sponsorship.