Keeping Docs and Info Files
Aim of the Howto
This is a short Howto aimed at those users who may want to keep the documentation that comes with their packages. Please note, this Howto requires an understanding of the Arch Build System, ABS. Please visit the ABS ArchWiki page and familiarise yourself with it before continuing. For those of you who just want to get Info files installed on a required package a short ABS walk-through is provided later on.
Where Are My Info files?
The Arch Way is one of simplicity. In this regard many 'Archers' find the extra documentation bundled with various programs to be unnecessary. It is for this reason that Pacman, the Arch Linux package manager, removes those directories that normally contain such information after it has installed your package. This helps to reduce bloat on the system, as beffinting the Arch philosophy.
I want my Info files!
Some programs, however do come with useful information. Gnu Emacs, for example, contains useful Info pages, that can make using this hard to learn text editor that little bit easier. So, taking Emacs as an example this Howto will now guide you through the simple steps required to build your own package using the makepkg utility and install it on your machine.
The Arch Build Package (ABS) is a way of building your own packages and installing them on your machine. A full introduction is beyond the scope of this Howto so please visit the ABS Wiki page to gain more details.
For those of you who may not have an ABS Tree currently set up on your system here's a quick walkthrough. Though, it would be advised to visit the previous link to gain a better insight in using ABS before continuing with this guide.
Open a terminal, then as root;
pacman -S csup
Building an ABS tree may take a while, depending on your hardware so please be patient. When the ABS directory tree has been finalised continue with the next steps.
We will now use the makepkg command to build the Emacs package with info files. Of course you can substitute Emacs for whichever package you require the documentation for. Note, as with ABS this Howto advises you to have a basic understanding of Makepkg, information for which can be obtained through the man pages or the ABS ArchWiki page. Before we proceed with our build we need to edit the makepkg.con file.
In your terminal as root using a text editor (in this case vi);
Then find the line which reads;
OPTIONS=(strip !docs libtools emptydirs)
See that exclamation mark before docs? Delete it. Now makepkg will build Emacs without removing the Info files directory. Save the file.
Next, locate the PKGBUILD of your required package. In this case /var/abs/local/extras/editors/emacs/PKGBUILD and copy it to a ~/build directory.
As [i]normal[/i] user;
mkdir ~/build cp /var/abs/extras/editors/emacs/PKGBUILD ~/build cd ~/build
If all is well Makepkg will now proceed with the build. Please note that both Makepkg and Emacs may require the installation of specific packages before it builds. (This may also be the case for your chosen package). This will lead to an error and the install will abort. If this happens simply install the required packages using Pacman and then redo the above command.
pacman -U emacs*.pkg.tar.gz
Ta Da! Documentation Galore!
The normally deleted Docs and Info should now be at your disposal. Go on have a look!
Where to from here?
There are a variety of other things that you can do to make the process of building Packages with Docs a little easier. What happens for example if Pacman updates your package with a new binary? Your installed info pages disappear! However using the srcpac wrapper, for Pacman, to build your packages will allow you to upgrade through the above process of Makepkg, leaving your info files intact. Srcpac can be downloaded through pacman and does the same job, with a few added extras. See the man pages for details.