X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=policy.sgml;h=83d42a9f38b15210852ace0932ec427480d4dc3f;hb=ba95502cd0565d860bf41a70e5dddacd93d4dad4;hp=dc4553cfd04d0af89d238c44e93e950ae6c0f710;hpb=89ad8aaab13906a24d1482fc54154bb2b3f7f1e3;p=debian%2Fdebian-policy.git diff --git a/policy.sgml b/policy.sgml index dc4553c..83d42a9 100644 --- a/policy.sgml +++ b/policy.sgml @@ -878,36 +878,30 @@

In general, Debian packages should use the same version - numbers as the upstream sources. -

- -

- However, in some cases where the upstream version number is - based on a date (e.g., a development "snapshot" release) the - package management system cannot handle these version - numbers without epochs. For example, dpkg will consider - "96May01" to be greater than "96Dec24". + numbers as the upstream sources. However, upstream version + numbers based on some date formats (sometimes used for + development or "snapshot" releases) will not be ordered + correctly by the package management software. For + example, dpkg will consider "96May01" to be + greater than "96Dec24".

To prevent having to use epochs for every new upstream - version, the date based portion of the version number - should be changed to the following format in such cases: - "19960501", "19961224". It is up to the maintainer whether - they want to bother the upstream maintainer to change - the version numbers upstream, too. -

- -

- Note that other version formats based on dates which are - parsed correctly by the package management system should - not be changed. + version, the date-based portion of any upstream version number + should be given in a way that sorts correctly: four-digit year + first, followed by a two-digit numeric month, followed by a + two-digit numeric date, possibly with punctuation between the + components.

- Native Debian packages (i.e., packages which have been - written especially for Debian) whose version numbers include - dates should always use the "YYYYMMDD" format. + Native Debian packages (i.e., packages which have been written + especially for Debian) whose version numbers include dates + should also follow these rules. If punctuation is desired + between the date components, remember that hyphen (-) + cannot be used in native package versions. Period + (.) is normally a good choice.

@@ -1642,7 +1636,15 @@ The maintainer name and email address used in the changelog should be the details of the person uploading this version. They are not necessarily those of the - usual package maintainer. The information here will be + usual package maintainer + If the developer uploading the package is not one of the usual + maintainers of the package (as listed in the + Maintainer or + Uploaders control fields of + the package), the first line of the changelog is conventionally used + to explain why a non-maintainer is uploading the package. The + Debian Developer's Reference (see ) documents the + conventions used.. The information here will be copied to the Changed-By field in the .changes file (see ), and then later used to send an acknowledgement when the @@ -2224,16 +2226,16 @@ endif Variable substitutions: debian/substvars

- When dpkg-gencontrol, - dpkg-genchanges and dpkg-source - generate control files, they perform variable substitutions - on their output just before writing it. Variable + When dpkg-gencontrol + generates binary package control + files (DEBIAN/control), it performs variable + substitutions on its output just before writing it. Variable substitutions have the form ${variable}. The optional file debian/substvars contains variable substitutions to be used; variables can also be set directly from debian/rules using the -V - option to the source packaging commands, and certain - predefined variables are also available. + option to the source packaging commands, and certain predefined + variables are also available.

@@ -5081,7 +5083,7 @@ Replaces: mail-transport-agent

There is no Build-Depends-Arch; this role is essentially met with Build-Depends. Anyone building the - build-indep and binary-indep targets is + build-indep and binary-indep targets is assumed to be building the whole package, and therefore installation of all build dependencies is required.

@@ -5130,55 +5132,134 @@ Replaces: mail-transport-agent

- Packages involving shared libraries should be split up into - several binary packages. This section mostly deals with how - this separation is to be accomplished; rules for files within - the shared library packages are in instead. + This section deals only with public shared libraries: shared + libraries that are placed in directories searched by the dynamic + linker by default or which are intended to be linked against + normally and possibly used by other, independent packages. Shared + libraries that are internal to a particular package or that are + only loaded as dynamic modules are not covered by this section and + are not subject to its requirements.

- - Run-time shared libraries +

