Search code examples
linuxunixinstallationpackaging

Custom installation directories


Let's say I am writing installation script for the program which contains executable file and shared library. By default, this script places executable to /usr/local/bin, and shared library to /usr/local/lib. In this case my program may be executed by any user by typing its name in the command line.

Suppose that user selects custom installation directory, like ~/myprogram/. Is it user's responsibility to ensure that my program may be executed, or my installation script must do this?


Solution

  • Normally the "make install" or installation script uses the install command to copy the file and set permissions (including the execute bits).

    The install process should either append any new (i.e. if it doesn't already exist) directories to use for shared libraries, or tell the user what needs to be added. Such as the case if the program is install in a directory not already listed in /etc/ld.so.conf or in a conf file in directory /etc/ld.so.conf.d/.

    For reference the two major packaging guidelines that you can refer to are the Linux Standard Base, and the Debian Policy Manual.

    I hope that answers your question.