[[control]]
=== *debian/control*

The *debian/control* file is the primary configuration file defining what binary packages are generated.

The *debmake* command with the *-b* option (see <<boption>>) creates the initial template *debian/control* file with followings:

* a set of stanza defining the split of the Debian binary package
* a basic set of substvar used for each stanza

[[split]]
==== Split of the Debian binary package

For well behaving build systems, the split of the Debian binary package into small ones can be realized as follows.

* Create binary package entries for all binary packages in the *debian/control* file.
* List all file paths (relative to *debian/tmp*) in the corresponding *debian/*'binarypackage'**.install** files.

Please check examples in this document:

 * <<multi-ex>> (simple)
 * <<multipkg>> (detailed)

[[substvar]]
==== Substvar

The *debian/control* file also defines the package dependency in which the http://www.debian.org/doc/debian-policy/ch-source.html#s-substvars[variable substitutions mechanism] (substvar) may be used.  See *deb-substvars*(5).

The *debmake* command supports following substvars.

* *$\{misc:Depends}* for all binary packages
* *$\{misc:Pre-Depends}* for all multiarch packages
* *$\{shlibs:Depends}* for all binary executable and library packages
* *$\{python:Depends}* for all Python packages
* *$\{python3:Depends}* for all Python3 packages
* *$\{perl:Depends}* for all Perl packages
* *$\{ruby:Depends}* for all Ruby packages

[[binnmu]]
==== binNMU safe

For the safe binNMU, the dependency among binary packages from a same source package needs attention if there are both "*Architecture: any*" and "*Architecture: all*" packages involved in it.

* "*Architecture: any*" package depends on "*Architecture: any*" 'foo' package
** *Depends:* 'foo' *(== $\{binary:Version})*
* "*Architecture: any*" package depends on "*Architecture: all*" 'bar' package
** *Depends:* 'bar' *(== $\{source:Version}*
* "*Architecture: all*" package depends on "*Architecture: any*" 'baz' package
** *Depends:* 'baz' *(>= $\{source:Version})* (This is good enough for most cases.)

The *debian/control* file needs to be be manually adjusted.  See https://wiki.debian.org/binNMU[binNMU].

[[libnames]]
==== The library package name

Let's assume we have *lib*'foo-7.0'*.tar.gz* as the upstream of the *lib*'foo' library.

The binary pakage of the the *lib*'foo' library is usually named as *lib*'foo7' with its SONAME major version.

When naming the *-dev* package, there are two approaches:

* *lib*'foo'*-dev* if you support only one *lib*'foo7' only. 
** This is good enough if the number of dependent packages are limitted.
** You need to work with the https://wiki.debian.org/Teams/ReleaseTeam[release team] for the library transition: https://wiki.debian.org/Teams/ReleaseTeam/TransitionTracker[TransitionTracker]
* *lib*'foo7'*-dev* and *lib*'foo8'*-dev* if you support both *lib*'foo7' and *lib*'foo8'.
** This is an option if the number of dependent packages are huge.
** Both *lib*'foo7'*-dev* and *lib*'foo8'*-dev* provide *lib*'foo'*-dev* to enable the automatic library transition via binNMU.

See http://www.debian.org/doc/debian-policy/ch-sharedlibs.html[Chapter 8 - Shared libraries] in the ``Debian Policy Manual''.


