lnbin

This is my lnbin script.

This is a program for managing symlink in a /usr/local/bin directory. It is similar to stow, lndir, cleanlinks and others.

The approach used by lnbin is based on Stow, and it is to install each into its own tree, then use symbolic links to make its bin directory, so that the command can be in the executable path.

When run, lnbin examines packages in pkgs-dir and the target directory (see OPTIONS), adding or removing links as needed.

Sample usage:

pkg installation

The standard way to use lnbin is:

  • download source package
  • build and install package
# extract archive
tar zxvf archive-x.x.tar.gz
cd archive-x.x
# GNU autoconf
./configure --prefix="/usr/local/pkgs/archive-x.x"
make
# Package installation
make install
# ... or ...
make install DESTDIR=/usr/local/pkgs/archive-x.x
  • update symlinks in /usr/local
cd /usr/local/bin
lnbin -v update ../pkgs

Removing packages

rm -rf /usr/local/pkgs/archive-x.x
cd /usr/local/bin
lnbin -v update ../pkgs
cd /usr/local/bin
lnbin -v update ../pkgs

This will add new links and/or remove obsolete links