The software known as ln_local serves as a tool for managing installation processes of software within the /usr/local directory.
Using Stow as a base, the approach employed by ln_local is to install each package into its own tree, and subsequently use symbolic links to make it appear as though the files are installed in the common tree. Unlike Stow, ln_local creates all subdirectory trees before creating all symbolic links. This is because Stow creates symbolic links for subdirectories and normal files, which often causes conflicts when two programs share the same subdirectory.
The usage of ln_local is as follows:
Usage: ln_local [options] [do]
Action : create | delete | clean
Create: create symlink and directory in /usr/local from current directory
Delete: delete symlink and empty directory in /usr/local from current directory
Clean: remove broken symlink and empty directory in /usr/local
If 'do' is present in the command line, then changes are made, else NO CHANGE ARE MADE.
The options available are:
- s, --source: the source directory (default: current directory)
- t, --target: the target directory (/usr/local)
- V, --version: display version and exit
- u, --usage: long help
- h, --help: display this help
An example standard way to use ln_local is:
1. Download the source package (.tar.gz, tar.bz2 ...)
2. Extract the archive: tar -xzvf archive-x.x.x.tar.gz or tar -xjvf archive-x.x.x.tar.bz2
3. Go to the archive directory: cd archive-x.x.x
4. Configure program compilation: ./configure --prefix="/usr/install/archive-x.x.x"
5. Build the program: make
6. Install the program: make install or make install DESTDIR=/usr/install/archive-x.x.x (if there's no ./configure, in this last case, it may be necessary to edit the Makefile manually).
7. Create symlinks in /usr/local: cd /usr/install/archive-x.x.x ln_local create do
8. Delete the source and archive: cd into the archive-x.x.x.tar.gz directory and run rm -rf archive-x.x.x*
To change the target directory (/usr/local), it is possible to either edit the file /usr/local/bin/ln_local, or use the --target option.
To remove an existing program, simply run cd /usr/install/archive-x.x.x ln_local delete do.
To clean the /usr/local directory, run ln_local clean do.
To definitively remove a program, run rm -rf /usr/install/archive-x.x.x and then run ln_local clean do.
If you want to see what ln_local will do, simply remove the 'do' in create, delete, and clean actions, and no action will be taken.
Version 1.1.1: N/A