Datasheet

72
Part I The Fundamentals
Source packages versus binary packages
A source package is a package that is made up completely of source code. Source
code is useful for programmers but must be built or compiled before it can actually
be run. Building packages can take long periods of time even on fast machines, and
it takes even longer on older and slower machines. Binary packages are already
compiled and are distributed in a ready-to-use manner. A perennial debate in the
GNU/Linux world is whether to distribute source packages or binary packages to
end-users. The difference is simple: If source packages are distributed, the user
builds and installs the software on his machine; if binary packages are distributed,
only the installation part is necessary. In each case, the package system will config-
ure the source, compile it, install it, and throughout the process run any scripts
that are required.
Compiling a package doesn’t necessarily need to be complex. There are several
source-based packaging systems in use, and they all make the job of configuring the
source package, compiling it, and installing it relatively pain-free. In fact, this is a
basic precept of any packaging system: Do as much of the work as possible for the
user.
In the case of source packages, there are typically numerous default source-
configuration values that users can, should they choose to, override. This allows
for a degree of build-time customization that can vary from package to package.
However, most of these systems allow for one notable customization the ability
to specify compiler settings. Customizing compiler settings allows a greater degree
of control over the compilation process, which can include performance-related
optimization.
There have been many studies conducted on the effect of changing default com-
piler settings, and in almost every common case it proved that the resulting soft-
ware was slower and more crash prone than software compiled with conservative
settings the settings that Debian package maintainers choose by default. If you
wish to investigate changing compiler settings and rebuilding packages, avail your-
self of the compiler documentation and take some time to research studies that
have been done in the field.
Though source-based packaging systems exist and are used by some, binary-based
packaging systems are far more prevalent. In these systems, the package maintainer
configures the source and compiles the software, and then packages the result into
a simple file, which is distributed to the end-user. Compared to compiling a source
package, installing a binary package is very fast. A large source package can take
hours to compile on high-end hardware, whereas a binary package created from
that source code can be installed in seconds. Binary packages also result in a far
more consistent end-user installation because each end-user installs the same
binary package. Last but certainly not least, a binary package maintainer will typi-
cally be very familiar with the package she is producing and will have in-depth
knowledge of the ideal compiler and source settings to use.
Caution
09_576445 ch04.qxd 7/5/05 3:10 PM Page 72