X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=policy.sgml;h=b1c1018af0a515ebfd9b33364516cb0c4bd378d5;hb=6b00973823cc99e6b50eab6489747d0b8c77e3e1;hp=1b28837928ad5b53f9460a9e1bb767f94bf61067;hpb=98b33a11c306d9c692f186f1f0a0ddfb204eb5d8;p=debian%2Fdebian-policy.git diff --git a/policy.sgml b/policy.sgml index 1b28837..b1c1018 100644 --- a/policy.sgml +++ b/policy.sgml @@ -132,7 +132,7 @@ interfaces not changing, and the package management software authors need to ensure compatibility with these interface - definitions. (Control file and and changelog file + definitions. (Control file and changelog file formats are examples.)

@@ -164,7 +164,7 @@ may, and the adjectives required, recommended and optional, are used to distinguish the significance of the various guidelines in - this policy document. Packages that do not conform the the + this policy document. Packages that do not conform to the guidelines denoted by must (or required) will generally not be considered acceptable for the Debian distribution. Non-conformance with guidelines denoted by @@ -235,6 +235,7 @@

+ The Debian Archive

@@ -578,7 +579,7 @@

Every package must be accompanied by a verbatim copy of its copyright and distribution license in the file - /usr/share/doc/<package-name>/copyright + /usr/share/doc/<package>/copyright (see for further details).

@@ -764,8 +765,8 @@

These packages provide a reasonably small but not too - limited character-mode system. This is what will - install by default if the user doesn't select anything + limited character-mode system. This is what will be + installed by default if the user doesn't select anything else. It doesn't include many large applications, but it does include Emacs (this is more of a piece of infrastructure than an application) and a reasonable @@ -1467,7 +1468,7 @@ format.

- Syntax of control files + Syntax of control files

A control file consists of one or more paragraphs of fields. @@ -1488,7 +1489,7 @@ ignored there; it is conventional to put a single space after the colon. For example, a field might be: - Package: libc6 +Package: libc6 the field name is Package and the field value libc6. @@ -2108,7 +2109,7 @@

The architectures we build on and build for are determined - by make variables using + by make variables using the utility dpkg-architecture. You can determine the Debian architecture and the GNU style architecture specification string for the build machine (the machine type @@ -2241,9 +2242,7 @@

To be precise, the string should match the following Perl regular expression: - -/closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*/i - + /closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*/i Then all of the bug numbers listed will be closed by the archive maintenance script (katie), or in the case of an NMU, marked as fixed. @@ -2730,7 +2729,7 @@

If a version of the package is already installed, call - old-prerm upgrade new-version +old-prerm upgrade new-version

@@ -2738,11 +2737,11 @@ If the script runs but exits with a non-zero exit status, dpkg will attempt: - new-prerm failed-upgrade old-version +new-prerm failed-upgrade old-version Error unwind, for both the above cases: - old-postinst abort-upgrade new-version +old-postinst abort-upgrade new-version

@@ -2758,15 +2757,15 @@ package and --auto-deconfigure is specified, call, for each such package: - deconfigured's-prerm deconfigure \ - in-favour package-being-installed version \ - removing conflicting-package version +deconfigured's-prerm deconfigure \ + in-favour package-being-installed version \ + removing conflicting-package version Error unwind: - deconfigured's-postinst abort-deconfigure \ - in-favour package-being-installed-but-failed version \ - removing conflicting-package version +deconfigured's-postinst abort-deconfigure \ + in-favour package-being-installed-but-failed version \ + removing conflicting-package version The deconfigured packages are marked as requiring configuration, so that if @@ -2776,12 +2775,13 @@

To prepare for removal of the conflicting package, call: - conflictor's-prerm remove in-favour package new-version +conflictor's-prerm remove \ + in-favour package new-version Error unwind: - conflictor's-postinst abort-remove \ - in-favour package new-version +conflictor's-postinst abort-remove \ + in-favour package new-version

@@ -2794,7 +2794,7 @@

If the package is being upgraded, call: - new-preinst upgrade old-version +new-preinst upgrade old-version

@@ -2803,19 +2803,19 @@ files from a previous version installed (i.e., it is in the `configuration files only' state): - new-preinst install old-version +new-preinst install old-version

Otherwise (i.e., the package was completely purged): - new-preinst install +new-preinst install Error unwind actions, respectively: - new-postrm abort-upgrade old-version - new-postrm abort-install old-version - new-postrm abort-install +new-postrm abort-upgrade old-version +new-postrm abort-install old-version +new-postrm abort-install

@@ -2885,17 +2885,17 @@

If the package is being upgraded, call - old-postrm upgrade new-version +old-postrm upgrade new-version

If this fails, dpkg will attempt: - new-postrm failed-upgrade old-version +new-postrm failed-upgrade old-version Error unwind, for both cases: - old-preinst abort-upgrade new-version +old-preinst abort-upgrade new-version

@@ -2931,8 +2931,8 @@

dpkg calls: - disappearer's-postrm disappear \ - overwriter overwriter-version +disappearer's-postrm disappear \ + overwriter overwriter-version

@@ -3005,7 +3005,7 @@ --install, or with --configure), we first update any conffiles and then call: - postinst configure most-recently-configured-version +postinst configure most-recently-configured-version

@@ -3031,7 +3031,7 @@

- prerm remove +prerm remove

@@ -3041,9 +3041,11 @@

-

- postrm remove -

+

+ +postrm remove + +

@@ -3065,9 +3067,11 @@ .dpkg-{old,new,tmp}, etc.) are removed.

-

- postrm purge -

+

+ +postrm purge + +

The package's file list is removed.

@@ -3081,7 +3085,7 @@ Declaring relationships between - packages + packages

Packages can declare in their control file that they have @@ -3093,9 +3097,10 @@

- This is done using the Depends, Recommends, - Suggests, Enhances, Conflicts, - Provides and Replaces control file fields. + This is done using the Depends, Pre-Depends, + Recommends, Suggests, Enhances, + Conflicts, Provides and Replaces + control file fields.

@@ -3106,7 +3111,7 @@

This is done using the Build-Depends, - Build-Depends-Indep, Build-Conflicts, and + Build-Depends-Indep, Build-Conflicts and Build-Conflicts-Indep control file fields.

@@ -3125,18 +3130,17 @@ control file fields of the package, which declare dependencies on other packages, the package names listed may also include lists of alternative package names, separated - by vertical bar symbols | (pipe symbols). In such - a case, the presence of any one of the alternative packages - is installed, that part of the dependency is considered to - be satisfied. + by vertical bar (pipe) symbols |. In such a case, + if any one of the alternative packages is installed, that + part of the dependency is considered to be satisfied.

- All the fields except Provides may restrict their - applicability to particular versions of each named package. - This is done in parentheses after each individual package - name; the parentheses should contain a relation from the - list below followed by a version number, in the format + All of the fields except for Provides may restrict + their applicability to particular versions of each named + package. This is done in parentheses after each individual + package name; the parentheses should contain a relation from + the list below followed by a version number, in the format described in .

@@ -3144,8 +3148,8 @@ The relations allowed are <<, <=, =, >= and >> for strictly earlier, earlier or equal, exactly equal, later or - equal and strictly later, respectively. The forms - < and > were used to mean + equal and strictly later, respectively. The deprecated + forms < and > were used to mean earlier/later or equal, rather than strictly earlier/later, so they should not appear in new packages (though dpkg still supports them). @@ -3153,22 +3157,23 @@

Whitespace may appear at any point in the version - specification, and must appear where it's necessary to + specification subject to the rules in , and must appear where it's necessary to disambiguate; it is not otherwise significant. For consistency and in case of future changes to dpkg it is recommended that a single space be used after a version relationship and before a version - number; it is usual also to put a single space after each - comma, on either side of each vertical bar, and before each - open parenthesis. + number; it is also conventional to put a single space after + each comma, on either side of each vertical bar, and before + each open parenthesis.

- For example: + For example, a list of dependencies might appear as: - Package: metamail - Version: 2.7-3 - Depends: libc5 (>= 5.2.18-4), mime-support, csh | tcsh +Package: mutt +Version: 1.3.17-1 +Depends: libc6 (>= 2.2.1), exim | mail-transport-agent

@@ -3177,7 +3182,7 @@ (Build-Depends, Build-Depends-Indep, Build-Conflicts and Build-Conflicts-Indep) may be restricted to a certain set of architectures. This - is done in brackets after each individual package name and + is indicated in brackets after each individual package name and the optional version specification. The brackets enclose a list of Debian architecture names separated by whitespace. Exclamation marks may be prepended to each of the names. @@ -3193,10 +3198,10 @@

For example: - Source: glibc - Build-Depends-Indep: texinfo - Build-Depends: kernel-headers-2.2.10 [!hurd-i386], - hurd-dev [hurd-i386], gnumach-dev [hurd-i386] +Source: glibc +Build-Depends-Indep: texinfo +Build-Depends: kernel-headers-2.2.10 [!hurd-i386], +hurd-dev [hurd-i386], gnumach-dev [hurd-i386]

@@ -3214,17 +3219,22 @@

- All but Pre-Depends and Conflicts - (discussed below) take effect only when a package - is to be configured. They do not prevent a package being on - the system in an unconfigured state while its dependencies - are unsatisfied, and it is possible to replace a package - whose dependencies are satisfied and which is properly - installed with a different version whose dependencies are - not and cannot be satisfied; when this is done the depending - package will be left unconfigured (since attempts to - configure it will give errors) and will not function - properly. + A Depends field takes effect only when a + package is to be configured. It does not prevent a package + being on the system in an unconfigured state while its + dependencies are unsatisfied, and it is possible to replace + a package whose dependencies are satisfied and which is + properly installed with a different version whose + dependencies are not and cannot be satisfied; when this is + done the depending package will be left unconfigured (since + attempts to configure it will give errors) and will not + function properly. If it is necessary, a + Pre-Depends field can be used, which has a partial + effect even when a package is being unpacked, as explained + in detail below. (The other three dependency fields, + Recommends, Suggests and + Enhances, are only used by the various front-ends + to dpkg such as dselect.)

@@ -3236,20 +3246,37 @@

- Thus Depends allows package maintainers to impose - an order in which packages should be configured. + The Depends field thus allows package maintainers + to impose an order in which packages should be configured. +

+ +

+ The meaning of the five dependency fields is as follows: Depends -

This declares an absolute dependency. +

+ This declares an absolute dependency. A package will + not be configured unless all of the packages listed in + its Depends field have been correctly + configured.

The Depends field should be used if the depended-on package is required for the depending package to provide a significant amount of - functionality.

+ functionality. +

+

+ The Depends field should also be used if the + postinst, prerm or + postrm scripts require the package to be + present in order to run. Note, however, that the + postrm cannot rely on any non-essential + packages to be present during the purge + phase. Recommends @@ -3294,35 +3321,43 @@ also forces dpkg to complete installation of the packages named before even starting the installation of the package which declares the - Pre-dependency. + pre-dependency, as follows:

- Pre-Depends should be used sparingly, - preferably only by packages whose premature upgrade or - installation would hamper the ability of the system to - continue with any upgrade that might be in progress. + When a package declaring a pre-dependency is about to + be unpacked the pre-dependency can be + satisfied if the depended-on package is either fully + configured, or even if the depended-on + package(s) are only unpacked or half-configured, + provided that they have been configured correctly at + some point in the past (and not removed or partially + removed since). In this case, both the + previously-configured and currently unpacked or + half-configured versions must satisfy any version + clause in the Pre-Depends field.

- When the package declaring it is being configured, a - Pre-Dependency will be considered satisfied - only if the depending package has been correctly - configured, just as if an ordinary Depends - had been used. + When the package declaring a pre-dependency is about + to be configured, the pre-dependency will be + treated as a normal Depends, that is, it will + be considered satisfied only if the depended-on + package has been correctly configured.

- However, when a package declaring a Pre-dependency is - being unpacked the predependency can be satisfied even - if the depended-on package(s) are only unpacked or - half-configured, provided that they have been - configured correctly at some point in the past (and - not removed or partially removed since). In this case - both the previously-configured and currently unpacked - or half-configured versions must satisfy any version - clause in the Pre-Depends field. + Pre-Depends should be used sparingly, + preferably only by packages whose premature upgrade or + installation would hamper the ability of the system to + continue with any upgrade that might be in progress.

+ +

+ Pre-Depends are also required if the + preinst script depends on the named + package. It is best to avoid this situation if + possible.

@@ -3340,30 +3375,30 @@

- Alternative binary packages - - Conflicts and Replaces - + Conflicting binary packages - + Conflicts

When one binary package declares a conflict with another - dpkg will refuse to allow them to be installed - on the system at the same time. + using a Conflicts field, dpkg will + refuse to allow them to be installed on the system at the + same time.

If one package is to be installed, the other must be removed first - if the package being installed is marked as - replacing () the one on the system, or - the one on the system is marked as deselected, or both + replacing (see ) the one on the system, + or the one on the system is marked as deselected, or both packages are marked Essential, then dpkg will automatically remove the package which is causing the conflict, otherwise it will halt the - installation of the new package with an error. This - mechanism specifically doesn't work when the installed - package is Essential, but the new package is not. + installation of the new package with an error. This + mechanism is specifically designed to produce an error when + the installed package is Essential, but the new + package is not.

-

A package will not cause a conflict merely because its configuration files are still installed; it must be at least @@ -3377,7 +3412,7 @@ prevent their installation, and allows a package to conflict with others providing a replacement for it. You use this feature when you want the package in question to be the only - package providing something. + package providing some feature.

@@ -3395,14 +3430,15 @@

As well as the names of actual (`concrete') packages, the package relationship fields Depends, + Recommends, Suggests, Enhances, + Pre-Depends, Conflicts, Build-Depends, Build-Depends-Indep, - Recommends, Suggests, Conflicts, - Build-Conflicts and Build-Conflicts-Indep may - mention virtual packages. + Build-Conflicts and Build-Conflicts-Indep + may mention `virtual packages'.

- A virtual package is one which appears in the + A virtual package is one which appears in the Provides control file field of another package. The effect is as if the package(s) which provide a particular virtual package name had been listed by name @@ -3416,16 +3452,18 @@ packages which provide it. This is so that, for example, supposing we have - Package: vm - Depends: emacs +Package: foo +Depends: bar - and someone else releases an xemacs package they can say + and someone else releases an enhanced version of the + bar package (for example, a non-US variant), they + can say: - Package: xemacs - Provides: emacs - and all will work in the interim (until a purely - virtual package name is decided on and the emacs - and vm packages are changed to use it). +Package: bar-plus +Provides: bar + + and the bar-plus package will now also satisfy the + dependency for the foo package.

@@ -3450,87 +3488,101 @@

- If you want to specify which of a set of real packages should be the - default to satisfy a particular dependency on a virtual package, you - should list the real package as an alternative before the virtual. + If you want to specify which of a set of real packages + should be the default to satisfy a particular dependency on + a virtual package, you should list the real package as an + alternative before the virtual one.

- Replaces - overwriting - files and replacing packages - - -

- The Replaces control file field has two purposes, - which come into play in different situations. -

+ Overwriting files and replacing + packages - Replaces

- Virtual packages () are not considered - when looking at a Replaces field - the packages - declared as being replaced must be mentioned by their real - names. + The Replaces control file field has two distinct + purposes, which come into play in different situations.

- Overwriting files in other packages - + Overwriting files in other packages

Firstly, as mentioned before, it is usually an error for a package to contain files which are on the system in - another package, though currently the - --force-overwrite flag is enabled by default, - downgrading the error to a warning, + another package.

- If the overwriting package declares that it replaces the - one containing the file being overwritten then - dpkg will proceed, and replace the file from - the old package with that from the new. The file will no - longer be listed as `owned' by the old package. + However, if the overwriting package declares that it + Replaces the one containing the file being + overwritten, then dpkg will replace the file + from the old package with that from the new. The file + will no longer be listed as `owned' by the old package.

If a package is completely replaced in this way, so that dpkg does not know of any files it still - contains, it is considered to have disappeared. It will + contains, it is considered to have `disappeared'. It will be marked as not wanted on the system (selected for - removal) and not installed. Any conffiles details noted - in the package will be ignored, as they will have been - taken over by the replacing package(s). The package's - postrm script will be run to allow the - package to do any final cleanup required. See . + removal) and not installed. Any conffiles + details noted for the package will be ignored, as they + will have been taken over by the overwriting package. The + package's postrm script will be run with a + special argument to allow the package to do any final + cleanup required. See . +

+ +

+ If an installed package, foo say, declares that + it replaces another, bar, and an attempt is made + to install bar, dpkg will discard + files in the bar package which would overwrite + those already present in foo. This is so that + you can install an older version of a package without + problems.

- In the future dpkg will discard files which - would overwrite those from an already installed package - which declares that it replaces the package being - installed. This is so that you can install an older - version of a package without problems. + For this usage of Replaces, virtual packages (see + ) are not considered when looking at a + Replaces field - the packages declared as being + replaced must be mentioned by their real names.

- This usage of Replaces only takes effect when - both packages are at least partially on the system at - once, so that it can only happen if they do not conflict - or if the conflict has been overridden.

+ Furthermore, this usage of Replaces only takes + effect when both packages are at least partially on the + system at once, so that it can only happen if they do not + conflict or if the conflict has been overridden. +

+
Replacing whole packages, forcing their - removal - + removal

Secondly, Replaces allows the packaging system to resolve which package should be removed when there is a conflict - see . This usage only takes effect when the two packages do conflict, - so that the two effects do not interfere with each other. + so that the two usages of this field do not interfere with + each other.

+ +

+ In this situation, the package declared as being replaced + can be a virtual package, so for example, all mail + transport agents (MTAs) would have the following fields in + their control files: + +Provides: mail-transport-agent +Conflicts: mail-transport-agent +Replaces: mail-transport-agent + + ensuring that only one MTA can be installed at any one + time. @@ -3541,21 +3593,22 @@

A source package may declare a dependency or a conflict on a - binary package. This is done with the control file fields - Build-Depends, Build-Depends-Indep, - Build-Conflicts, and - Build-Conflicts-Indep. Their semantics are that - the dependencies and conflicts they define must be satisfied - (as defined earlier for binary packages), when one of the - targets in debian/rules that the particular field - applies to is invoked. + binary package, indicating which packages are required to be + present on the system in order to build the binary packages + from the source package. This is done with the control file + fields Build-Depends, Build-Depends-Indep, + Build-Conflicts and Build-Conflicts-Indep. + The dependencies and conflicts they define must be satisfied + (as defined earlier for binary packages) in order to invoke + the targets in debian/rules, as follows: Build-Depends, Build-Conflicts

The Build-Depends and - Build-Conflicts fields apply to the targets + Build-Conflicts fields must be satisfied when + any of the following targets is invoked: build, binary, binary-arch and binary-indep.

@@ -3564,8 +3617,9 @@

The Build-Depends-Indep and - Build-Conflicts-Indep fields apply to the - targets binary and binary-indep. + Build-Conflicts-Indep fields must be + satisfied when any of the following targets is + invoked: binary and binary-indep.

@@ -3580,393 +3634,516 @@

- dpkg can do a certain amount of automatic - handling of package configuration files. -

- -

- Whether this mechanism is appropriate depends on a number of - factors, but basically there are two approaches to any - particular configuration file. -

- -

- The easy method is to ship a best-effort configuration in the - package, and use dpkg's conffile mechanism to - handle updates. If the user is unlikely to want to edit the - file, but you need them to be able to without losing their - changes, and a new package with a changed version of the file - is only released infrequently, this is a good approach. -

- -

- The hard method is to build the configuration file from - scratch in the postinst script, and to take the - responsibility for fixing any mistakes made in earlier - versions of the package automatically. This will be - appropriate if the file is likely to need to be different on - each system. + This chapter has been superseded by .

- Shared libraries - + Shared libraries

Packages containing shared libraries must be constructed with a little care to make sure that the shared library is always available. This is especially important for packages whose - shared libraries are vitally important, such as the libc. + shared libraries are vitally important, such as the C library + (currently libc6).

- Firstly, your package should install the shared libraries - under their normal names. For example, the - libgdbm1 package should install - libgdbm.so.1.7.3 as + Firstly, the package should install the shared libraries under + their normal names. For example, the libgdbmg1 + package should install libgdbm.so.1.7.3 as /usr/lib/libgdbm.so.1.7.3. The files should not be - renamed or re-linked by any prerm or postrm scripts; - dpkg will take care of renaming things safely - without affecting running programs, and attempts to interfere - with this are likely to lead to problems. + renamed or re-linked by any prerm or + postrm scripts; dpkg will take care + of renaming things safely without affecting running programs, + and attempts to interfere with this are likely to lead to + problems.

- Secondly, your package should include the symlink that + Secondly, the package should include the symbolic link that ldconfig would create for the shared libraries. - For example, the libgdbm1 package should include - a symlink from /usr/lib/libgdbm.so.1 to - libgdbm.so.1.7.3. This is needed so that - ld.so can find the library in between the time - dpkg installs it and ldconfig is run - in the postinst script. Furthermore, older - versions of the package management system required the library - must be placed before the symlink pointing to it in the - .deb file. This is so that by the time - dpkg comes to install the symlink (overwriting - the previous symlink pointing at an older version of the - library) the new shared library is already in place. - Unfortunately, this was not not always possible, since it - highly depends on the behavior of the file system. Some - file systems (such as reiserfs) will reorder the files so it - doesn't matter in what order you create them. Starting with - release 1.7.0 dpkg will reorder the - files itself when building a package. + For example, the libgdbmg1 package should include + a symbolic link from /usr/lib/libgdbm.so.1 to + libgdbm.so.1.7.3. This is needed so that the dynamic + linker (for example ld.so or + ld-linux.so.*) can find the library between the + time that dpkg installs it and the time that + ldconfig is run in the postinst + script. + +

+ The package management system requires the library to be + placed before the symbolic link pointing to it in the + .deb file. This is so that when + dpkg comes to install the symlink + (overwriting the previous symlink pointing at an older + version of the library), the new shared library is already + in place. In the past, this was achieved by creating the + library in the temporary packaging directory before + creating the symlink. Unfortunately, this was not always + effective, since the building of the tar file in the + .deb depended on the behavior of the underlying + file system. Some file systems (such as reiserfs) reorder + the files so that the order of creation is forgotten. + Starting with release 1.7.0, dpkg + will reorder the files itself as necessary when building a + package. Thus it is no longer important to concern + oneself with the order of file creation. +

+

- Thirdly, the development package should contain a symlink for - the shared library without a version number. For example, the - libgdbm1-dev package should include a symlink from - /usr/lib/libgdm.so to libgdm.so.1.7.3. This - symlink is needed by ld when compiling packages - as it will only look for libgdm.so and - libgdm.a when compiling dynamically or statically, - respectively. + Thirdly, the associated development package should contain a + symlink for the shared library without a version number. For + example, the libgdbmg1-dev package should include a + symlink from /usr/lib/libgdbm.so to + libgdbm.so.1.7.3. This symlink is needed by the + linker (ld) when compiling packages, as it will + only look for libgdbm.so when compiling dynamically.

- Any package installing shared libraries in a directory that's listed - in /etc/ld.so.conf or in one of the default library - directories of ld.so (currently, these are /usr/lib - and /lib) must call ldconfig in its postinst - script if and only if the first argument is `configure'. However, it - is important not to call ldconfig in the postrm or preinst - scripts in the case where the package is being upgraded (see ), as ldconfig will see the temporary names - that dpkg uses for the files while it is + Any package installing shared libraries in one of the default + library directories of the dynamic linker (which are currently + /usr/lib and /lib) or a directory that is + listed in /etc/ld.so.conf + +

+ These are currently + +

/usr/X11R6/lib/Xaw3d

+

/usr/local/lib

+

/usr/lib/libc5-compat

+

/lib/libc5-compat

+

/usr/X11R6/lib

+ +

+ + must call ldconfig in its postinst + script if and only if the first argument is configure + and should call it in the postrm script if the + first argument is remove. +

+ +

+ However, postrm and preinst scripts + must not call ldconfig in the case where + the package is being upgraded (see for + details), as ldconfig will see the temporary + names that dpkg uses for the files while it is installing them and will make the shared library links point to them, just before dpkg continues the - installation and removes the links! + installation and renames the temporary files!

- The shlibs File Format - + + Handling shared library dependencies - the + shlibs system + +

+ If a package contains a binary or library which links to a + shared library, we must ensure that when the package is + installed on the system, all of the libraries needed are + also installed. This requirement led to the creation of the + shlibs system, which is very simple in its design: + any package which provides a shared library also + provides information on the package dependencies required to + ensure the presence of this library, and any package which + uses a shared library uses this information to + determine the dependencies it requires. The files which + contain the mapping from shared libraries to the necessary + dependency information are called shlibs files. +

+ +

+ Thus, when a package is built which contains any shared + libraries, it must provide a shlibs file for other + packages to use, and when a package is built which contains + any shared libraries or compiled binaries, it must run + dpkg-shlibdeps on these to determine the + libraries used and hence the dependencies needed by this + package. + +

+ In the past, the shared libraries linked to were + determined by calling ldd, but now + objdump to do this. The only change this + makes to package building is that + dpkg-shlibdeps must also be run on shared + libraries, whereas in the past this was unnecessary. + The rest of this footnote explains the advantage that + this method gives. +

-

- This file is for use by dpkg-shlibdeps and is - required when your package provides shared libraries. -

+

+ We say that a binary foo directly uses + a library libbar if it is explicitly linked + with that library (that is, it uses the flag + -lbar during the linking stage). Other + libraries that are needed by libbar are linked + indirectly to foo, and the dynamic + linker will load them automatically when it loads + libbar. A package should needs to depend on + the libraries it directly uses, and the dependencies for + those libraries should automatically pull in the other + libraries. +

-

- Each line is of the form: - - library-name version-or-soname dependencies ... - -

+

+ Unfortunately, the ldd program shows both + the directly and indirectly used libraries, meaning that + the dependencies determined included both direct and + indirect dependencies. The use of objdump + avoids this problem by determining only the directly + used libraries. +

-

- library-name is the name of the shared library, - for example libc5. +

+ A good example of where this helps is the following. We + could update libimlib with a new version that + supports a new graphics format called dgf (but retaining + the same major version number). If we used the old + ldd method, every package that uses + libimlib would need to be recompiled so it + would also depend on libdgf or it wouldn't run + due to missing symbols. However with the new system, + packages using libimlib can rely on + libimlib itself having the dependency on + libdgf and so they would not need rebuilding. +

+

- version-or-soname is the soname of the library - - i.e., the thing that must exactly match for the library to be - recognized by ld.so. Usually this is the major - version number of the library. + In the following sections, we will first describe where the + various shlibs files are to be found, then how to + use dpkg-shlibdeps, and finally the + shlibs file format and how to create them if your + package contains a shared library.

+
-

- dependencies has the same syntax as a dependency - field in a binary package control file. It should give - details of which package(s) are required to satisfy a binary - built against the version of the library contained in the - package. See . -

+ The shlibs files present on the system +

- For example, if the package foo contains - libfoo.so.1.2.3, where the soname of the library is - libfoo.so.1, and the first version of the package - which contained a minor number of at least 2.3 was - 1.2.3-1, then the package's shlibs - could say: - - libfoo 1 foo (>= 1.2.3-1) - + There are several places where shlibs files are + found. The following list gives them in the order in which + they are read by dpkg-shlibdeps. (The first + one which gives the required information is used.)

- The version-specific dependency is to avoid warnings from - ld.so about using older shared libraries with - newer binaries.

-
- - Further Technical information on - shlibs - - What are the shlibs files? - - -

- The debian/shlibs file provides a way of checking - for shared library dependencies on packaged binaries. - They are intended to be used by package maintainers to - make their lives easier. -

- -

- Other shlibs files that exist on a Debian system are - -

/etc/dpkg/shlibs.default

-

/etc/dpkg/shlibs.override

-

/var/lib/dpkg/info/*.shlibs

-

debian/shlibs.local

- - These files are used by dpkg-shlibdeps when - creating a binary package.

-
- - How does dpkg-shlibdeps - work? - -

- dpkg-shlibdeps - determines the shared libraries directly - + + debian/shlibs.local +

- It used to do this by calling ldd, but it - now calls objdump to do this. This - requires a couple of changes in the way that packages - are built. + This lists overrides for this package. Its use is + described below (see ).

+ + + /etc/dpkg/shlibs.override +

- A binary foo directly uses a library - libbar if it is linked with that - library. Other libraries that are needed by - libbar are linked indirectly to foo, - and the dynamic linker will load them automatically - when it loads libbar. Runningldd - lists all of the libraries used, both directly and - indirectly; but objdump only lists the - directly linked libraries. A package only needs to - depend on the libraries it is directly linked to, - since the dependencies for those libraries should - automatically pull in the other libraries. + This lists global overrides. This list is normally + empty. It is maintained by the local system + administrator.

+
+ + DEBIAN/shlibs files in the `build directory' +

- This change does mean a change in the way packages are - build though: currently dpkg-shlibdeps is - only run on binaries. But since we will now rely on the - libraries depending on the libraries they themselves - need, the packages containing those libraries will - need to run dpkg-shlibdeps on the - libraries. + When packages are being built, any + debian/shlibs files are copied into the + control file area of the temporary build directory and + given the name shlibs. These files give + details of any shared libraries included in the + package. + +

+ An example may help here. Let us say that the + source package foo generates two binary + packages, libfoo2 and + foo-runtime. When building the binary + packages, the two packages are created in the + directories debian/libfoo2 and + debian/foo-runtime respectively. + (debian/tmp could be used instead of one + of these.) Since libfoo2 provides the + libfoo shared library, it will require a + shlibs file, which will be installed in + debian/libfoo2/DEBIAN/shlibs, eventually + to become + /var/lib/dpkg/info/libfoo2.shlibs. Then + when dpkg-shlibdeps is run on the + executable + debian/foo-runtime/usr/bin/foo-prog, it + will examine the + debian/libfoo2/DEBIAN/shlibs file to + determine whether foo-prog's library + dependencies are satisfied by any of the libraries + provided by libfoo2. For this reason, + dpkg-shlibdeps must only be run once + all of the individual binary packages' + shlibs files have been installed into the + build directory. +

+

+
+ + /var/lib/dpkg/info/*.shlibs +

- A good example where this would help us is the current - mess with multiple version of the mesa - library. With the ldd-based system, every - package that uses mesa needs to add a - dependency on svgalib|svgalib-dummy in order - to handle the glide mesa variant. With an - objdump-based system this isn't necessary - anymore and would have saved everyone a lot of work. + These are the shlibs files corresponding to + all of the packages installed on the system, and are + maintained by the relevant package maintainers.

+
+ + /etc/dpkg/shlibs.default +

- Another example: we could update libimlib - with a new version that supports a new graphics format - called dgf. If we use the old ldd method, - every package that uses libimlib would need - to be recompiled so it would also depend on - libdgf or it wouldn't run due to missing - symbols. However with the new system, packages using - libimlib can rely on libimlib itself - having the dependency on libdgf and wouldn't - need to be updated. + This file lists any shared libraries whose packages + have failed to provide correct shlibs files. + It was used when the shlibs setup was first + introduced, but it is now normally empty. It is + maintained by the dpkg maintainer.

- - used by the compiled binaries and libraries passed through - on its command line. -

+
+ +

+
-

- For each shared library linked to, - dpkg-shlibdeps needs to know - -

the package containing the library, and

-

the library version number,

- - and it scans the following files in this order: - -

debian/shlibs.local

-

/etc/dpkg/shlibs.override

-

/var/lib/dpkg/info/*.shlibs

-

/etc/dpkg/shlibs.default

-
-

-
+ + How to use dpkg-shlibdeps and the + shlibs files - Who maintains the various - shlibs files? - +

+ Put a call to dpkg-shlibdeps into your + debian/rules file. If your package contains only + compiled binaries and libraries (but no scripts), you can + use a command such as: + +dpkg-shlibdeps debian/tmp/usr/bin/* debian/tmp/usr/sbin/* \ + debian/tmp/usr/lib/* + + Otherwise, you will need to explicitly list the compiled + binaries and libraries. + +

+ If you are using debhelper, the + dh_shlibdeps program will do this work for + you. It will also correctly handle multi-binary + packages. +

+ +

-

- - -

/etc/dpkg/shlibs.default - the maintainer - of dpkg

- - -

- /var/lib/dpkg/info/package.shlibs - - the maintainer of each package

-
- -

- /etc/dpkg/shlibs.override - the local - system administrator

-
- -

debian/shlibs.local - the maintainer of - the package -

-
- - The shlibs.default file is managed by - dpkg. The entries in shlibs.default - that are provided by dpkg are just there to - fix things until the shared library packages all have - shlibs files. -

-
+

+ This command puts the dependency information into the + debian/substvars file, which is then used by + dpkg-gencontrol. You will need to place a + ${shlib:Depends} variable in the Depends + field in the control file for this to work. +

- How to use dpkg-shlibdeps and - the shlibs files - +

+ If dpkg-shlibdeps doesn't complain, you're + done. If it does complain you might need to create your own + debian/shlibs.local file, as explained below (see + ). +

+ +

+ If you have multiple binary packages, you will need to call + dpkg-shlibdeps on each one which contains + compiled libraries or binaries. In such a case, you will + need to use the -T option to the dpkg + utilities to specify a different substvars file. + For more details on this and other options, see . +

+
+ + The shlibs File Format + + +

+ Each shlibs file has the same format. Lines + beginning with # are considered to be commments and + are ignored. Each line is of the form: + +library-name soname-version-number dependencies ... + +

+ +

+ We will explain this by reference to the example of the + zlib1g package, which (at the time of writing) + installs the shared library /usr/lib/libz.so.1.1.3. +

- If your package doesn't provide a shared - library - +

+ library-name is the name of the shared library, + in this case libz. (This must match the name part + of the soname, see below.) +

+

+ soname-version-number is the version part of the + soname of the library. The soname is the thing that must + exactly match for the library to be recognized by the + dynamic linker, and is usually of the form + name.so.major-version, in our + example, libz.so.1. +

- Put a call to dpkg-shlibdeps into your - debian/rules file. If your package contains - only binaries (e.g. no scripts) use: + This can be determined using the command - dpkg-shlibdeps debian/tmp/usr/bin/* debian/tmp/usr/sbin/* +objdump -p /usr/lib/libz.so.1.1.3 | grep SONAME - If dpkg-shlibdeps doesn't complain, you're - done. If it does complain you might need to create your - own debian/shlibs.local file.

-
+

+ + The version part is the part which comes after + .so., so in our case, it is 1. +

+ +

+ dependencies has the same syntax as a dependency + field in a binary package control file. It should give + details of which packages are required to satisfy a binary + built against the version of the library contained in the + package. See for details. +

+ +

+ In our example, if the first version of the zlib1g + package which contained a minor number of at least + 1.3 was 1:1.1.3-1, then the + shlibs entry for this library could say: + +libz 1 zlib1g (>= 1:1.1.3) + + The version-specific dependency is to avoid warnings from + the dynamic linker about using older shared libraries with + newer binaries. +

+
- If your package provides a shared library - + + Providing a shlibs file +

+ If your package provides a shared library, you should create + a shlibs file following the format described above. + It is usual to call this file debian/shlibs (but if + you have multiple binary packages, you might want to call it + debian/shlibs.package instead). Then + let debian/rules install it in the control area: + +install -m644 debian/shlibs debian/tmp/DEBIAN + + or, in the case of a multi-binary package: + +install -m644 debian/shlibs.package debian/package/DEBIAN/shlibs + + An alternative way of doing this is to create the + shlibs file in the control area directly from + debian/rules without using a debian/shlibs + file at all, +

- Create a debian/shlibs file and let - debian/rules install it in the control area: - - install -m644 debian/shlibs debian/tmp/DEBIAN - - If your package contains additional binaries see above. + This is what dh_makeshlibs in the + debhelper suite does.

-
-
+ + since the debian/shlibs file itself is ignored by + dpkg-shlibdeps. +

- How to write - debian/shlibs.local - +

+ As dpkg-shlibdeps reads the + DEBIAN/shlibs files in all of the binary packages + being built from this source package, all of the + DEBIAN/shlibs files should be installed before + dpkg-shlibdeps is called on any of the binary + packages. +

+
-

- This file is intended only as a temporary fix if - your binaries depend on a library which doesn't provide - its own /var/lib/dpkg/info/*.shlibs file yet. -

+ + Writing the debian/shlibs.local file -

- Let's assume you are packaging a binary foo. Your - output in building the package might look like this. - - $ ldd foo - libbar.so.1 => /usr/X11R6/lib/libbar.so.1.0 (0x4001e000) - libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x4002c000) - libc.so.6 => /lib/libc.so.6 (0x40114000) - /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) - - And when you ran dpkg-shlibdeps - - $ dpkg-shlibdeps -O foo - dpkg-shlibdeps: warning: unable to find dependency information for shared library libbar - (soname 1, path /usr/X11R6/lib/libbar.so.1.0, dependency field Depends) - shlibs:Depends=libc6 (>= 2.2.1), xlibs (>= 4.0.1-11) - - The foo binary depends on the - libbar shared library, but no package seems - to provide a *.shlibs file in - /var/lib/dpkg/info/. Let's determine the package - responsible: -

+

+ This file is intended only as a temporary fix if + your binaries or libraries depend on a library whose package + does not yet provide a correct shlibs file. +

-

- - $ dpkg -S /usr/X11R6/lib/libbar.so.1.0 - bar1: /usr/X11R6/lib/libbar.so.1.0 - $ dpkg -s bar1 | grep Version - Version: 1.0-1 - - This tells us that the bar1 package, version - 1.0-1 is the one we are using. Now we can create our own - debian/shlibs.local to temporarily fix the above - problem. Include the following line into your - debian/shlibs.local file. - - libbar 1 bar1 (>= 1.0-1) - - Now your package build should work. As soon as the - maintainer of libbar1 provides a - shlibs file, you can remove your - debian/shlibs.local file. -

- +

+ We will assume that you are trying to package a binary + foo. When you try running + dpkg-shlibdeps you get the following error + message (-O displays the dependency information on + stdout instead of writing it to + debian/substvars, and the lines have been wrapped + for ease of reading): + +$ dpkg-shlibdeps -O debian/tmp/usr/bin/foo +dpkg-shlibdeps: warning: unable to find dependency + information for shared library libbar (soname 1, + path /usr/lib/libbar.so.1, dependency field Depends) +shlibs:Depends=libc6 (>= 2.2.2-2) + + You can then run ldd on the binary to find the + full location of the library concerned: + +$ ldd foo +libbar.so.1 => /usr/lib/libbar.so.1 (0x4001e000) +libc.so.6 => /lib/libc.so.6 (0x40032000) +/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) + + So the foo binary depends on the + libbar shared library, but no package seems to + provide a *.shlibs file handling + libbar.so.1 in /var/lib/dpkg/info/. Let's + determine the package responsible: + +$ dpkg -S /usr/lib/libbar.so.1 +bar1: /usr/lib/libbar.so.1 +$ dpkg -s bar1 | grep Version +Version: 1.0-1 + + This tells us that the bar1 package, version 1.0-1, + is the one we are using. Now we can file a bug against the + bar1 package and create our own + debian/shlibs.local to locally fix the problem. + Including the following line into your + debian/shlibs.local file: + +libbar 1 bar1 (>= 1.0-1) + + should allow the package build to work. +

+ +

+ As soon as the maintainer of bar1 provides a + correct shlibs file, you should remove this line + from your debian/shlibs.local file. (You should + probably also then have a versioned Build-Depends + on bar1 to help ensure that others do not have the + same problem building your package.) +

The Operating System - File system hierarchy @@ -4026,12 +4203,12 @@

For example, the emacs package will contain - mkdir -p /usr/local/lib/emacs/site-lisp || true +mkdir -p /usr/local/lib/emacs/site-lisp || true in the postinst script, and - rmdir /usr/local/lib/emacs/site-lisp || true - rmdir /usr/local/lib/emacs || true +rmdir /usr/local/lib/emacs/site-lisp || true +rmdir /usr/local/lib/emacs || true in the prerm script.

@@ -4265,8 +4442,8 @@ bind would have a lower number than the script that starts inn so that it runs first: - /etc/rc2.d/S17bind - /etc/rc2.d/S70inn +/etc/rc2.d/S17bind +/etc/rc2.d/S70inn

@@ -4335,7 +4512,7 @@ should include a test statement at the top of the script, like this: - test -f program-executed-later-in-script || exit 0 +test -f program-executed-later-in-script || exit 0

@@ -4403,13 +4580,13 @@ To get the default behavior for your package, put in your postinst script - update-rc.d package defaults >/dev/null +update-rc.d package defaults >/dev/null and in your postrm - if [ purge = "$1" ]; then - update-rc.d package remove >/dev/null - fi +if [ purge = "$1" ]; then + update-rc.d package remove >/dev/null +fi

@@ -4484,54 +4661,54 @@

- #!/bin/sh - # - # Original version by Robert Leslie - # <rob@mars.org>, edited by iwj and cs - - test -x /usr/sbin/named || exit 0 - - # Source defaults file. - PARAMS='' - if [ -f /etc/default/bind ]; then - . /etc/default/bind - fi - - - case "$1" in - start) - echo -n "Starting domain name service: named" - start-stop-daemon --start --quiet --exec /usr/sbin/named \ - -- $PARAMS - echo "." - ;; - stop) - echo -n "Stopping domain name service: named" - start-stop-daemon --stop --quiet \ - --pidfile /var/run/named.pid --exec /usr/sbin/named - echo "." - ;; - restart) - echo -n "Restarting domain name service: named" - start-stop-daemon --stop --quiet \ - --pidfile /var/run/named.pid --exec /usr/sbin/named - start-stop-daemon --start --verbose --exec /usr/sbin/named \ - -- $PARAMS - echo "." - ;; - force-reload|reload) - echo -n "Reloading configuration of domain name service: named" - start-stop-daemon --stop --signal 1 --quiet \ - --pidfile /var/run/named.pid --exec /usr/sbin/named - echo "." - ;; - *) - echo "Usage: /etc/init.d/bind {start|stop|restart|reload|force-reload}" >&2 - exit 1 - ;; - esac - - exit 0 +#!/bin/sh +# +# Original version by Robert Leslie +# <rob@mars.org>, edited by iwj and cs + +test -x /usr/sbin/named || exit 0 + +# Source defaults file. +PARAMS='' +if [ -f /etc/default/bind ]; then + . /etc/default/bind +fi + + +case "$1" in +start) + echo -n "Starting domain name service: named" + start-stop-daemon --start --quiet --exec /usr/sbin/named \ + -- $PARAMS + echo "." + ;; +stop) + echo -n "Stopping domain name service: named" + start-stop-daemon --stop --quiet \ + --pidfile /var/run/named.pid --exec /usr/sbin/named + echo "." + ;; +restart) + echo -n "Restarting domain name service: named" + start-stop-daemon --stop --quiet \ + --pidfile /var/run/named.pid --exec /usr/sbin/named + start-stop-daemon --start --verbose --exec /usr/sbin/named \ + -- $PARAMS + echo "." + ;; +force-reload|reload) + echo -n "Reloading configuration of domain name service: named" + start-stop-daemon --stop --signal 1 --quiet \ + --pidfile /var/run/named.pid --exec /usr/sbin/named + echo "." + ;; +*) + echo "Usage: /etc/init.d/bind {start|stop|restart|reload|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0

@@ -4542,9 +4719,9 @@

- # Specified parameters to pass to named. See named(8). - # You may uncomment the following line, and edit to taste. - #PARAMS="-u nobody" +# Specified parameters to pass to named. See named(8). +# You may uncomment the following line, and edit to taste. +#PARAMS="-u nobody"

@@ -4558,14 +4735,14 @@ and having named running in all runlevels, it can say in its postinst: - update-rc.d bind defaults >/dev/null +update-rc.d bind defaults >/dev/null And in its postrm, to remove the links when the package is purged: - if [ purge = "$1" ]; then - update-rc.d bind remove >/dev/null - fi +if [ purge = "$1" ]; then + update-rc.d bind remove >/dev/null +fi

@@ -4582,9 +4759,9 @@ via cron, it should place a file with the name of the package in one of the following directories: - /etc/cron.daily - /etc/cron.weekly - /etc/cron.monthly +/etc/cron.daily +/etc/cron.weekly +/etc/cron.monthly As these directory names imply, the files within them are executed on a daily, weekly, or monthly basis, @@ -4600,7 +4777,7 @@

If a certain job has to be executed more frequently than daily, the package should install a file - /etc/cron.d/package-name. This file uses + /etc/cron.d/package. This file uses the same syntax as /etc/crontab and is processed by cron automatically. The file must also be treated as a configuration file. (Note, that entries in the @@ -4662,13 +4839,16 @@ mention ``him'' directly. For example, if you think of saying - I'm starting network daemons: nfsd mountd. +I'm starting network daemons: nfsd mountd. just say - Starting network daemons: nfsd mountd. -

-

+Starting network daemons: nfsd mountd. + +

+ + +

The following formats should be used

@@ -4683,7 +4863,7 @@ daemons. The output should look like this (a single line, no leading spaces): - Starting <description>: <daemon-1> <daemon-2> <...> <daemon-n>. +Starting <description>: <daemon-1> <daemon-2> <...> <daemon-n>. The <description> should describe the subsystem the daemon or set of daemons are part of, while @@ -4694,24 +4874,24 @@

For example, the output of /etc/init.d/lpd would look like: - Starting printer spooler: lpd. +Starting printer spooler: lpd.

This can be achieved by saying - echo -n "Starting printer spooler: lpd" - start-stop-daemon --start --quiet lpd - echo "." +echo -n "Starting printer spooler: lpd" +start-stop-daemon --start --quiet lpd +echo "." in the script. If you have more than one daemon to start, you should do the following: - echo -n "Starting remote file system services:" - echo -n " nfsd"; start-stop-daemon --start --quiet nfsd - echo -n " mountd"; start-stop-daemon --start --quiet mountd - echo -n " ugidd"; start-stop-daemon --start --quiet ugidd - echo "." +echo -n "Starting remote file system services:" +echo -n " nfsd"; start-stop-daemon --start --quiet nfsd +echo -n " mountd"; start-stop-daemon --start --quiet mountd +echo -n " ugidd"; start-stop-daemon --start --quiet ugidd +echo "." This makes it possible for the user to see what takes so long and when the final daemon has been @@ -4719,8 +4899,9 @@ example above the system administrator can easily comment out a line if he don't wants to start a specific daemon, while the displayed message still - looks good.

- + looks good. +

+

when something needs to be configured.

@@ -4729,18 +4910,22 @@ If you have to set up different parameters of the system upon boot up, you should use this format: - Setting <parameter> to `<value>'. -

+Setting <parameter> to `<value>'. + +

You can use the following echo statement to get the quotes right: - echo "Setting DNS domainname to \`"value"'." -

+echo "Setting DNS domainname to \`"value"'." + +

Note that the left quotation mark (`) is different - from the right (').

+ from the right ('). +

+

when a daemon is stopped.

@@ -4753,7 +4938,7 @@

So stopping the printer daemon will like like this: - Stopping printer spooler: lpd. +Stopping printer spooler: lpd.

@@ -4766,17 +4951,19 @@ via `netdate' or killing all processes when the system comes down. Your message should like this: - Doing something very useful...done. +Doing something very useful...done. You should print the `done.' right after the job has been completed, so that the user gets informed why he has to wait. You can get this behavior by saying - echo -n "Doing something very useful..." - do_something - echo "done." +echo -n "Doing something very useful..." +do_something +echo "done." - in your script.

+ in your script. +

+

when the configuration is reloaded.

@@ -4785,8 +4972,10 @@ When a daemon is forced to reload its configuration files you should use the following format: - Reloading <daemon's-name> configuration...done. -

+Reloading <daemon's-name> configuration...done. + +

+

when none of the above rules apply.

@@ -4795,9 +4984,12 @@ If you have to print a message that doesn't fit into the styles described above, you can use something appropriate, but please have a look at the overall - rules listed above.

-

- + rules listed above. +

+ + +

+ Menus @@ -5010,10 +5202,10 @@ Here is an example of a wrapper script for this purpose: - #!/bin/sh - BAR=${BAR:-/var/lib/fubar} - export BAR - exec /usr/lib/foo/foo "$@" +#!/bin/sh +BAR=${BAR:-/var/lib/fubar} +export BAR +exec /usr/lib/foo/foo "$@"

@@ -5045,10 +5237,10 @@

Generally the following compilation parameters should be used: - CC = gcc - CFLAGS = -O2 -Wall # sane warning options vary between programs - LDFLAGS = # none - install -s # (or use strip on the files in debian/tmp) +CC = gcc +CFLAGS = -O2 -Wall # sane warning options vary between programs +LDFLAGS = # none +install -s # (or use strip on the files in debian/tmp)

@@ -5116,19 +5308,19 @@ - CFLAGS = -O2 -Wall - INSTALL = install - INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 - INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 - INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755 - INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755 - - ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) - CFLAGS += -g - endif - ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) - INSTALL_PROGRAM += -s - endif +CFLAGS = -O2 -Wall +INSTALL = install +INSTALL_FILE = $(INSTALL) -p -o root -g root -m 644 +INSTALL_PROGRAM = $(INSTALL) -p -o root -g root -m 755 +INSTALL_SCRIPT = $(INSTALL) -p -o root -g root -m 755 +INSTALL_DIR = $(INSTALL) -p -d -o root -g root -m 755 + +ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS))) +CFLAGS += -g +endif +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +INSTALL_PROGRAM += -s +endif Please note that the above example is merely informative, @@ -5169,7 +5361,7 @@ Note that all installed shared libraries should be stripped with - strip --strip-unneeded <your-lib> +strip --strip-unneeded <your-lib> (The option `--strip-unneeded' makes strip remove only the symbols which aren't needed for relocation @@ -5418,10 +5610,10 @@ For example, in your Makefile or debian/rules, do things like: - ln -fs gcc $(prefix)/bin/cc - ln -fs gcc debian/tmp/usr/bin/cc - ln -fs ../sbin/sendmail $(prefix)/bin/runq - ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq +ln -fs gcc $(prefix)/bin/cc +ln -fs gcc debian/tmp/usr/bin/cc +ln -fs ../sbin/sendmail $(prefix)/bin/runq +ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq

@@ -5746,14 +5938,14 @@ file (for more information see ): - /var/log/foo/* { - rotate 12 - weekly - compress - postrotate - /etc/init.d/foo force-reload - endscript - } +/var/log/foo/* { +rotate 12 +weekly +compress +postrotate +/etc/init.d/foo force-reload +endscript +} Which rotates all files under `/var/log/foo', saves 12 compressed generations, and sends a HUP signal at the end of @@ -5878,7 +6070,7 @@ If a program needs to specify an architecture specification string in some place, the following format should be used: - <arch>-<os> +<arch>-<os> where `<arch>' is one of the following: i386, alpha, arm, m68k, powerpc, sparc and `<os>' is one of: linux, gnu. Use @@ -6017,13 +6209,14 @@

Cgi-bin executable files are installed in the directory - /usr/lib/cgi-bin/<cgi-bin-name> +/usr/lib/cgi-bin/<cgi-bin-name> and should be referred to as - http://localhost/cgi-bin/<cgi-bin-name> -

- +http://localhost/cgi-bin/<cgi-bin-name> + +

+

Access to html documents

@@ -6035,9 +6228,10 @@ backward compatibility, see and can be referred to as - http://localhost/doc/<package>/<filename> -

- +http://localhost/doc/<package>/<filename> + +

+

Web Document Root

@@ -6048,7 +6242,7 @@ register the Web Application via the menu package. If access to the web-root is unavoidable then use - /var/www +/var/www as the Document Root. This might be just a symbolic link to the location where the sysadmin has @@ -6155,15 +6349,16 @@ name will not just be used by that package. For example, in this situation the INN package says: - Please enter the `mail name' of your system. This is the - hostname portion of the address to be shown on outgoing - news and mail messages. The default is - syshostname, your system's host name. Mail - name [`syshostname']: +Please enter the `mail name' of your system. This is the +hostname portion of the address to be shown on outgoing +news and mail messages. The default is +syshostname, your system's host name. Mail +name [`syshostname']: where syshostname is the output of hostname - --fqdn.

- + --fqdn. +

+ News system configuration @@ -6280,7 +6475,7 @@ BDF fonts should be converted to PCF fonts with the bdftopcf utility (available in the - xutils package, gzipped, and + xutils package), gzipped, and placed in a directory that corresponds to their resolution: @@ -6577,8 +6772,8 @@ may be provided. This symbolic link can be created from debian/rules like this: - ln -s ../man7/undocumented.7.gz \ - debian/tmp/usr/share/man/man[1-9]/the_requested_manpage.[1-9].gz +ln -s ../man7/undocumented.7.gz \ +debian/tmp/usr/share/man/man[1-9]/the_requested_manpage.[1-9].gz This manpage claims that the lack of a manpage has been reported as a bug, so you may only do this if it really has @@ -6623,8 +6818,8 @@ dir file, in its post-installation script: - install-info --quiet --section Development Development \ - /usr/share/info/foobar.info +install-info --quiet --section Development Development \ +/usr/share/info/foobar.info

@@ -6641,7 +6836,7 @@

You should remove the entries in the pre-removal script: - install-info --quiet --remove /usr/share/info/foobar.info +install-info --quiet --remove /usr/share/info/foobar.info

@@ -6708,19 +6903,19 @@ this is to put the following in the package's postinst: - if [ "$1" = "configure" ]; then - if [ -d /usr/doc -a ! -e /usr/doc/#PACKAGE# \ - -a -d /usr/share/doc/#PACKAGE# ]; then - ln -sf ../share/doc/#PACKAGE# /usr/doc/#PACKAGE# - fi - fi +if [ "$1" = "configure" ]; then + if [ -d /usr/doc -a ! -e /usr/doc/#PACKAGE# \ + -a -d /usr/share/doc/#PACKAGE# ]; then + ln -sf ../share/doc/#PACKAGE# /usr/doc/#PACKAGE# + fi +fi And the following in the package's prerm: - if [ \( "$1" = "upgrade" -o "$1" = "remove" \) \ - -a -L /usr/doc/#PACKAGE# ]; then - rm -f /usr/doc/#PACKAGE# - fi +if [ \( "$1" = "upgrade" -o "$1" = "remove" \) \ + -a -L /usr/doc/#PACKAGE# ]; then + rm -f /usr/doc/#PACKAGE# +fi

@@ -6757,7 +6952,7 @@

Every package must be accompanied by a verbatim copy of its copyright and distribution license in the file - /usr/share/doc/<package-name>/copyright. This file must + /usr/share/doc/<package>/copyright. This file must neither be compressed nor be a symbolic link.

@@ -6775,7 +6970,7 @@

- /usr/share/doc/<package-name> may be a symbolic link to a + /usr/share/doc/<package> may be a symbolic link to a directory in /usr/share/doc only if two packages both come from the same source and the first package has a "Depends" relationship on the second. These rules are important