1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108
|
// vim:set filetype=asciidoc:
[[autotools-multi]]
=== Autotools (multi-binary package)
Here is an example of creating a set of Debian binary packages including the executable package, the shared library package, the development file package, and the debug symbol package from a simple C source program using Autotools (Autoconf and Automake, which use *Makefile.am* and *configure.ac* as their input files) as its build system.
Let's package this in a similar way to "`<<autotools-single>>`".
Let's assume this upstream tarball to be *debhello-2.0.tar.gz*.
This type of source is meant to be installed as a non-system file, for example, as:
----
$ tar -xzmf debhello-2.0.tar.gz
$ cd debhello-2.0
$ autoreconf -ivf # optional
$ ./configure --with-math
$ make
$ make install
----
Let's get the source and make the Debian package.
.Download *debhello-2.0.tar.gz*
----
include::../examples/debhello-2.0_build-1/step000.slog[]
----
Here, the contents of this source are as follows.
.*src/hello.c* (v=2.0):
----
include::../examples/debhello-2.0_build-1/step101.slog[]
----
.*lib/sharedlib.h* and *lib/sharedlib.c* (v=1.6):
----
include::../examples/debhello-2.0_build-1/step102.slog[]
----
.*Makefile.am* (v=2.0):
----
include::../examples/debhello-2.0_build-1/step103.slog[]
----
.*configure.ac* (v=2.0):
----
include::../examples/debhello-2.0_build-1/step104.slog[]
----
Let's use the *debmake* command to package this into multiple packages:
* *debhello*: type = *bin*
* *libsharedlib1*: type = *lib*
* *libsharedlib-dev*: type = *dev*
Here, we use the *-b\'libsharedlib1,libsharedlib-dev'* option to specify the additional binary packages to be generated.
----
include::../examples/debhello-2.0_build-1/step200.slog[lines=1..3]
...
include::../examples/debhello-2.0_build-1/step200.slog-sanity[]
...
----
The result is similar to "`<<configure-single>>`" but with more template files.
Let's inspect the notable template files generated.
.*debian/rules* (template file, v=2.0):
----
include::../examples/debhello-2.0_build-1/step202.slog[]
----
Let's make this Debian package better as the maintainer.
.*debian/rules* (maintainer version, v=2.0):
----
include::../examples/debhello-2.0_build-1/step301.slog[]
----
.*debian/control* (maintainer version, v=2.0):
----
include::../examples/debhello-2.0_build-1/step302.slog[]
----
.**debian/*.install** (maintainer version, v=2.0):
----
include::../examples/debhello-2.0_build-1/step303.slog[]
----
Since this upstream source creates the proper auto-generated *Makefile*, there is no need to create *debian/install* and *debian/manpages* files.
There are several other template files under the *debian/* directory. These also need to be updated.
.Template files under *debian/*. (v=2.0):
----
include::../examples/debhello-2.0_build-1/step400.slog[]
----
The rest of the packaging activities are practically the same as the one in "`<<configure-single>>`".
Here are the generated dependency list of all binary packages.
.The generated dependency list of all binary packages (v=2.0):
----
include::../examples/debhello-2.0_build-1/step702.slog[]
----
|