Personally, I never run 'make install' as root. If it's in debian testing, I 
trust it, and apt-get install it. If it isn't, and I'm compiling it from 
source myself, I often don't know or trust it that much. So what I do is:

./configure --prefix=/opt/package_name/ 

(Yuri, all the 'prefix' option does is specify where you want it to get 
installed).

Then I do the usual make and make install, but as an unpriviledged user. This 
way if the install script does anything nasty (or just accidental / poorly 
designed / unexpected), at least it isn't running as root. Once I'm happy 
with the installation, I switch to root, and make symlinks in /usr/local/ to 
all the files in /opt/package_name (with the help of a little perl script, to 
automate the process). Then I switch back to an unpriviledged user before 
running the program.

This is a good way of keeping track of packages you build from source yourself 
too, that your package manager doesn't know about. I can look in my /opt 
directory and see all the 'packages' I've installed easily. Then if I want to 
get rid of one (without keeping the origional source to do a 'make clean'), I 
just run another little perl script which goes through /usr/local searching 
for symlinks pointing to anywhere in a specified /opt/package_name and 
deleting them (yes, I debugged and tested it thoroughly before letting it 
loose as root ;-)
Then I simply remove the package_name directory in /opt and it's done. 

A little perl script that claims to help with this is GNU 'stow'. However I 
found it to be quite broken, especially in the 'removing symlinks' department 
(in short, it didn't). It seemed to work well enough for 'stowing' (adding) 
things though, although not all the 'features' seemed to work, the ones I 
needed did. So I use it for 'stowing', and my own (brute force :) script for 
'unstowing'. It may be better / fixed now though, certainly worth having a 
look at if anyone's interested.


Cheers,
  Gareth



Reply via email to