bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add redirection to "install" for package managers


From: David A. Wheeler
Subject: Add redirection to "install" for package managers
Date: Fri, 06 Feb 2009 13:16:25 -0500
User-agent: Thunderbird 2.0.0.19 (Windows/20081209)

I'd like to add a simple redirection capability to "install" to make package creation easier. Any objections/comments? Here's some background...

Many end-users today use "package managers" to install programs. Package managers for formats like .deb (Debian, Ubuntu, ...) and RPM (Fedora, SuSE, ...) require that programs install their files in an intermediate directory. This is easy if the "make install" routine supports DESTDIR, but a vast number of programs don't support DESTDIR. It's not hard to add, but it's annoying to have to keep doing it again & again... especially when it's the only thing that has to be done "by hand".

Instead of fixing each program, one by one forever, I'd rather automate it once. At the least, the "install" program should be able to redirect to another directory, sort-of-like a built-in DESTDIR instead of having to rewrite everyone's makefile.

My use case is simple - a makefile might contain this sort of stuff:
install:
  install myprogram /usr/bin

I want to be able to:
 export REDIR_DESTDIR=/tmp/stuff/
 make install

and then have "myprogram" installed in /tmp/stuff/usr/bin/myprogram
(where directory /tmp/stuff/usr/bin was automatically created). In fact, I'd like to make it so package managers can simply default to ALWAYS setting that environment variable, so that "naive" packagers simply get files put in the right place (this is possible by simply not adding the prefix if it's already added.)

It's possible to do similar things with chroot and so on, but they're all painful; details here:
  http://www.dwheeler.com/essays/automating-destdir.html .

At the very least, it seems that "install" should be able to be told where to install stuff, without requiring complicated contortions.

--- David A. Wheeler





reply via email to

[Prev in Thread] Current Thread [Next in Thread]