[[build]]
=== Upstream build systems

Upstream build systems are designed to go through several steps to install generated binary files to the system from the source distribution.

[[autotools]]
==== Autotools

Autotools (*autoconf* + *automake*) has 4 steps.

1. setup the build system ("*vim configure.ac Makefile.am*" and "*autoreconf -ivf*")
2. configure the build system ("*./configure*")
3. build the source tree ("*make*")
4. install the binary files ("*make install*")

The upstream usually performs the step 1 and builds the upstream tarball for distribution using the "*make dist*" command.   (The generated tarball contains not only the pristine upstream VCS contents but also other generated files.)

The package maintainer needs to take care step 2 to 4 at least.  This is realized by the "*dh $@ --with autotools-dev*" command used in the *debian/rules* file.

The package maintainer wishes to take care step 1 to 4.  This is realized by the "*dh $@ --with autoreconf*" command used in the *debian/rules* file.  This rebuilds all auto-generated files to the latest version and provides better porting supports.

[[python]]
==== Python distutils

Python distutils has 3 steps.

1. setup and configure the build system ("*vim setup.py*")
2. build the source tree ("*python setup.py build*")
3. install the binary files ("*python setup.py install*")

The upstream usually performs the step 1 and builds the upstream tarball for distribution using the "*python setup.py sdist*" command.

The package maintainer needs to take care step 2.  This is realized simply by the "*dh $@*" command used in the *debian/rules* file, after *jessie*.

The situation of other build systems, such as CMake, are very similar to this Python one.
