Guide for Debian Maintainers

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

This guide was made using the following previous documents as its reference:

  • “Making a Debian Package (AKA the Debmake Manual)”, copyright © 1997 Jaldhar Vyas.
  • “The New-Maintainer’s Debian Packaging Howto”, copyright © 1997 Will Lowe.
  • “Debian New Maintainers’ Guide”, copyright © 1998-2002 Josip Rodin, 2005-2017 Osamu Aoki, 2010 Craig Small, and 2010 Raphaël Hertzog.

The latest version of this guide should be available:

Abstract

This “Guide for Debian Maintainers” (2023-11-10) tutorial guide describes the building of the Debian package to ordinary Debian users and prospective developers using the debmake command.

This guide focuses on the modern packaging style and comes with many simple examples.

  • POSIX shell script packaging
  • Python3 script packaging
  • C with Makefile/Autotools/CMake
  • multiple binary packages with shared library etc.

This “Guide for Debian Maintainers” can be considered as the successor to the “Debian New Maintainers’ Guide”.


Table of Contents

Preface
1. Overview
2. Prerequisites
2.1. People around Debian
2.2. How to contribute
2.3. Social dynamics of Debian
2.4. Technical reminders
2.5. Debian documentation
2.6. Help resources
2.7. Archive situation
2.8. Contribution approaches
2.9. Novice contributor and maintainer
3. Tool Setups
3.1. Email address
3.2. mc
3.3. git
3.4. quilt
3.5. devscripts
3.6. sbuild
3.7. git-buildpackage
3.8. HTTP proxy
3.9. Private Debian repository
3.10. Virtual machines
3.11. Local network with virtual machines
4. Simple Example
4.1. Packaging tarball
4.2. Big picture
4.3. What is debmake?
4.4. What is debuild?
4.5. Step 1: Get the upstream source
4.6. Step 2: Generate template files with debmake
4.7. Step 3: Modification to the template files
4.8. Step 4: Building package with debuild
4.9. Step 3 (alternative): Modification to the upstream source
4.9.1. Patch by diff -u
4.9.2. Patch by dquilt
4.9.3. Patch by dpkg-source --commit
5. Basics
5.1. Packaging workflow
5.1.1. The debhelper package
5.2. Historical perspective of Debian packaging practices
5.3. Future perspective on Debian packaging practices
5.4. Package name and version
5.5. Native Debian package
5.6. debian/rules
5.6.1. dh
5.6.2. Simple debian/rules
5.6.3. Customized debian/rules
5.6.4. Variables for debian/rules
5.6.5. Reproducible build
5.7. debian/control
5.7.1. Split of a Debian binary package
5.7.1.1. debmake -b
5.7.1.2. Package split scenario and examples
5.7.1.3. The library package name
5.7.2. Substvar
5.7.3. binNMU safe
5.8. debian/changelog
5.9. debian/copyright
5.10. debian/patches/*
5.10.1. dpkg-source -x
5.10.2. dquilt and dpkg-source
5.11. debian/upstream/signing-key.asc
5.12. debian/watch and DFSG
5.13. Other debian/* Files
5.14. Customization of the Debian packaging
5.15. Recording in VCS (standard)
5.16. Recording in VCS (alternative)
5.17. Building package without extraneous contents
5.17.1. Fix by debian/rules clean
5.17.2. Fix using VCS
5.17.3. Fix by extend-diff-ignore
5.17.4. Fix by tar-ignore
5.18. Upstream build systems
5.18.1. Autotools
5.18.2. CMake
5.18.3. Meson
5.18.4. Python distutils
5.19. Debugging information
5.19.1. New -dbgsym package (Stretch 9.0 and after)
5.20. Library package
5.20.1. Library symbols
5.20.2. Library transition
5.21. debconf
5.22. Multiarch
5.22.1. The multiarch library path
5.22.2. The multiarch header file path
5.22.3. The multiarch *.pc file path
5.23. Compiler hardening
5.24. Continuous integration
5.25. Other new requirements
5.26. Bootstrapping
5.27. Bug reports
6. debmake options
6.1. Shortcut options (-a, -i)
6.1.1. Python module
6.2. Snapshot upstream tarball (-d, -t)
6.3. debmake -cc
6.4. debmake -k
6.5. debmake -j
6.6. debmake -x
6.7. debmake -P
6.8. debmake -T
7. Tips
7.1. debdiff
7.2. dget
7.3. debc
7.4. piuparts
7.5. debsign
7.6. dput
7.7. bts
7.8. git-buildpackage
7.8.1. gbp import-dscs --debsnap
7.8.2. Upstream git repository
7.9. dgit
7.9.1. Snapshot upstream tarball (alternative git deborig approach)
7.10. chroot
7.11. New Debian revision
7.12. New upstream release
7.12.1. uupdate + tarball
7.12.2. uscan
7.12.3. gbp
7.12.4. gbp + uscan
7.13. 3.0 source format
7.14. CDBS
7.15. Build under UTF-8
7.16. UTF-8 conversion
7.17. Upload orig.tar.gz
7.18. Skipped uploads
7.19. Advanced packaging
7.20. Other distros
7.21. Debug
8. More Examples
8.1. Cherry-pick templates
8.2. No Makefile (shell, CLI)
8.3. Makefile (shell, CLI)
8.4. setup.py (Python3, CLI)
8.5. Makefile (shell, GUI)
8.6. setup.py (Python3, GUI)
8.7. Makefile (single-binary package)
8.8. Makefile.in + configure (single-binary package)
8.9. Autotools (single-binary package)
8.10. CMake (single-binary package)
8.11. Autotools (multi-binary package)
8.12. CMake (multi-binary package)
8.13. Internationalization
8.14. Details
A. debmake(1) manpage
A.1. NAME
A.2. SYNOPSIS
A.3. DESCRIPTION
A.3.1. optional arguments:
A.4. EXAMPLES
A.5. HELPER PACKAGES
A.6. CAVEAT
A.7. DEBUG
A.8. AUTHOR
A.9. LICENSE
A.10. SEE ALSO