+ A shared library is identified by the SONAME attribute + stored in its dynamic section. When a binary is linked against a + shared library, the SONAME of the shared library is + recorded in the binary's NEEDED section so that the + dynamic linker knows that library must be loaded at runtime. The + shared library file's full name (which usually contains additional + version information not needed in the SONAME) is + therefore normally not referenced directly. Instead, the shared + library is loaded by its SONAME, which exists on the file + system as a symlink pointing to the full name of the shared + library. This symlink must be provided by the + package. describes how to do this. + + This is a convention of shared library versioning, but not a + requirement. Some libraries use the SONAME as the full + library file name instead and therefore do not need a symlink. + Most, however, encode additional information about + backwards-compatible revisions as a minor version number in the + file name. The SONAME itself only changes when + binaries linked with the earlier version of the shared library + may no longer work, but the filename may change with each + release of the library. See for + more information. + +

- The run-time shared library needs to be placed in a package - whose name changes whenever the shared object version - changes. -

- Since it is common place to install several versions of a - package that just provides shared libraries, it is a - good idea that the library package should not - contain any extraneous non-versioned files, unless they - happen to be in versioned directories.

- - The most common mechanism is to place it in a package - called - librarynamesoversion, - where soversion is the version number - in the soname of the shared library - The soname is the shared object name: it's the thing - that has to match exactly between building an executable - and running it for the dynamic linker to be able run the - program. For example, if the soname of the library is - libfoo.so.6, the library package would be - called libfoo6. - . - Alternatively, if it would be confusing to directly append - soversion to libraryname (e.g. because - libraryname itself ends in a number), you may use - libraryname-soversion and - libraryname-soversion-dev - instead. + When linking a binary or another shared library against a shared + library, the SONAME for that shared library is not yet + known. Instead, the shared library is found by looking for a file + matching the library name with .so appended. This file + exists on the file system as a symlink pointing to the shared + library. +

+ +

+ Shared libraries are normally split into several binary packages. + The SONAME symlink is installed by the runtime shared + library package, and the bare .so symlink is installed in + the development package since it's only used when linking binaries + or shared libraries. However, there are some exceptions for + unusual shared libraries or for shared libraries that are also + loaded as dynamic modules by other programs.

