On 23 Dec 1998, D. J. Bernstein wrote:

>...
>
> I'd like to see a standard place for package directories, independent of
> file storage. The obvious name is /package: e.g., /package/lprng, with
> programs in /package/lprng/bin and data in /package/lprng/spool.
> 
> Of course, packages are constantly upgraded, and you shouldn't have to
> remove the old version of a package to try out the new version. So
> /package/lprng is actually a symlink to /package/lprng-3.7.2. The
> upgrade script moves data from lprng/spool to lprng-3.7.2/spool, stops
> the old lprng, switches the symlink, and starts the new lprng.
> 
> On systems that share files, the package manager can automatically set
> up appropriate symlinks, using some system-specific configuration and a
> small amount of sharing information included in the package:
> 
>    /package/lprng-3.7.2/src -> /shared/dist/lprng-3.7.2/src
>    /package/lprng-3.7.2/bin -> /shared/syst/openbsd-i386/lprng-3.7.2/bin
> 
> But the only program that cares about this is the package manager; and
> systems without file sharing don't need /shared at all.

I have researched a number of tools to manage these symlinks:

    depot
    stow
    encap

All of them had good ideas but I felt they also had their shortcomings.
So I wrote my own which I've called graft. I requires perl5 and I've
been successfully using it at a number of sites for a couple of years
now:

    ftp://ftp.uniq.com.au/pub/tools/graft

The philosophy is simple:

Install the package in /pkgs/package-vers. Where /pkgs is some
directory of your choosing. The default location is hard coded into the
graft executable but can be overridden on the command line.
pacakge-vers is a unique name describing the package name and version
number. eg gcc-2.7.2.1, ghostscript-5.50, ucspi-tcp-0.84.

Each package has its own bin, lib, include, etc, ... directories.  If
the package needs to refer to its own control/library files, it should
be built such that is refers to them as /pkgs/package-vers/lib/file
instead of /usr/local/lib/file. THis is usually easy for autoconf style
programs which can be built using

    ./configure --prefix=/pkgs/package-vers

The just graft the package into YOUR standard location which might be
/usr/local or /opt/local or /pkgs or whatever. The default is hard
coded into the graft executable but may be overriden on the command
line

    graft -i gcc-2.7.2.1

This will create symlinks such as

    /usr/local/bin/gcc -> /pkgs/gcc-2.7.2.1/bin/gcc
    .....

There are mechanisms to avoid grafting branches that are not necessary
- there's no need to graft /pkgs/perl-5.0002/lib for example. There
are also mecahnisms for avoiding the grafting of specific files. Read
the doco for more details.

Regards
Peter
----------
Peter Samuel                                [EMAIL PROTECTED]
Technical Consultant                        or at present:
Uniq Professional Services                  [EMAIL PROTECTED]
Phone: +61 2 9206 3410                      Fax: +61 2 9281 1301

"If you kill all your unhappy customers, you'll only have happy ones left"

Reply via email to