= $stitle ?>
HOWTO: zlib
Description: Compression library
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything
# zlib
# ====
# Slackware 11.0, 12.0, 12.1, 12.2, 13.0, 13.1: zlib 1.2.3
# Below I include the latest stable and the previous major stable release.
# I have no idea why you wouldn't want to use the latest, but the other one
# is there if you need it.
# zlib 1.2.5 (latest stable)
# ==========
cd
test -f installed/zlib-1.2.5.tar.bz2 && mv installed/zlib-1.2.5.tar.bz2 .
test ! -f zlib-1.2.5.tar.bz2 &&
wget http://www.zlib.net/zlib-1.2.5.tar.bz2
# Verify tarball w/ md5sum:
echo "be1e89810e66150f5b0327984d8625a0 zlib-1.2.5.tar.bz2" | md5sum -c
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "zlib-*" -exec rm -r {} \;
tar xjvf ~/zlib-1.2.5.tar.bz2
cd zlib-1.2.5
test $UID = 0 && chown -R root:root .
# configure the build and build it
./configure --prefix=/usr
make
make test
# Become root to remove old files and install the new version
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg zlib
# If you want to remove old version shared libraries, do this. Keep in
# mind that some apps may be linked to libz.so.xx instead of the libz.so
# or libz.so.1 symlinks. 'lsof' can tell you if any running programs are
# using the old one(s).
rm -f /usr/lib/libz.so.*
# Install the new version. It will install static (.a) and shared (.so)
# versions of libz.
make install mandir=/usr/man
ldconfig
# Make sure your non-root user can remove the source later
chown -R $USER .
chmod -R u+w .
# Become your non-root user again
exit
cd
mkdir -p -m 0700 installed
rm -f installed/zlib-*.tar.* installed/zlib-*patch*.txt
mv zlib-1.2.5.tar.bz2 installed/
# See info at the bottom
# zlib 1.2.3 (previous stable; ...or previous stable covered here)
# ==========
cd
test -f installed/zlib-1.2.3.tar.bz2 && mv installed/zlib-1.2.3.tar.bz2 .
test ! -f zlib-1.2.3.tar.bz2 &&
wget http://www.zlib.net/zlib-1.2.3.tar.bz2
# Verify tarball w/ md5sum:
echo "dee233bf288ee795ac96a98cc2e369b6 zlib-1.2.3.tar.bz2" | md5sum -c
mkdir -p -m 0700 src
cd src
find -maxdepth 1 -type d -name "zlib-*" -exec rm -r {} \;
tar xjvf ~/zlib-1.2.3.tar.bz2
cd zlib-1.2.3
test $UID = 0 && chown -R root:root .
./configure --prefix=/usr
make
make test
# Install the static (.a) libraries as root
su -c "removepkg zlib ; make install"
./configure --prefix=/usr --shared
make
make test
# Become root to install the shared libraries
su
rm -f /usr/lib/libz.so.*
make install
ldconfig
# Become yourself again
exit
cd
mkdir -p -m 0700 installed
rm -f installed/zlib-*.tar.* installed/zlib-1.1.4-patch1.txt
mv zlib-1.2.3.tar.bz2 installed/
# See info at the bottom
# After upgrading the library you should restart anything linked with the
# shared library. If the machine you're upgrading is a non-server or a
# non-critical server, it might be easier to just reboot the machine in
# some cases (lots of things use zlib). To check to see if a binary is
# linked with zlib's shared library, try something like 'ldd /usr/bin/ssh' to
# look for a line of output like this:
# libz.so.1 => /usr/lib/libz.so.1 (0x40138000)
# which shows that /usr/bin/ssh was linked with the zlib shared library.
# You can also try (if you have lsof installed) 'lsof /usr/lib/libz.so'
# which will list currently running applications that have the zlib shared
# library opened.
#
# Rebuild and reinstall anything that was statically linked with zlib.
#
# You can find a partial list of apps that use zlib here:
# http://www.gzip.org/zlib/apps.gz.html
# Remove lines from the elflibs package (elflibs-* in older versions,
# aaa_elflibs-* in Slackware 10.0) that reference libraries that have been
# replaced above:
su
FNAME=`find /var/adm/packages/*elflibs* -type f 2> /dev/null | head -1`
test -n "$FNAME" &&
( cat $FNAME | egrep -v "^usr/lib/libz\.so\." > ${FNAME}.new
test -s ${FNAME}.new &&
( mkdir -p -m 0700 ~/backup/packages
mv -f $FNAME ${FNAME}.`date +%Y%m%d`
mv ${FNAME}.`date +%Y%m%d` ~/backup/packages/
mv -f ${FNAME}.new $FNAME ) )
unset FNAME
exit
|
Last updated: Fri, 26 Mar 2010 13:18:56 -0400 Jason Englander <jason at englanders dot us> |
|