- If you have several shared libraries built from the same - source tree you may lump them all together into a single - shared library package, provided that you change all of - their sonames at once (so that you don't get filename - clashes if you try to install different versions of the - combined shared libraries package). + This section is primarily concerned with how the separation of + shared libraries into multiple packages should be done and how + dependencies on and between shared library binary packages are + managed in Debian. should be read in + conjunction with this section and contains additional rules for + the files contained in the shared library packages.

+ + Run-time shared libraries + +

+ The run-time shared library must be placed in a package + whose name changes whenever the SONAME of the shared + library changes. This allows several versions of the shared + library to be installed at the same time, allowing installation + of the new version of the shared library without immediately + breaking binaries that depend on the old version. Normally, the + run-time shared library and its SONAME symlink should + be placed in a package named + librarynamesoversion, + where soversion is the version number in + the SONAME of the shared library. + See for detailed information on how to + determine this version. Alternatively, if it would be confusing + to directly append soversion + to libraryname (if, for example, libraryname + itself ends in a number), you should use + libraryname-soversion + instead. +

+ +

+ If you have several shared libraries built from the same source + tree, you may lump them all together into a single shared + library package provided that all of their SONAMEs will + always change together. Be aware that this is not normally the + case, and if the SONAMEs do not change together, + upgrading such a merged shared library package will be + unnecessarily difficult because of file conflicts with the old + version of the package. When in doubt, always split shared + library packages so that each binary package installs a single + shared library. +

+ +

+ Every time the shared library ABI changes in a way that may + break binaries linked against older versions of the shared + library, the SONAME of the library and the + corresponding name for the binary package containing the runtime + shared library should change. Normally, this means + the SONAME should change any time an interface is + removed from the shared library or the signature of an interface + (the number of parameters or the types of parameters that it + takes, for example) is changed. This practice is vital to + allowing clean upgrades from older versions of the package and + clean transitions between the old ABI and new ABI without having + to upgrade every affected package simultaneously. +

+ +

+ The SONAME and binary package name need not, and indeed + normally should not, change if new interfaces are added but none + are removed or changed, since this will not break binaries + linked against the old shared library. Correct versioning of + dependencies on the newer shared library by binaries that use + the new interfaces is handled via + the shlibs + system or via symbols files (see + ). +

+

The package should install the shared libraries under their normal names. For example, the libgdbm3 @@ -5198,10 +5279,11 @@ Replaces: mail-transport-agent

- The run-time library package should include the symbolic link that - ldconfig would create for the shared libraries. - For example, the libgdbm3 package should include - a symbolic link from /usr/lib/libgdbm.so.3 to + The run-time library package should include the symbolic link for + the SONAME that ldconfig would create for + the shared libraries. For example, + the libgdbm3 package should include a symbolic + link from /usr/lib/libgdbm.so.3 to libgdbm.so.3.0.0. This is needed so that the dynamic linker (for example ld.so or ld-linux.so.*) can find the library between the @@ -5421,6 +5503,14 @@ Replaces: mail-transport-agent (ld) when compiling packages, as it will only look for libgdbm.so when compiling dynamically.

+ +

+ If the package provides Ada Library Information + (*.ali) files for use with GNAT, these files must be + installed read-only (mode 0444) so that GNAT will not attempt to + recompile them. This overrides the normal file mode requirements + given in . +

@@ -7487,7 +7577,19 @@ fname () { must be supported and must set the value of c to delta. - + + The XSI extension to kill allowing kill + -signal, where signal is either + the name of a signal or one of the numeric signals listed in + the XSI extension (0, 1, 2, 3, 6, 9, 14, and 15), must be + supported if kill is implemented as a shell + built-in. + + The XSI extension to trap allowing numeric + signals must be supported. In addition to the signal + numbers listed in the extension, which are the same as for + kill above, 13 (SIGPIPE) must be allowed. + If a shell script requires non-SUSv3 features from the shell interpreter other than those listed above, the appropriate shell @@ -7928,11 +8030,13 @@ ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq

- Log files must be rotated occasionally so that they don't - grow indefinitely; the best way to do this is to drop a log - rotation configuration file into the directory - /etc/logrotate.d and use the facilities provided by - logrotate. + Log files must be rotated occasionally so that they don't grow + indefinitely. The best way to do this is to install a log + rotation configuration file in the + directory /etc/logrotate.d, normally + named /etc/logrotate.d/package, and use + the facilities provided by logrotate. +

The traditional approach to log files has been to set up ad hoc log rotation schemes using simple shell @@ -7957,17 +8061,20 @@ ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq section="8">): /var/log/foo/*.log { -rotate 12 -weekly -compress -postrotate -/etc/init.d/foo force-reload -endscript + rotate 12 + weekly + compress + missingok + postrotate + start-stop-daemon -K -p /var/run/foo.pid -s HUP -x /usr/sbin/foo -q + endscript } This rotates all files under /var/log/foo, saves 12 - compressed generations, and forces the daemon to reload its - configuration information after the log rotation. + compressed generations, and tells the daemon to reopen its log + files after the log rotation. It skips this log rotation + (via missingok) if no such log file is present, which + avoids errors if the package is removed but not purged.

@@ -7979,7 +8086,7 @@ endscript

- + Permissions and owners

@@ -8020,6 +8127,12 @@ endscript

+

+ Control information files should be owned by root:root + and either mode 644 (for most files) or mode 755 (for + executables such as maintainer + scripts). +

Setuid and setgid executables should be mode 4755 or 2755 @@ -8306,10 +8419,14 @@ done

These two files are managed through the dpkg - "alternatives" mechanism. Thus every package providing an - editor or pager must call the - update-alternatives script to register these - programs. + "alternatives" mechanism. Every package providing an editor or + pager must call the update-alternatives script to + register as an alternative for /usr/bin/editor + or /usr/bin/pager as appropriate. The alternative + should have a slave alternative + for /usr/share/man/man1/editor.1.gz + or /usr/share/man/man1/pager.1.gz pointing to the + corresponding manual page.

@@ -8358,11 +8475,13 @@ done /usr/lib/cgi-bin/cgi-bin-name - and should be referred to as + or a subdirectory of that directory, and should be + referred to as http://localhost/cgi-bin/cgi-bin-name - + (possibly with a subdirectory name + before cgi-bin-name). @@ -8652,7 +8771,9 @@ name ["syshostname"]: virtual package x-terminal-emulator. They should also register themselves as an alternative for /usr/bin/x-terminal-emulator, with a priority of - 20. + 20. That alternative should have a slave alternative + for /usr/share/man/man1/x-terminal-emulator.1.gz + pointing to the corresponding manual page.

@@ -8729,6 +8850,9 @@ name ["syshostname"]: configuration, add 10 points; otherwise add none. + That alternative should have a slave alternative + for /usr/share/man/man1/x-window-manager.1.gz + pointing to the corresponding manual page.