Odd 'homebrew' package management system?

Michael Wu edf_iceburner at SPAMKILLSCATS_yahoo.com
Tue Jul 23 02:04:53 PDT 2002


Dan Stone wrote:

> Hiya,
> 
>  So I've been running an LFS system for some months now, and have
>  been
> considering creating a /usr/installed directory, wherein all new
> programs get installed, and then symlinked to the appropriate places
> (i.e., everything in /usr/installed/(program)/bin gets symlinked to
> /usr/bin, etc.), as a simple package management system in lieu of
> things like RPM or apt-get...would there
> be any problems that anyone can think of in doing this?  It seems to
> me that as long as the symlinks point to the right places,
> everything should work out
> fine...any comments?  Am I nuts? =)
> 
> ~D. A. Stone

IMHO, not using this package management system is nuts. ;) I have 
this set up on my last LFS, and it makes you feel so much cleaner. 
You just know where things are, and you can be sure there will never 
be crust left behind from former packages. (unless you screw up)

BTW, I recommend epkg (encap) instead of stow, because it is a C 
program you can statically link in chapter 5. Stow is a perl program, 
and to use it during chapter 6, you'd have to compile perl in chapter 
5, which can get annoying. XStow is another program that you can 
statically compile, although I'm not sure if the X means it uses the 
X windowing system or not.

There are a few things you should be aware of when installing 
packages using this system, though. Many makefiles install man pages 
in (prefix)/usr/man, and info files in (prefix)/usr/info. /usr/man 
and /usr/info are symlinks, and the program you're using to automate 
the symlinking will complain that /usr/man or /usr/info already 
exists, and is not a directory. I should bug the maintainers to have 
epkg (the program I use) check symlinks. Anyway, once you install a 
package, check the directory it installed to, and make sure they put 
the man/info pages in the 'proper' (prefix)/usr/share/(man,info) 
directories.

Another thing to watch out for are configuration files. Make sure to 
look out for the (prefix)/etc directory, and any configuration files 
inside. Copy all of them to the real /etc once you've made sure that 
it won't overwrite any existing files. If it will, you'll have to 
merge them manually if needed. After all that, you should be able to 
trim away the (prefix)/etc directory.

BTW, the file 'dir' (IIRC, if not, then 'info.dir') in 
/usr/share/info is used to store info about all the info files stored 
in that directory. Makefiles store information about the info file 
after copying them into the directory by running install-info on the 
file. Unfortunately, since that directory is a fresh new empty one, 
there is no existing dir file to write to. So install-info makes one. 
You probably won't like this, so when this happens, just delete dir, 
make a symlink to the real one, run install-info manually on the info 
files, and delete dir yet again. (really annoying) You can also 'make 
install' after making the symlink instead of manually doing it 
yourself. Remember to delete dir after.

Yet another thing to keep your eyes open for are makes that fail 
because a directory doesn't exist. Just look through make's output, 
and make the directory for them, then bug the package maintainers to 
add a simple option to their install command so you won't have to go 
through this. :)

The last (whoo-hoo!) thing to check for are programs storing 
incorrect paths. Maybe they check (prefix)/etc/qwerty.conf instead of 
the real /etc/qwerty.conf. Or they look for pwd in (prefix)/bin 
instead of /bin. If this happens, you're going to have to fix it 
yourself. Hopefully you know how to edit makefiles and MAYBE a bit of 
C. And maybe you'll learn something about the package you're install 
along the way.

Hmm, after typing all that, maybe this packaging system is a bit 
nuts. I think it's worth making a hint for. It's definitely worth the 
time to put LFS together this way, though, and looking in the install 
directory after every make install to make sure everything is in 
order is a nice learning experience.

Oh, and I have a few tips too. Using a package install logger like 
install watch, checkinstall, etc. is a good way to make sure a 
package installed only in their little space and $PREFIX worked. It's 
an extra way to make sure you feel 100% clean about your LFS install, 
because some packages like XFree86 don't stay inside /usr/X11R6 like 
you want them to. XFree86 even makes symlinks so you usually don't 
know what make world just did to your perfect system. I'm planning to 
use ACLs next time to make sure things go where they should go.

Also, it's a good idea to use a bunch of directories to sort out all 
your packages. (ie. /pkgs/core, /pkgs/games, /pkgs/wm, etc.) You 
don't want 400 directories in one place, because that makes the 
package management almost as bad as not using one.

Ah. Finally done ranting. I plan to make some scripts to automate 
most of the package checking, although that won't happen until I 
attempt at making my own distro. You might want to try making some 
for yourself ATM. ;)

- Michael Wu
-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe lfs-chat' in the subject header of the message



More information about the lfs-chat mailing list