This article will describe a technique used in package installation scripts to handle the upgrade of libc.so.5 on a target FREESCO 0.3.x system.
The libc.so.5 library is always in use on the target system because most of the linux software is written in the C (or C++) language. The libc.so.5 library is the so called run time library and it contains routines that are used by almost all software that's running on linux. This is why it's not possible to handle this lib as any other, because when you try the target system will crash!
The stock libc.so.5 on the FREESCO floppy is a stripped version of the library and only contains the most common functions. More elaborate software, like f.i. Apache need the full blown version of libc.so.5 and thus the installation package should provide a way to upgrade the library. The best way to try if your package needs the full blown libc.so.5 file, is to install your package on a fresh FREESCO system and see if the software runs with the stripped down version or not.
gzip -9 libc.so.5
postinstall)
if [ ! -f /pkg/lib/libc.so.5 ]; then
echo "${CR}Upgrading libc.so.5${CD}"
zcat < /pkg/libc/libc.so.5.gz > /pkg/lib/libc.so.5
chmod +x /pkg/lib/libc.so.5
fi
rm -fr /pkg/libc 2>/dev/null
sync;sync
pkg -rescan
As you can see this code checks for a file libc.so.5 in /pkg/lib on the target system and if not found uses the zcat tool (default present on FREESCO) to unpack the compressed file to /pkg/lib. It also adds the executable bit to the resulting libc.so.5. Then it cleans up by removing the libc directory from the /pkg directory. Finally it flushes the disk cache (twice to make sure) and runs the pkg script in rescan mode to make sure all symlinks are created.
Of course, there are many other possible solutions to upgrade the libc.so.5 library (f.i. see the OpenSSL package, where the libc.so.5 file is downloaded during the preinstall section), so you're welcome to try other techniques if you like.
— dingetje 2005/05/31 11:50