# Debian pkg from py
```
debian
|_ changelog
|_ control
|_ copyright
|_ rules
```
[TOC]
## changelog
```
debian
|_ changelog
```
> Changes in the Debian version of the package should be briefly explained in this file.
> This includes modifications made in the Debian package compared to the upstream one as well as other changes and updates to the package.
**<source package name>** (<version-number>) <**distribution(s)**>; **urgency**=<urgency>
* change details
more change details
* even more change details
-- **maintainer name** <email address>[two spaces] day-of-week, dd month yyyy hh:mm:ss +zzzz
*e.g.*
```
python3-foo (1.0.0) unstable; urgency=low
* First version of foo
-- Patsy <patsy@foo.spam> Tue, 19 May 2020 01:44:12 -0300
```
> **distribution**: `UNRELEASED` -> `unstable` -> `experimental`
**`unstable`** if there is not previous changelog entry
**urgency**: `low`, usual upload, no matter their bug status. 10 days of transition.
`medium`, bug fix(es). 5 days for a
transition attempt.
`high`, For fixing critical bugs (esp. security). 2 days for transition.
## copyright
```
debian
|_ copyright
```
a verbatim copy of the package’s copyright information
## control
```
debian
|_ control
```
> contains source/binary pkg information
### general
**Source**: (\*) src-pkg-name *(e.g. python3-foo)*
> must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.).
> must contain only the name of the source package.
**Maintainer**: (\*) Name <e-mail> *(e.g. Patsy <patsy@foo.spam>)*
> can be a single maintainer or a group of them, it must contain a working email address.
**Uploaders**: Name <e-mail> *(e.g. Praline <praline@foo.spam>, Ron Obvious <robvious@foo.spam>)*
**Section**: (·) section *(e.g. python)*
> dmin, cli-mono, comm, database, debug, devel, doc, editors, education, electronics, embedded, fonts, games, gnome, gnu-r, gnustep, graphics, hamradio, haskell, httpd, interpreters, introspection, java, javascript, kde, kernel, libdevel, libs, lisp, localization, mail, math, metapackages, misc, net, news, ocaml, oldlibs, otherosfs, perl, php, python, ruby, rust, science, shells, sound, tasks, tex, text, utils, vcs, video, web, x11, xfce, zope
[more sections info](https://packages.debian.org/unstable/)
**Priority**: (·) optional
> how important it is that the user have the package.
values: `optional`, other must be used for default deb pkgs.
`important`, minimum of commonly-expected and necessary Unix tools.
`standard`, it will be installed by default if the user doesn’t select anything else.
**Build-Depends**: debhelper (>= 11~)
dh-python
python3-all
python3-setuptools
> *(listed are required using [Pybuild](https://wiki.debian.org/Python/Pybuild))*
> list of packages that need to be installed and configured to be able to build from source package.
**Build-Depends-Arch**:
> only needed when building the architecture dependent packages.
**Build-Depends-Indep**:
>only needed when building the architecture independent packages
**Build-Conflicts**:
> list of packages that should not be installed when the package is built
**Build-Conflicts-Arch**:
> only when building the architecture dependent packages
**Build-Conflicts-Indep**:
> only when building the architecture independent packages
**Standards-Version**: (\*) 4.5.0.2
> The most recent version of the standards (the policy manual and associated texts) with which the package complies. `4.5.0.2` *(released on 2020-04-28)*
**Homepage**: url *(e.g. https://pkg-name.com)*
> The URL of the web site for this package, where is original source.
**Vsc-Browser**: url *(e.g. https://github.com/user/pkg-name)*
> URL of a web interface for browsing the repository.
**Vsc-<type>**: url *(e.g. **Vsc-git**: https://github.com/user/pkg-name/tree/master)*
> VSC's conventional syntax for describing repository locations and the branch.
Vsc-rch:
Vsc-Bzr: (Bazaar)
Vsc-Cvs: (CVS)
Vsc-Darcs:
Vsc-Git:
Vsc-Hg: (Mercurial)
Vsc-Mtn: (Monotone)
Vsc-Svn: (Subversion)
**Testsuite**: autopkgtest-pkg-python
> comma-separated list of values allowing test execution environments to discover packages which provide tests
**Rules-Requires-Root**: binary-targets
> defines if the source package requires access to root (or fakeroot)
`no`
`binary-targets`, pkg will need the root (or fakeroot) when either of the binary, binary-arch or binary-indep targets are called
### binary package
**Package**: (\*) bin-pkg-name *(e.g. python3-foo (1.2.0)*
> name of the binary package.
must consist only of lower case letters (a-z), digits (0-9), plus (+) and minus (-) signs, and periods (.).
may be followed by a version number in parentheses, only require the first 3 components
**Architecture**: (\*) all
>A Debian machine architecture: run `dpkg-architecture -L` and choose one.
A set of Debian machine architectures: `any` (which matches every architecture), `os-any`, or `any-cpu`.
**`all`**, which indicates an architecture-independent package.
`source`, which indicates a source package.
**Section**: (·) section *(e.g. python)*
> dmin, cli-mono, comm, database, debug, devel, doc, editors, education, electronics, embedded, fonts, games, gnome, gnu-r, gnustep, graphics, hamradio, haskell, httpd, interpreters, introspection, java, javascript, kde, kernel, libdevel, libs, lisp, localization, mail, math, metapackages, misc, net, news, ocaml, oldlibs, otherosfs, perl, php, python, ruby, rust, science, shells, sound, tasks, tex, text, utils, vcs, video, web, x11, xfce, zope
[more sections info](https://packages.debian.org/unstable/)
Priority (·)
**Essential**: no
> `yes`, the package management system will refuse to remove the package.
`no`, which is the same as not having the field at all.
**Depends**:
> package will not be configured unless all of the packages listed here have been correctly configured.
**Recommends**:
> strong but not absolute, packages that would be found together with this one.
**Suggests**
> package may be more useful with one or more others
**Enhances**:
> opposite of Suggests
**Pre-Depends**:
> SImilar to Depends, but apply to before even starting the installation.
**Description**: (\*) single line synopsis
extended description over several lines
extended description over several lines
> description of the binary package, consisting of two parts, the synopsis or the short description, and the long description
**Homepage**: url *(e.g. https://pkg-name.com)*
> The URL of the web site for this package, where is original source.
**Built-Using**: *e.g. grub2 (= 1.99-9), loadlin (= 1.6e-1)*
> list the source package for any affected binary package during the build, including an “exactly equal” (“=”) version
**Package-Type**:
> `deb` for binary packages.
`udeb` for micro binary packages.
other types
## rules
```
debian
|_ rules
```
> an executable makefile. It contains the package-specific recipes for compiling the source (if required) and constructing one or more binary packages.
> Next example is the required for pybuild tool:
```
#!/usr/bin/make -f
#export DH_VERBOSE=1
export PYBUILD_NAME=<module-name>
export PYBUILD_INSTALL_ARGS =
%:
dh $@ --with python3 --buildsystem=pybuild
```
>*e.g.* **export PYBUILD_NAME=foo**
>**dh $@ --with python3 --buildsystem=pybuild**
Builds the Python 3 package for all supported Python 3 versions.
Automatically detects the command to run the test suite.
Runs the Python 3 test suite.