Next: , Previous: Advice for package providers, Up: Installation


2.6 Installation for non-privileged users

Often people without system administration privileges want to install software for their private use. In that case you need to specify more options top the configure script. For XEmacs users, this is fairly easy, because the XEmacs package system has been designed to make this sort of thing practical: but GNU Emacs users (and XEmacs users for whom the package system is for some reason misbehaving) may need to do a little more work.

GNU Emacs users can solve this problem by using the --prefix option to the configure script, and let it point to the personal home directory. In that way, resulting binaries will be installed under the bin subdirectory of your home directory, manual pages under man and so on. That way, it is reasonably easy to maintain a bunch of additional packages, since the prefix argument is supported by most configure scripts.

You'll have to add something like /home/myself/share/emacs/site-lisp to your load-path variable, if it isn't there already.

XEmacs users can achieve the same end by pointing configure at an appropriate package directory (normally --with-packagedir=~/.xemacs/xemacs-packages will serve). This should only need to be done once, and should be needed fairly rarely; if you have installed any personal XEmacs packages before, configure should detect that, and automatically install preview-latex there too; equally, if you have installed preview-latex somewhere searched by XEmacs, preview-latex should be automatically reinstalled over that copy.

(configure may guess wrong if the site administrator has installed preview-latex somewhere else: if so, just use the --with-packagedir option to override configure's choice.)

But there is another problem: perhaps you want to make it easy for other users to share parts of your personal Emacs configuration. In general, you can do this by writing `~myself/' anywhere where you specify paths to something installed in your personal subdirectories, not merely `~/', since the latter, when used by other users, will point to non-existent files.

For yourself, it will do to manipulate environment variables in your .profile resp. .login files. But if people will be copying just Elisp files, their copies will not work. While it would in general be preferable if the added components where available from a shell level, too (like when you call the standalone info reader, or try using preview.sty for functionality besides of Emacs previews), it will be a big help already if things work from inside of Emacs.

Here is how to do the various parts:

Making the Elisp available

In XEmacs, you should ask the other users to add symbolic links in their ~/.xemacs/xemacs-packages/lisp, ~/.xemacs/xemacs-packages/info and ~/.xemacs/xemacs-packages/etc directories. (Alas, there is presently no easy programmatic way to do this, except to have a script do the symlinking for them.)

In GNU Emacs, you'll want the invocation lines from the autogenerated file preview-latex.el. In addition, you'll want a line such as

     (add-to-list 'load-path "~myself/share/emacs/site-lisp/preview")

Making the Info files available

While for yourself, you'll probably want to manipulate the `INFOPATH' variable; for access inside of Elisp something like the following might be convenient:

     (eval-after-load 'info
        '(add-to-list 'Info-directory-list "~myself/info"))

In XEmacs, as long as XEmacs can see the package, there should be no need to do anything at all; the info files should be immediately visible. However, you might want to set `INFOPATH' anyway, for the sake of standalone readers outside of XEmacs. (The info files in XEmacs are normally in ~/.xemacs/xemacs-packages/info.)

Making the LaTeX style available

Again, for yourself you want to manipulate the `TEXINPUTS' environment variable or an appropriate setting of a personal `texmf.cnf' file. It may well be that your site configuration already installs access to a personal user's texmf tree, in which case having specified the appropriate tree to ./configure will have set up everything for yourself. If that personal tree is not located at the equivalent of ~myself/share/texmf, it is a good idea to make this so with the help of a symbolic link, so that the usual `--prefix' invocation to ./configure is everything that is needed.

For others, you want to add something like

     (setenv "TEXINPUTS"
             (concat "~myself/share/texmf/tex/latex/preview:"
                     (getenv "TEXINPUTS")))
     
     (setenv "TEXDOCS"
             (concat "~myself/share/texmf/doc/latex/styles:"
                     (getenv "TEXDOCS")))

This just exports the relevant directories for preview-latex; you might have more to share. Also, the `TEXDOCS' change is hardly likely to be effective: most people call texdoc from a shell window rather than from inside of Emacs, and those that are interested in the style documentation will usually want to have the style itself available anyhow without having to call LaTeX from within Emacs.

But at least for people just interested in preview-latex from inside of Emacs, the augmentation of `TEXINPUTS' will be helpful. Although it does not appear like it, under web2c-based systems like teTeX, this invocation will also do the right thing in case `TEXINPUTS' has no previous value.