$linuxjunkies
>

dh_make(1)

Create Debian package templates for a new software project.

UbuntuDebianFedoraArch

Synopsis

dh_make [OPTION]... [-f filename]

Description

dh_make converts a regular source tree into a Debian package by generating a debian/ directory with template files. It autodetects the package type (single binary, multiple binaries, library, or Perl module) and creates appropriate control files, rules, and changelog entries. This is typically the first step in packaging software for Debian.

dh_make is part of debhelper, the standard Debian packaging toolset. It simplifies the creation of debian/control, debian/rules, debian/changelog, and other required files based on the project structure.

Common options

FlagWhat it does
-fSpecify the upstream source file to use (tarball path)
-pSet package name (overrides auto-detection from directory)
-sCreate a single binary package (default if unclear)
-mCreate multiple binary packages from one source
-lCreate a library package (with appropriate naming)
-eSet email address for the maintainer field
-cSpecify copyright file template (apache, gpl, mit, etc.)
-nNon-interactive mode, use all defaults
--nativeCreate a Debian native package (no upstream version separation)
--createorigCreate .orig.tar.gz from the source directory

Examples

Initialize Debian packaging in extracted source directory with upstream tarball reference

cd ~/myapp-1.0 && dh_make -f ../myapp-1.0.tar.gz

Create single binary package with explicit name and maintainer email

dh_make -p mypackage -e [email protected] -s

Non-interactive mode for native Debian package with MIT license template

dh_make -n --native -c mit

Create library package with proper naming convention for shared library

dh_make -l -p libmylib1 -e [email protected]

Create multi-binary package layout for source that builds multiple binaries

dh_make -m -f ../myapp-2.0.tar.gz

Initialize packaging and automatically create .orig.tar.gz from current directory

dh_make -n --createorig

Related commands