policy.text 61 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330
  1. Debian policy manual
  2. --------------------
  3. Ian Jackson <ijackson@gnu.ai.mit.edu>
  4. version 0.2.0.0 (dpkg 1.3.7), 22 August 1996
  5. 0.1 Abstract
  6. ------------
  7. This manual describes the policy requirements which must be satisfied
  8. for a package to be included in the Debian distribution. This includes
  9. details of the permissions and ownerships of files in packages and
  10. other technical requirements as well as information like the upload
  11. procedure.
  12. 0.2 Contents
  13. ------------
  14. 1. Introduction and scope of this manual
  15. 2. Package copyright
  16. 3. Contents of the binary package
  17. 3.1. Control file requirements
  18. 3.2. Locations of files
  19. 3.3. Permissions and ownerships
  20. 3.4. Configuration files
  21. 3.5. Maintainer scripts
  22. 3.6. Scripts in general
  23. 3.7. Compilation options
  24. 3.8. Shared library packages
  25. 3.9. Application configuration files, dotfiles and `/etc/skel'
  26. 3.10. Mail processing on Debian systems
  27. 3.11. Packages which can use the X shared libraries
  28. 3.12. Games
  29. 3.13. Allocating package-specific users and groups
  30. 4. Source package
  31. 4.1. Releases of packages by other than the usual Debian
  32. maintainer
  33. 4.2. Standards conformance and `Standards-Version'
  34. 4.3. Documentation and the `changelog'
  35. 4.4. Changes to the upstream sources
  36. 4.5. Error trapping in makefiles
  37. 5. How to become a Debian developer
  38. 5.1. Before you start work
  39. 5.2. When you have a package to upload
  40. 5.3. Upload handling - `.changes' files
  41. 6. The Debian mailing lists
  42. 7. Conversion procedure from old source packages
  43. 0.3. Copyright Notice
  44. -------------------------------------------------------------------------------
  45. 1. Introduction and scope of this manual
  46. ----------------------------------------
  47. This manual describes the criteria that a Debian-format package must
  48. satisfy to be included in the Debian distribution.
  49. Much of this information will be useful even when building a package
  50. which is to be distributed in some other way or is for local use.
  51. This manual does *not* describe the technical mechanisms involved in
  52. package creation, installation and removal. This information can be
  53. found in the dpkg programmers' manual and the dpkg system
  54. administrators' manual.
  55. This document assumes familiarity with these other two manuals.
  56. The Debian version of the FSF's GNU hello program is provided as an
  57. example for people wishing to create Debian packages.
  58. *Note that this document is still a draft!*
  59. -------------------------------------------------------------------------------
  60. 2. Package copyright
  61. --------------------
  62. Please study the copyright of your submission *carefully* and
  63. understand it before proceeding. If you have doubts or questions,
  64. please ask.
  65. The aims of the policy detailed below are:
  66. * That any user be able to rebuild any package in the official
  67. Debian distribution from the original source plus our patches.
  68. * That we make available in our packaging formats as much software
  69. as we can.
  70. * That it be easy for people to make CDROMs of our distribution
  71. without violating copyrights.
  72. All packages in the Debian distribution proper must be freely useable,
  73. modifiable and redistributable in both source and binary form. It must
  74. be possible for anyone to distribute and use modified source code and
  75. their own own compiled binaries, at least when they do so as part of a
  76. Debian distribution.
  77. Packages whose copyright permission notices (or patent problems) do
  78. not allow distribution and copying for profit, without restriction on
  79. the amount charged, or where distribution is restricted according to
  80. the medium used, or where the distributor must ask any kind of special
  81. permission of the authors, or with other onerous conditions, may only
  82. be placed in the semi-supported non-free section of the Debian FTP
  83. archives. This is important so that CDROM manufacturers can distribute
  84. Debian without having to check the copyright of each package
  85. individually, simply by leaving out the contents of the non-free area;
  86. CDROM distributors are encouraged, though, to check the copyrights on
  87. programs in non-free individually and include as many as they can.
  88. Packages whose copyright permission notices (or patent problems) allow
  89. only distribution of compiled binaries (and thus of which only
  90. binaries are available), or where the source code which may be
  91. distributed is not the complete source code required to compile the
  92. program (ie, the program cannot be compiled using only packages in the
  93. main Debian distribution), or which depend for their use on non-free
  94. or contrib packages, or allow free use only for a trial period
  95. (shareware), or are demonstration programs lacking vital functionality
  96. (crippleware), or are only installer-packages which require the user
  97. to supply a separate file to be installed, or which fail to meet some
  98. other policy requirements, may only be placed in the semi-supported
  99. contrib section of the Debian FTP archives (unless they need to be in
  100. non-free - see above).
  101. Programs whose authors encourage the user to make donations are fine
  102. for the main distribution, provided that the authors do not claim that
  103. not donating is immoral, unethical, illegal or something similar;
  104. otherwise they must go in contrib (or non-free, if even distribution
  105. is restricted by such statements).
  106. Packages whose copyright permission notices (or patent problems) do
  107. not allow redistribution even of only binaries, and where no special
  108. permission has been obtained, cannot placed on the Debian FTP site and
  109. its mirrors at all.
  110. Note that under international copyright law[1] *no* distribution or
  111. modification of a work is allowed without an explicit notice saying
  112. so. Therefore a program without a copyright notice *is* copyrighted
  113. and you may not do anything to it without risking being sued! Likewise
  114. if a program has a copyright notice but no statement saying what is
  115. permitted then nothing is permitted.
  116. [1] This applies in the United States, too.
  117. Many authors are unaware of the problems that restrictive copyrights
  118. (or lack of copyright notices) can cause for the users of their
  119. supposedly-free software. It is often worthwhile contacting such
  120. authors diplomatically to ask them to modify their terms generally, or
  121. specially for Debian. However, this is a politically difficult thing
  122. to do and you should ask for advice on debian-devel first.
  123. When in doubt, send mail to <debian-devel@lists.debian.org>. Be
  124. prepared to provide us with the copyright statement. Software covered
  125. by the GPL, public domain software and BSD-like copyrights are safe;
  126. be wary of the phrases `commercial use prohibited' and `distribution
  127. restricted'.
  128. Every package submission *must* be accompanied by verbatim copy of its
  129. copyright (with the exceptions of public domain packages and those
  130. covered by the UCB BSD licence or the GNU GPL or LGPL; in these cases
  131. simply indicate which is appropriate). This information must be
  132. included in a file installed by the binary package - see subsection
  133. 3.2.6, ``/usr/doc/<package>/copyright''.
  134. -------------------------------------------------------------------------------
  135. 3. Contents of the binary package
  136. ----------------------------------
  137. 3.1. Control file requirements
  138. -------------------------------
  139. 3.1.1. `Maintainer' information
  140. -------------------------------
  141. All packages must have a `Maintainer' field with the correct name and
  142. a working email address for the Debian maintainer of the package. If
  143. one person maintains several packages they should try to avoid having
  144. different forms of their name and address in different `Maintainer'
  145. fields.
  146. 3.1.2. Dependencies and virtual packages
  147. ----------------------------------------
  148. Add a dependency for any shared libraries required by
  149. dynamically-linked executable binaries in your package. Almost every
  150. package containing compiled C code should therefore include a
  151. `Depends' field which mentions the shared C library required for the
  152. program to run. For ELF binaries linked against `libc.so.5' the
  153. relevant package name is `libc5'.
  154. All packages must use virtual package names where appropriate, and
  155. arrange to create new ones if necessary. They must not use virtual
  156. package names (except privately, amongst a cooperating group of
  157. packages) unless they have been agreed upon and appear in the list of
  158. virtual package names.
  159. The latest version of the authoritative list of virtual package names
  160. can be found on ftp.debian.org in
  161. /debian/doc/package-developer/virtual-package-names-list.text or your
  162. local mirror. The procedure for updating it is described at the top of
  163. the file.
  164. 3.1.3. `Section' and `Priority'
  165. -------------------------------
  166. Decide whether your package can go in `non-free', `contrib' or the
  167. main distribution - see chapter 2, `Package copyright', and put an
  168. appropriate value for the distribution in the `debian/changelog' file.
  169. The `Priority' and `Section' control file fields give information for
  170. classifying the package in dselect and say which directory to place it
  171. in the FTP archive.
  172. They are ultimately the responsibility of the distribution
  173. maintainers; however, you should suggest values for them in your
  174. `.changes' information when you upload a package. You do this by
  175. including appropriate information in the `debian/control' file before
  176. building the packages.
  177. For a list of the currently in-use sections, please see the FTP
  178. archive. Packages in the non-free and contrib areas should have
  179. section `non-free' and `contrib', respectively.
  180. 3.1.3.1. `Priority' values
  181. --------------------------
  182. `required'
  183. `required' packages are necessary for the proper functioning of
  184. the system. You must not remove these packages or your system may
  185. become totally broken and you may probably not even be able to
  186. use dpkg to put things back. Systems with only the `required'
  187. packages are probably unuseable, but they do have enough
  188. functionality to allow the sysadmin to boot and install more
  189. software.
  190. `important'
  191. Important programs, including those which one would expect to
  192. find on any Unix-like system. If the expectation is that an
  193. experienced Unix person who found it missing would go `What the
  194. F*!@<+ is going on, where is foo', it should be in `important'.
  195. This is an important criterion because we are trying to produce,
  196. amongst other things, a free Unix. Other packages without which
  197. the system will not run well or be useable should also be here.
  198. This does *not* include Emacs or X11 or TeX or any other large
  199. applications. The `important' packages are just a bare minimum of
  200. commonly-expected and necessary tools.
  201. `standard'
  202. These packages provide a reasonably small but not too limited
  203. character-mode system. This is what will install by default if
  204. the user doesn't select anything else. It doesn't include many
  205. large applications, but it does include Emacs (this is more of a
  206. piece of infrastructure than an application) and a reasonable
  207. subset of TeX and LaTeX (if this is possible without X).
  208. `optional'[1]
  209. This is all the software that you might reasonably want to
  210. install if you didn't know what it was or don't have specialised
  211. requirements. This is a much larger system and includes X11, a
  212. full TeX distribution, and lots of applications.
  213. [1] In a sense everything is optional that isn't required, but
  214. that's not what is meant here.
  215. `extra'
  216. This contains packages that conflict with others with higher
  217. priorities, or are only likely to be useful if you already know
  218. what they are or have specialised requirements.
  219. Priority values are not case-sensitive.
  220. 3.1.3.2. Base packages
  221. ----------------------
  222. Some packages have `Section: base' and are in the `base' subdirectory
  223. on the FTP archives. These are the packages that are supplied on the
  224. base disks. They are the minimum sensible set for installing new
  225. packages (perhaps via a network).
  226. Most of these packages should have `Priority: required' or at least
  227. `Priority: important'.
  228. 3.1.4. The `Essential' flag
  229. ---------------------------
  230. The `Essential: yes' control file field should not be used unless
  231. removing a package really will completely hose the system; nor should
  232. it be used for a shared library package - the dependencies will
  233. prevent its premature removal, and we need to be able to remove it
  234. when it has been superseded.
  235. 3.1.5. Including `Priority' and `Section' in the `.deb' control file
  236. --------------------------------------------------------------------
  237. If a user installs a package which is not part of the standard
  238. distribution, or without downloading and updating from a new Packages
  239. file, the information about the priority and section of a package will
  240. be absent, and the dselect package listing will have the package
  241. listed under `unclassified'. In order to improve this it is
  242. permissible to use the `-is', `-isp' or `-ip' option to
  243. dpkg-gencontrol, so that the `Section' and/or `Priority' is copied
  244. into the actual control information in the `.deb' file. However, if
  245. you do this you should make sure you keep the information up to date
  246. so that users are not shown conflicting information.
  247. 3.1.6. Formatting of the `Description' control file field
  248. ---------------------------------------------------------
  249. Every Debian package should have an extended description.
  250. The description should be written so that it tells the user what they
  251. need to know to decide whether to install the package. This
  252. description should not just be copied from the blurb for the program.
  253. Instructions for configuring or using the package should not be
  254. included - that is what installation scripts, manpages, Info files and
  255. `/usr/doc/<package>' are for. Copyright statements and other
  256. administrivia should not be included - that is what
  257. `/usr/doc/<package>/copyright' is for.
  258. If you wish to include a list in your extended with entries which are
  259. a line or more each you must indent each entry by one space to make
  260. sure that it doesn't get wordwrapped. The start of each list entry
  261. should be marked with an asterisk, followed by a single space. You
  262. must wrap the list entries yourself to 75 columns, and should start
  263. continuation lines indented by three spaces so that they line up with
  264. the start of the text on the first line of each list entry.
  265. See the programmers' manual for further requirements and pitfalls.
  266. 3.2. Locations of files
  267. -----------------------
  268. The location of all installed files and directories must comply fully
  269. with the Linux File System Standard (FSSTND). The latest version of
  270. this document can be found alongside this manual or on tsx-11.mit.edu
  271. in /pub/linux/docs/linux-standards/fsstnd/. Specific questions about
  272. following the standard may be asked on debian-devel, or referred to
  273. Daniel Quinlan, the FSSTND coordinator, at <quinlan@yggdrasil.com>.
  274. 3.2.1. Manpages
  275. ---------------
  276. You must install manpages in nroff source form, in appropriate places
  277. under `/usr/man'. You should only use sections 1 to 9 (see the FSSTND
  278. for more details). You must *not* install a preformatted `cat page'.
  279. If no manual page is available for a particular program, utility or
  280. function and this is reported as a bug on debian-bugs, a symbolic link
  281. from the requested manual page to the undocumented(7) manual page
  282. should be provided. This symbolic link can be created from
  283. `debian/rules' like this:
  284. ln -s ../man7/undocumented.7 \
  285. debian/tmp/usr/man/man[1-9]/the_requested_manpage.[1-9]
  286. This manpage claims that the lack of a manpage has been reported as a
  287. bug, so you may only do this if it really has (you can report it
  288. yourself, if you like). Do not close the bug report until a proper
  289. manpage is available.
  290. You may forward a complaint about a missing manpage to the upstream
  291. authors, and mark the bug as forwarded in the Debian bug tracking
  292. system. Even though the GNU Project do not in general consider the
  293. lack of a manpage to be a bug, we do - if they tell you that they
  294. don't consider it a bug you should leave the bug in our bug tracking
  295. system open anyway.
  296. Manpages should be installed compressed using `gzip -9'.
  297. If one manpage needs to be accesssible via several names it is better
  298. to use a symbolic link than the `.so' feature, but there is no need to
  299. fiddle with the relevant parts of the upstream source to change from
  300. `.so' to symlinks - don't do it unless it's easy. Do not create hard
  301. links in the manual page directories, and do not put absolute
  302. filenames in `.so' directives. The filename in a `.so' in a manpage
  303. should be relative to the base of the manpage tree (usually
  304. `/usr/man').
  305. 3.2.2. Info documents
  306. ---------------------
  307. Info documents should be installed in `/usr/info'. They should be
  308. compressed with `gzip -9'.
  309. Your package must call install-info to update the Info `dir' file, in
  310. its post-installation script:
  311. install-info --quiet --section Development Development \
  312. /usr/info/foobar.info
  313. It is a good idea to specify a section for the location of your
  314. program; this is done with the `--section' switch. To determine which
  315. section to use, you should use look at `/usr/info/dir' on your system
  316. and choose the most relevant (or create a new section if none of the
  317. current sections are relevant). Note that the `--section' flag takes
  318. two arguments; the first is a regular expression to match
  319. (case-insensitively) against an existing section, the second is used
  320. when creating a new one.
  321. You must remove the entries in the pre-removal script:
  322. install-info --quiet --remove /usr/info/foobar.info
  323. If install-info cannot find a description entry in the Info file you
  324. will have to supply one. See install-info(8) for details.
  325. 3.2.3. Additional documentation
  326. -------------------------------
  327. Any additional documentation that comes with the package can be
  328. installed at the discretion of the package maintainer. Text
  329. documentation should be installed in a directory
  330. `/usr/doc/<package>'[1] and compressed with `gzip -9' unless it is
  331. small.
  332. [1] Where <package> is the name of the package.
  333. If a package comes with large amounts of documentation which many
  334. users of the package will not require you should create a separate
  335. binary package to contain it, so that it does not take up disk space
  336. on the machines of users who do not need or want it installed.
  337. It is often a good idea to put text information files (`README's,
  338. changelogs, and so forth) that come with the source package in
  339. `/usr/doc/<package>' in the binary package. However, don't install the
  340. instructions for building and installing the package, of course!
  341. 3.2.4. Preferred documentation formats
  342. --------------------------------------
  343. The unification of Debian documentation is being carried out via HTML.
  344. If your package comes with extensive documentation in a markup format
  345. that can be converted to various other formats you should if possible
  346. ship HTML versions in the binary package, in the directory
  347. `/usr/doc/<package>' or its subdirectories.
  348. Other formats such as PostScript may be provided at your option.
  349. 3.2.4.1. Examples
  350. -----------------
  351. Any examples (configurations, source files, whatever), should be
  352. installed in a directory `/usr/doc/<package>/examples'. These files
  353. should not be referenced by any program - they're there for the
  354. benefit of the system administrator and users, as documentation only.
  355. 3.2.5. `/usr/doc/<package>/changelog.Debian.gz'
  356. -----------------------------------------------
  357. This installed file must contain a copy of the `debian/changelog' file
  358. from your Debian source tree.
  359. It should be installed compressed using `gzip -9', as it will become
  360. large with time even if it starts out small.
  361. If the package has only one changelog which is used both as the Debian
  362. changelog and the upstream one because there is no separate upstream
  363. maintainer then the changelog should usually be installed as
  364. `/usr/doc/<package>/changelog.gz' instead.
  365. 3.2.6. `/usr/doc/<package>/copyright'
  366. -------------------------------------
  367. This file must contain details of the authorship and copyright of the
  368. package. It must say where the upstream sources (if any) were
  369. obtained, and explain briefly what modifications were made in the
  370. Debian version of the package compared to the upstream one. It must
  371. name the original authors of the package and the Debian maintainer(s)
  372. who were involved with its creation.
  373. It must contain the full text of the copyright notice and any
  374. acknowledgements for the program and the licence terms under which the
  375. program is distributed. If the package is distributed under the GNU
  376. General Public Licence, the GNU Library General Public Licence, the
  377. Regents of the University of California at Berkeley (BSD) licence or
  378. Larry Wall's Artistic Licence please say so instead of including a
  379. copy of the licence. The files `BSD', `GPL', `LGPL' and `Artistic' are
  380. be available in `/usr/doc/copyright' for you to refer to.
  381. The copyright file should not be compressed unless it is very large.
  382. Do not use the copyright file as a general `README' file. If your
  383. package has such a file it should be installed in
  384. `/usr/doc/<package>/README' or `README.Debian' or some other
  385. appropriate place.
  386. 3.2.7. Symbolic links
  387. ---------------------
  388. Most symbolic links should be relative, not absolute. Absolute links,
  389. in general, cause problems when a file system is not mounted where it
  390. "normally" resides (for example, when mounted via NFS).
  391. In particular, symlinks from one part of `/usr' to another should be
  392. relative.
  393. In certain cases, however, relative links may cause more problems. For
  394. example, links into `/etc' and `/var' should be absolute.
  395. Note that when creating a relative link using ln it is not necessary
  396. for the target of the link to exist relative to the working directory
  397. you're running ln from; nor is it necessary to change directory to the
  398. directory where the link is to be made. Simply include the string that
  399. should appear as the target of the link (this will be a pathname
  400. relative to the directory in which the link resides) as the first
  401. argument to ln.
  402. For example, in your Makefile or `debian/rules', do things like:
  403. ln -fs gcc $(prefix)/bin/cc
  404. ln -fs gcc debian/tmp/usr/bin/cc
  405. ln -fs ../sbin/sendmail $(prefix)/bin/runq
  406. ln -fs ../sbin/sendmail debian/tmp/usr/bin/runq
  407. 3.2.8. Logfiles
  408. ---------------
  409. Logfiles should usually be named `/var/log/<package>.log'. If you have
  410. many logfiles, or need a separate directory for permissions reasons
  411. (`/var/log' is writeable only by `root'), you should usually create a
  412. directory named `/var/log/<package>'.
  413. Make sure that any logfiles are rotated occasionally using so that
  414. they don't grow indefinitely; the best way to do this is to use
  415. savelog program in an `/etc/cron.daily', `/etc/cron.weekly' or
  416. `/etc/cron.monthly' script.
  417. Make sure that any logfiles are removed when the package is purged
  418. (but not when it is only removed), by checking the argument to the
  419. postrm script (see the programmer's manual for details).
  420. 3.2.9. `/usr/local' - for the use of the system administrator
  421. -------------------------------------------------------------
  422. As mandated by the FSSTND no package should place any files in
  423. `/usr/local', either by putting them in the filesystem archive to be
  424. unpacked by dpkg or by manipulating them in their maintainer scripts.
  425. Every package that searches a number of directories or files for
  426. something (for example, looking for shared libraries in `/lib' or
  427. `/usr/lib') should search an appropriate directory in `/usr/local'
  428. too.
  429. In order that the system administrator may know where to place
  430. additional files a package should create an empty directory in the
  431. appropriate place in `/usr/local' by supplying it in the filesystem
  432. archive for unpacking by dpkg. The `/usr/local' directory itself and
  433. all the subdirectories created by the package should have permissions
  434. 2775 (group-writeable and set-group-id) and be owned by `root.staff'.
  435. In the future it will be possible to tell dpkg not to unpack files
  436. matching certain patterns, so that system administrators who do not
  437. wish these directories in `/usr/local' do not need to have them.
  438. 3.3. Permissions and ownerships
  439. -------------------------------
  440. The rules in this section are guidelines for general use. If necessary
  441. you may deviate from the details below. However, if you do so you must
  442. make sure that what is done is secure and you must try to be as
  443. consistent as possible with the rest of the system. You should
  444. probably also discuss it on debian-devel first.
  445. Files should be owned by `root.root', and made writeable only by the
  446. owner and universally readable (and executable, if appropriate).
  447. Directories should be mode 755 or (for group-writability) mode 2775.
  448. The ownership of the directory should be consistent with its mode - if
  449. a directory is mode 2775, it should be owned by the group that needs
  450. write access to it.
  451. Setuid and setgid executables should be mode 4755 or 2755
  452. respectively, and owned by the appropriate user or group. They should
  453. not be made unreadable (modes like 4711 or 2711 or even 4111); doing
  454. so achieves no extra security, because anyone can find the binary in
  455. the freely available Debian package - it is merely inconvenient. For
  456. the same reason you should not restrict read or execute permissions on
  457. non-set-id executables.
  458. Some setuid programs need to be restricted to particular sets of
  459. users, using file permissions. In this case they should be owned by
  460. the uid to which they are set-id, and by the group which should be
  461. allowed to execute them. They should have mode 4754; there is no point
  462. in making them unreadable to those users who must not be allowed to
  463. execute them.
  464. Do not arrange that the system administrator can only reconfigure the
  465. package to correspond to their local security policy by changing the
  466. permissions on a binary. Ordinary files installed by dpkg (as opposed
  467. to conffiles and other similar objects) have their permissions reset
  468. to the distributed permissions when the package is reinstalled.
  469. Instead you should consider (for example) creating a group for people
  470. allowed to use the program(s) and making any setuid executables
  471. executable only by that group.
  472. Shared libraries should be installed executable.
  473. 3.4. Configuration files
  474. ------------------------
  475. Any configuration files created or used by your package should reside
  476. in `/etc'. If there are several you should consider creating a
  477. subdirectory named after your package.
  478. It is almost certain that any file in `/etc' that is in your package's
  479. filesystem archive should be listed in dpkg's `conffiles' control area
  480. file. (See the dpkg programmers' manual).
  481. 3.5. Maintainer scripts
  482. -----------------------
  483. The package installation scripts should avoid producing output which
  484. it is unnecessary for the user to see and should rely on dpkg to stave
  485. off boredom on the part of a user installing many packages. This
  486. means, amongst other things, using the `--quiet' option on
  487. install-info.
  488. Packages should try to minimise the amount of prompting they need to
  489. do, and they should ensure that the user will only every be asked each
  490. question once. This means that packages should try to use appropriate
  491. shared configuration files (such as `/etc/papersize' and
  492. `/etc/news/server', rather than each prompting for their own list of
  493. required pieces of information.
  494. It also means that an upgrade should not ask the same questions again,
  495. unless the user has used `dpkg --purge' to remove the package's
  496. configuration. The answers to configuration questions should be stored
  497. in an appropriate place in `/etc' so that the user can modify them,
  498. and how this has been done should be documented.
  499. If a package has a vitally important piece of information to pass to
  500. the user (such as "don't run me as I am, you must edit the following
  501. configuration files first or you risk your system emitting
  502. badly-formatted messages"), it should display this in the postinst
  503. script and prompt the user to hit return to acknowledge the message.
  504. Copyright messages do not count as vitally important (they belong in
  505. `/usr/doc/copyright'); neither do instructions on how to use a program
  506. (these should be in on line documentation, where all the users can see
  507. them).
  508. Any necessary prompting should almost always be confined to the
  509. post-installation script, and should be protected with a conditional
  510. so that unnecssary prompting doesn't happen if a package's
  511. installation fails and the postinst is called with `abort-upgrade',
  512. `abort-remove' or `abort-deconfigure'.
  513. Errors which occur during the execution of an installation script
  514. *must* be checked and the installation *must not* continue after an
  515. error.
  516. The section below on scripts in general applies to package maintainer
  517. scripts too.
  518. 3.6. Scripts in general
  519. -----------------------
  520. All command scripts, including the package maintainer scripts inside
  521. the package and used by dpkg, should have a `#!' line naming the shell
  522. to be used to interpret them.
  523. In the case of Perl scripts this should be `#!/usr/bin/perl'.
  524. Shell scripts (sh and bash) should almost certainly start with `set
  525. -e' so that errors are detected. Every script *must* use `set -e' or
  526. check the exit status of *every* command.
  527. Perl scripts should check for errors when making any system calls,
  528. including `open', `print', `close', `rename' and `system'.
  529. csh and tcsh should be avoided as scripting languages. See Csh
  530. Programming Considered Harmful, one of the `comp.unix.*' FAQs. If an
  531. upstream package comes with csh scripts then you must make sure that
  532. they start with `#!/bin/csh' and make your package depend on csh.
  533. 3.7. Compilation options
  534. ------------------------
  535. Generally the following compilation parameters should be used:
  536. CC = gcc
  537. CFLAGS = -O2 -g -Wall # sane warning options vary between programs
  538. LDFLAGS = # none
  539. install -s # (or use strip on the files in debian/tmp)
  540. Note that all installed binaries should be stripped, either by using
  541. the `-s' flag to install, or by calling strip on the binaries after
  542. they have been copied into `debian/tmp' but before the tree is made
  543. into a package.
  544. Make sure that you do not link with `-g', as this makes a.out
  545. compilers produce huge statically linked binaries. The `-g' flag is
  546. useful on compilation so that you have available a full set of
  547. debugging symbols in your built source tree, in case anyone should
  548. file a bug report involving (for example) a core dump.
  549. The `-N' flag should not be used. On a.out systems it may have been
  550. useful for some very small binaries, but for ELF it has no good
  551. effect.
  552. It is up to the package maintainer to decide what compilation options
  553. are best for the package. Certain binaries (such as
  554. computationally-intensive programs) may function better with certain
  555. flags (`-O3', for example); feel free to use them. Please use good
  556. judgment here. Don't use flags for the sake of it; only use them if
  557. there is good reason to do so. Feel free to override the upstream
  558. author's ideas about which compilation options are best - they are
  559. often inappropriate for our environment.
  560. Please make sure that you use only released versions of shared
  561. libraries to build your packages; otherwise other users will not be
  562. able to run your binaries properly. Producing source packages that
  563. depend on unreleased compilers is also usually a bad idea.
  564. 3.8. Shared library packages
  565. ----------------------------
  566. Packages involving shared libraries should be split up into several
  567. binary packages.
  568. For a straightforward library which has a development environment and
  569. a runtime kit including just shared libraries you need to create two
  570. packages: `<libraryname><soname>'[1] and `<libraryname><soname>-dev'.
  571. [1] <soname> is the shared object name of the shared library - it's
  572. the thing that has to match exactly between building an
  573. executable and running it for the dynamic linker to be able run
  574. the program. Usually the <soname> is the major number of the
  575. library.
  576. If you prefer only to support one development version time you may
  577. name the development package `<libraryname>-dev'; otherwise you may
  578. wish to use dpkg's conflicts mechanism to ensure that the user only
  579. installs one development version at a time (after all, different
  580. development versions are likely to have the same header files in them,
  581. causing a filename clash if both are installed). Typically the
  582. development version will also need an exact version dependency on the
  583. runtime library, to make sure that compilation and linking happens
  584. correctly.
  585. Packages which use the shared library should have a dependency on the
  586. name of the shared library package, `<libraryname><soname>'. When the
  587. <soname> changes you can have both versions of the library installed
  588. while moving from the old library to the new.
  589. If your package has some run-time support programs which use the
  590. shared library you must *not* put them in the shared library package.
  591. If you do that then you won't be able to install several versions of
  592. the shared library without getting filename clashes. Instead, either
  593. create a third package for the runtime binaries (this package might
  594. typically be named `<libraryname>-runtime' - note the absence of the
  595. <soname> in the package name) or if the development package is small
  596. include them in there.
  597. If you have several shared libraries built from the same source tree
  598. you can lump them all togther into a single shared library package,
  599. provided that you change all their <soname>s at once (so that you
  600. don't get filename clashes if you try to install different versions of
  601. the combined shared libraries package).
  602. Follow the directions in the dpkg programmers' manual for putting the
  603. shared library in its package, and make sure you include a `shlibs'
  604. control area file with details of the dependencies for packages which
  605. use the library.
  606. 3.9. Application configuration files, dotfiles and `/etc/skel'
  607. --------------------------------------------------------------
  608. Files in `/etc/skel' will automatically be copied into new user
  609. accounts by adduser. They should not be referenced there by any
  610. program.
  611. Therefore, if a program needs a dotfile to exist in advance in `$HOME'
  612. to work sensibly that dotfile should be installed in `/etc/skel' (and
  613. listed in conffiles, if it is not generated and modified dynamically
  614. by the package's installation scripts).
  615. However, programs that require dotfiles in order to operate sensibly
  616. (dotfiles that they do not create themselves automatically, that is)
  617. are a bad thing, and programs should be configured by the Debian
  618. default installation as close to normal as possible.
  619. Therefore, if a program in a Debian package needs to be configured in
  620. some way in order to operate sensibly that configuration should be
  621. done in a site-wide global configuration file elsewhere in `/etc'.
  622. Only if the program doesn't support a site-wide default configuration
  623. and the package maintainer doesn't have time to add it should a
  624. default per-user file be placed in `/etc/skel'.
  625. `/etc/skel' should be as empty as we can make it. This is particularly
  626. true because there is no easy mechanism for ensuring that the
  627. appropriate dotfiles are copied into the accounts of existing users
  628. when a package is installed.
  629. Ideally the sysadmin should ideally not have to do any configuration
  630. other than that done (semi-)automatically by the postinst script.
  631. 3.10. Mail processing on Debian systems
  632. ---------------------------------------
  633. Debian packages which process electronic mail, whether
  634. mail-user-agents (MUAs) or mail-transport-agents (MTAs), *must* make
  635. sure that they are compatible with the configuration decisions below.
  636. Failure to do this may result in lost mail, broken `From:' lines, and
  637. other serious brain damage!
  638. The mail spool is `/var/spool/mail' and the interface to send a mail
  639. message is `/usr/sbin/sendmail' (as per the FSSTND). The mail spool is
  640. part of the base system and not part of the MTA package.
  641. Mailboxes are locked using the `<username>.lock' lockfile convention,
  642. rather than fcntl, flock or lockf.
  643. Mailboxes are generally 660 `<user>.mail' unless the user has chosen
  644. otherwise. A MUA may remove a mailbox (unless it has nonstandard
  645. permissions) in which case the MTA or another MUA must recreate it if
  646. needed. Mailboxes must be writeable by group mail.
  647. The mail spool is 2775 `mail.mail', and MUA's need to be setgid mail
  648. to do the locking mentioned above (and obviously need to avoid
  649. accessing other users' mailboxes using this privilege).
  650. `/etc/aliases' is the source file for the system mail aliases (e.g.
  651. postmaster, usenet, etc.) - it is the one which the sysadmin and
  652. postinst scripts may edit. After `/etc/aliases' is edited the program
  653. or human editing it must call newaliases. All MTA packages should come
  654. with a newaliases program, even if it does nothing, but older MTA
  655. packages do not do this so programs should not fail if newaliases
  656. cannot be found.
  657. The convention of writing `forward to <address>' in the mailbox itself
  658. is not supported. Use a `.forward' file instead.
  659. The location for the rmail program used by UUCP for incoming mail is
  660. `/usr/sbin/rmail', as per the FSSTND. Likewise, rsmtp, for receiving
  661. batch-SMTP-over-UUCP, is in `/usr/sbin/rsmtp' if it is supported.
  662. If you need to know what name to use (for example) on outgoing news
  663. and mail messages which are generated locally, you should use the file
  664. `/etc/mailname'. It will contain the portion after the username and
  665. `@' (at) sign for email addresses of users on the machine (followed by
  666. a newline).
  667. A package should check for the existence of this file. If it exists it
  668. should use it without comment.[1] If it does not exist it should
  669. prompt the user for the value and store it in `/etc/mailname' as well
  670. as using it in the package's configuration. The prompt should make it
  671. clear that the name will not just be used by that package. E.g., in
  672. this situation the INN package says:
  673. Please enter the `mail name' of your system. This is the hostname
  674. portion of the address to be shown on outgoing news and mail messages.
  675. The default is <syshostname>, your system's host name.
  676. Mail name [`<syshostname>']:
  677. where <syshostname> is the output of `hostname -fqdn'.
  678. [1] An MTA's prompting configuration script may wish to prompt the
  679. user even if it finds this file exists.
  680. 3.11. Packages which can use the X shared libraries
  681. ---------------------------------------------------
  682. Some programs can be configured with or without support for X Windows.
  683. Typically these binaries produced when configured for X will need the
  684. X shared libraries to run.
  685. Such programs should be configured *with* X support, and should
  686. declare a dependency on `elf-x11r6lib' (for the X11R6 libraries).
  687. Users who wish to use the program can install just the relatively
  688. small `xlib' package, and do not need to install the whole of X.
  689. Do not create two versions (one with X support and one without) of
  690. your package.
  691. 3.12. Games
  692. -----------
  693. The permissions on /var/lib/games are 755 `root.root'.
  694. Each game decides on its own security policy.
  695. Games which require protected, privileged access to high-score files,
  696. savegames, &c, must be made set-*group*-id (mode 2755) and owned by
  697. `root.games', and use files and directories with appropriate
  698. permissions (770 `root.games', for example). They must *not* be made
  699. set-*user*-id, as this causes security problems.[1]
  700. [1] If an attacker can subvert any set-user-id game they can
  701. overwrite the executable of any other, causing other players of
  702. these cames to run a trojan. With a set-group-id game the
  703. attacker only gets access to less important game data, and if
  704. they can get at the other players' accounts at all it will take
  705. considerably more effort.
  706. Some packages, for example some fortune cookie programs, are
  707. configured by the upstream authors to install with their data files or
  708. other static information made unreadable so that they can only be
  709. accessed through set-id programs provided. Do not do this in a Debian
  710. package: anyone can download the `.deb' file and read the data from
  711. it, so there is no point making the files unreadable. Not making the
  712. files unreadable also means that you don't have to make so many
  713. programs set-id, which reduces the risk of a security hole.
  714. 3.13. Allocating package-specific users and groups
  715. --------------------------------------------------
  716. If you need to create a new user or group for your package there are
  717. two possibilities. Firstly, you may need to make some files in the
  718. binary package be owned by this user or group, or you may need to
  719. compile the user or group id (rather than just the name) into the
  720. binary (though this latter should be avoided if possible). In this
  721. case you need a statically allocated id.
  722. You must ask for a user or group id from the base system maintainer,
  723. and must not release the package until you have been allocated one.
  724. Once you have been allocated one you must make the package depend on a
  725. version of the base system with the id present in `/etc/passwd' or
  726. `/etc/group', or alternatively arrange for your package to create the
  727. user or group itself with the correct id (using `adduser') in its pre-
  728. or post-installation script (the latter is to be preferred if it is
  729. possible).
  730. On the other hand, the program may able to determine the uid or gid
  731. from the group name at runtime, so that a dynamic id can be used. In
  732. this case you must choose an appropriate user or group name,
  733. discussing this on debian-devel and checking with the base system
  734. maintainer that it is unique and that they do not wish you to use a
  735. statically allocated id instead. When this has been checked you must
  736. arrange for your package to create the user or group if necessary
  737. using adduser in the pre- or post-installation script (again, the
  738. latter is to be preferred if it is possible).
  739. Note that changing the numeric value of an id associated with a name
  740. is very difficult, and involves searching the filesystem for all
  741. appropriate files. You need to think carefully whether a static or
  742. dynamic id is required, since changing your mind later will cause
  743. problems.
  744. -------------------------------------------------------------------------------
  745. 4. Source package
  746. ------------------
  747. 4.1. Releases of packages by other than the usual Debian maintainer
  748. -------------------------------------------------------------------
  749. Under certain circumstances it is necessary for someone other than the
  750. usual package maintainer to make a release of a package. For example,
  751. a porter for another architecture may have to make some small changes
  752. to the source package and does not wish to wait with uploading their
  753. release until the main maintainer has incorporated the patch, or a
  754. serious security problem may have come to light requiring immediate
  755. attention.
  756. Maintainers other than the usual package maintainer should make as few
  757. changes to the package as possible, and they should always send a
  758. unified context diff (`diff -u') detailing their changes to the bug
  759. tracking system properly flagged with the correct package so that the
  760. usual maintainer is kept aware of the situation.
  761. When someone other than the usual maintainer releases a package they
  762. should add a new component to the <debian-revision> component of the
  763. version number - that is, the portion after the (last) hyphen. This
  764. extra component will start at `1'. This is to avoid `stealing' one of
  765. the usual maintainer's version numbers, possibly disrupting their
  766. work. If there is no <debian-revision> component in the version number
  767. then one should be created, starting at `1'.
  768. If it is absolutely necessary for someone other than the usual
  769. maintainer to make a release based on a new upstream version then the
  770. person making the release should start with the <debian-revision>
  771. value `0.1'. The usual maintainer of a package should start their
  772. <debian-revision> numbering at `1'.
  773. 4.2. Standards conformance and `Standards-Version'
  774. --------------------------------------------------
  775. You should specify the most recent version of the packaging standards
  776. with which your package complies in the source package's
  777. `Standards-Version' field.
  778. This value will be used to file bug reports automatically if your
  779. package becomes too much out of date.
  780. The value corresponds to a version of the Debian manuals, as can be
  781. found on the title page or page headers and footers (depending on the
  782. format). The value for this version of the manuals and packaging
  783. standards is `0.2.0.0'.
  784. The version number has four components - major and minor number and
  785. major and minor patchlevel. When the standards change in a way that
  786. requires every package to change the major number will be changed.
  787. Significant changes that will require work in many packages will be
  788. signaled by a change to the minor number. The major patchlevel will be
  789. changed for any change to the meaning of the standards, however small;
  790. the minor patchlevel will be changed when only cosmetic, typographical
  791. or other edits which do not change the meaning are made.
  792. You should regularly, and especially if your package has become out of
  793. date, install the most recent version of dpkg and read
  794. `/usr/doc/dpkg/changelog-manuals' to see which changes, if any, are
  795. relevant. If any are relevant you should look up the relevant section
  796. in the policy or programmers' manuals and update your package. When
  797. your package complies with the new standards you may update the
  798. `Standards-Version' source package field and release it.
  799. 4.3. Documentation and the `changelog'
  800. --------------------------------------
  801. Document your changes and updates to the source package properly in
  802. the `debian/changelog' file.
  803. A copy of the file which will be installed in
  804. `/usr/doc/<package>/copyright' should be in `debian/copyright'.
  805. In non-experimental packages you may only use a format for
  806. `debian/changelog' which is supported by the most recent released
  807. version of dpkg. If your format is not supported and there is general
  808. support for it you should contact the dpkg maintainer to have the
  809. parser script for your format included in the dpkg package.[1]
  810. [1] You will need to agree that the parser and its manpage may be
  811. distributed under the GNU GPL, just as the rest of dpkg is.
  812. 4.4. Changes to the upstream sources
  813. ------------------------------------
  814. If you need to edit a Makefile where GNU-style configure scripts are
  815. used, you should edit the `.in' files rather than editing the Makefile
  816. directly. This allows the user to reconfigure the package if
  817. necessary. You should *not* configure the package and edit the
  818. generated Makefile! This makes it impossible for someone else to later
  819. reconfigure the package.
  820. If changes to the source code are made that are generally applicable
  821. please try to get them included in the upstream version of the package
  822. by supplying the upstream authors with the changes in whatever form
  823. they prefer.
  824. If you need to configure the package differently for Debian or for
  825. Linux, and the upstream source doesn't provide a way to configure it
  826. the way you need to, please add such configuration facilities (for
  827. example, a new autoconf test or `#define') and send the patch to the
  828. upstream authors, with the default set to the way they originally had
  829. it. You can then easily override the default in your `debian/rules' or
  830. wherever is appropriate.
  831. 4.5. Error trapping in makefiles
  832. --------------------------------
  833. When make invokes a command in a makefile (including your package's
  834. upstream makefiles and the `debian/rules') it does so using `sh'. This
  835. means that `sh''s usual bad error handling properties apply: if you
  836. include a miniature script as one of the commands in your makefile
  837. you'll find that if you don't do anything about it then errors are not
  838. detected and make will blithely continue after problems.
  839. Every time you put more than one shell command (this includes using a
  840. loop) in a makefile command you *must* make sure that errors are
  841. trapped. For simple compound commands, such as changing directory and
  842. then running a program, using `&&' rather than semicolon as a command
  843. separator is sufficient. For more complex commands including most
  844. loops and conditionals you must include a separate `set -e' command at
  845. the start of every makefile command that's actually one of these
  846. miniature shellscripts.
  847. -------------------------------------------------------------------------------
  848. 5. How to become a Debian developer
  849. ------------------------------------
  850. 5.1. Before you start work
  851. --------------------------
  852. So, you've read all the documentation, you understand what everything
  853. in the hello example package is for, and you're about to Debianise
  854. your favourite package. How do you actually become a Debian developer
  855. so that your work can be incorporated into the Project?
  856. Firstly, subscribe to debian-devel if you haven't already. Send the
  857. word `subscribe' in the *Subject* of a mail to
  858. <debian-devel-REQUEST@lists.debian.org>. In case of problems contact
  859. the list administrator, Anders Chrigstrom <ac@netg.se>.
  860. You should to subscribe and lurk for a bit before doing any coding,
  861. and you should post about your intentions to work on something to
  862. avoid duplicated effort.
  863. If you do not have a PGP key yet generate one. You should probably
  864. read the PGP manual, as it has much important information which is
  865. critical to its security. Many more security failures are due to human
  866. error than to software failure or high-powered spy techniques.
  867. If you live in a country where use of cryptography even for signing is
  868. forbidden then please contact us so we can make special arrangements.
  869. This does not apply in France, where I believe only encryption and not
  870. signing is forbidden.
  871. 5.2. When you have a package to upload
  872. --------------------------------------
  873. When you have your package ready to be uploaded you must send a
  874. message to the project leader, Bruce Perens <bruce@pixar.com>, the
  875. administrator of `master.debian.org', Simon Shapiro
  876. <shimon@i-connect.net>, the mailing list administrator, Anders
  877. Chrigstrom <ac@netg.se> and the dpkg maintainer, Ian Jackson
  878. <ijackson@gnu.ai.mit.edu>.
  879. The message should say what you've done and who you are, and should
  880. ask for an account on master and to be subscribed to debian-private
  881. (the developers-only mailing list). It should contain your PGP key
  882. (extracted using `pgp -kxa') for the database of keys which is shipped
  883. with dpkg. When you have your personal account on master log in and
  884. transfer the files to `/home/Debian/ftp/private/project/Incoming'. You
  885. cannot upload to Incoming on master using anonymous FTP.
  886. You can also upload files to Incoming via a cron-driven upload queue
  887. in Europe on chiark.chu.cam.ac.uk. For details connect to chiark using
  888. anonymous FTP and read
  889. /pub/debian/private/project/README.how-to-upload.
  890. 5.3. Upload handling - `.changes' files
  891. ---------------------------------------
  892. When a package is uploaded to the Debian FTP archive, it must be
  893. accompanied by a `.changes' file which gives directions for its
  894. handling. This is usually generated by dpkg-genchanges.
  895. This file is a control file with the following fields:
  896. * `Format'
  897. * `Date'
  898. * `Source'
  899. * `Binary'
  900. * `Architecture'
  901. * `Version'
  902. * `Distribution'
  903. * `Urgency'
  904. * `Maintainer'
  905. * `Description'
  906. * `Changes'
  907. * `Files'
  908. All of them are mandatory for a Debian upload. See the list of control
  909. fields in the dpkg programmers' manual for the contents of these
  910. fields.
  911. -------------------------------------------------------------------------------
  912. 6. The Debian mailing lists
  913. ---------------------------
  914. The mailing list server is at `lists.debian.org'. Mail
  915. `debian-<foo>-REQUEST@lists.debian.org'[1] with the word `subscribe'
  916. in the Subject to subscribe or `unsubscribe' to unsubscribe.
  917. [1] where `debian-<foo>' is the name of the list
  918. When replying to messages on the mailing list, please do not send a
  919. carbon copy (`CC' - this does not mean `courtesy copy') to the
  920. original poster. Anyone who posts to a mailing list should read it to
  921. see the responses.
  922. As ever on the net, please trim down the quoting of articles you're
  923. replying to.
  924. -------------------------------------------------------------------------------
  925. 7. Conversion procedure from old source packages
  926. ------------------------------------------------
  927. This is a brief summary of the procedure for converting a
  928. pre-2.0.0.0-format source package into the new format.
  929. * Download the original source code from wherever it can be found
  930. and do any rearrangement required to make it look like the
  931. original tree of the Debian source. Put it in
  932. `<package>-<upstream-version>.orig'.
  933. * Rename all files `debian.*' to `debian/*'. There may be some
  934. exceptions to this, but this is a good start.
  935. * Edit the `debian/changelog' - create or rename it if necessary.
  936. Add a new revision to the top with the appropriate details, and a
  937. local variables entry to the bottom to set Emacs to the right
  938. mode:
  939. Local variables:
  940. mode: debian-changelog
  941. End:
  942. * Edit/create `debian/control':
  943. * Remove the `Version' field. If it is generated unusually
  944. (not equal to the source version) you must use the -v option
  945. to dpkg-gencontrol (see below). `Section', `Priority',
  946. `Maintainer' go above the first blank line, most of the rest
  947. below.
  948. * Reorder the fields and add a blank line at an appropriate
  949. point, separating the source package fields from the binary
  950. package fields.
  951. * Add the `Source' field.
  952. * Add the `Standards-Version' field. The current value is
  953. `0.2.0.0'.
  954. * Change the `Architecture' field for each package to `any',
  955. `all' or whatever. If there isn't an `Architecture' field
  956. add one.
  957. * If any other seddery or things used to happen to make the
  958. binary control files use dpkg-gencontrol's variable
  959. substitution features to achieve the same effect. Use
  960. `debian/substvars' if you need to put unusally-generated
  961. information (apart from details of `.deb' files) in the
  962. `.changes' file too.
  963. * Edit the `debian/rules':
  964. * Remove the source and diff and any changes and dist targets.
  965. These things now happen in a package-independent way and are
  966. not done by `debian/rules'.
  967. * Split the binary target into binary-arch and binary-indep;
  968. in many cases all of binary should go into binary-arch.
  969. Create the binary target and the unused of the two other
  970. binary-* targets if there is one - you can copy the ones
  971. from the hello package.
  972. * Change the binary target to use dpkg-gencontrol to make the
  973. package control file(s). Move it to after all the files have
  974. been installed but just before the last chown and chmod in
  975. the target.
  976. * Change occurrences of `debian-tmp' to `debian/tmp'.
  977. * Change occurrences of `debian.{post,pre}{inst,rm}' to
  978. `debian/*'.
  979. * Remove the version number setting at the top, if there is
  980. one.
  981. * Ensure that the package's Debian-specific and upstream
  982. changelogs are installed.
  983. * Check that the `debian/README' is really the copyright file, and
  984. if so rename it to `debian/copyright' and edit `debian/rules' to
  985. cope with this and to change the installation of the copyright
  986. file from `/usr/doc/<package>/copyright' instead of
  987. `/usr/doc/copyright/<package>'. If it isn't then find
  988. `debian/copyright' and decide what to do with the `README'.
  989. * Check for various other anachronisms:
  990. * Remove any `Package_Revision', `Package-Revision' or
  991. `Revision' fields.
  992. * Rename `Optional' to `Suggests', `Recommended' to
  993. `Recommends'.
  994. * Change `/usr/doc/examples/<package>' to
  995. `/usr/doc/<package>/examples'.
  996. * Make sure that manpages are installed compressed.
  997. * Look everything over.
  998. * Do a test build using `dpkg-buildpackage -ur -uc -r<whatever>'.
  999. Check the permissions and locations of files in the resulting
  1000. package by eyeballing the output of `dpkg-deb --contents', and
  1001. check that the source build happened OK. Test install the binary
  1002. package(s) and test extract the source package(s).
  1003. * Sign the release: either re-run dpkg-buildpackage (this will
  1004. rebuild the package entirely), or PGP-sign the `.dsc', rebuild
  1005. the `.changes' using dpkg-genchanges, and then PGP-sign the
  1006. `.changes'.
  1007. -------------------------------------------------------------------------------
  1008. 0.3 Copyright Notice
  1009. --------------------
  1010. Copyright ©1996 Ian Jackson.
  1011. This manual is free software; you may redistribute it and/or modify it
  1012. under the terms of the GNU General Public License as published by the
  1013. Free Software Foundation; either version 2, or (at your option) any
  1014. later version.
  1015. This is distributed in the hope that it will be useful, but *without
  1016. any warranty*; without even the implied warranty of merchantability or
  1017. fitness for a particular purpose. See the GNU General Public License
  1018. for more details.
  1019. You should have received a copy of the GNU General Public License with
  1020. your Debian GNU/Linux system, in `/usr/doc/copyright/GPL', or with the
  1021. dpkg source package as the file `COPYING'. If not, write to the Free
  1022. Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  1023. -------------------------------------------------------------------------------
  1024. Debian policy manual
  1025. Ian Jackson <ijackson@gnu.ai.mit.edu> - version 0.2.0.0 (dpkg 1.3.7),
  1026. 22 August 1996