| 339 | == Creating doc packages == |
| 340 | |
| 341 | A lot of software comes with various types of documentation. User-level documentation (such as manuals in MAN and INFO formats) is usually installed with the main package as it should be always available once the software is installed. However, many software packages also come with the development libraries (in a sub-package called `PACKAGE-devel`) accompanied by the documentation for developers. This documentation may occupy quite a lot of space on disk (several or even several dozen MB) when installed and unpacked. Given that it's usually more convenient to read it online, it makes little sense to have it installed each time when `PACKAGE-devel` is installed. |
| 342 | |
| 343 | Some packages already separate the developer's documentation from the development sub-package by putting it to a separate package `PACKAGE-devel-doc` but there is a plenty of them that still put everything in `PACKAGE-devel`. A .spec file for such a packages should be altered to separate the documentation from development libraries and tools. Here is a template for the respective part of the .spec file: |
| 344 | |
| 345 | {{{ |
| 346 | %package devel-doc |
| 347 | Summary: Development Documentation files for MYSOFTWARE |
| 348 | Group: Documentation |
| 349 | BuildArch: noarch |
| 350 | Requires: %{name}-devel = %{version}-%{release} |
| 351 | ... |
| 352 | %files devel-doc |
| 353 | %doc docs/html/ |
| 354 | %doc examples/*.c |
| 355 | }}} |
| 356 | |
| 357 | Please note that `PACKAGE-devel-doc` requires `PACKAGE-devel` but make sure that `PACKAGE-devel` does NOT require `PACKAGE-devel-doc` as otherwise this separation will be useless because the documentation sub-package will be implicitly installed each time the development sub-package is installed. |
| 358 | |
| 359 | Of course, if you create a new .spec file from scratch, you should separate `devel` and `devel-doc` right away. |
| 360 | |
| 361 | Note that in some rare cases user-level documentation may also be quite bulky (especially when it contains a lot of HTML files with pictures, big PDF files, etc). In such cases it may make sense to put it to a separate package, named `PACKAGE-doc` (`%package doc` in terms of the .spec file) similarly to the template shown above. A rule of thumb is that brief documentation (MAN, INFO) should be always installed with the main package and extended documentation, if it's several dozen MB or more, should go to a `doc` sub-package. |
| 362 | |