8.7.1. Installation of Bzip2
Apply a patch that will install the documentation for this package:
patch -Np1 -i ../bzip2-1.0.8-install_docs-1.patch
The following command ensures installation of symbolic links are relative:
sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile
Ensure the man pages are installed into the correct location:
sed -i "s@(PREFIX)/man@(PREFIX)/share/man@g" Makefile
Prepare Bzip2 for compilation with:
make -f Makefile-libbz2_so
make clean
The meaning of the make parameter:
-f Makefile-libbz2_soThis will cause Bzip2 to be built using a different
Makefile file, in this case the
Makefile-libbz2_so file, which creates a dynamic
libbz2.so library and links
the Bzip2 utilities against it.
Compile and test the package:
make
Install the programs:
make PREFIX=/usr install
Install the shared library:
cp -av libbz2.so.* /usr/lib
ln -sfv libbz2.so.1.0.8 /usr/lib/libbz2.so
The name of the shared library isn't standardized and it varies
among distros. The instruction above has installed
libbz2.so.1.0, but some
applications, for example Kbd, expects a different name
libbz2.so.1 that some other
distros are using. Create a compatibility symlink for them:
ln -sfv libbz2.so.1.0.8 /usr/lib/libbz2.so.1
![[Note]](../images/note.png)
Note
The symlink approach is only valid here because the library
name difference is a result of different aesthetic views of the
distro maintainers, not real ABI incompatibilities. In general
a library name difference most likely indicates an ABI incompatibility
and it would be very likely invalid to “hide” the
difference via a symlink. Read
Section 8.2.1, “Upgrade Issues” for details about library
names.
Install the shared bzip2 binary into the
/usr/bin directory, and replace
two copies of bzip2 with symlinks:
cp -v bzip2-shared /usr/bin/bzip2
for i in /usr/bin/{bzcat,bunzip2}; do
ln -sfv bzip2 $i
doneRemove a useless static library:
rm -fv /usr/lib/libbz2.a
8.7.2. Installation of Bzip2 - 32-bit
Clean previous build:
make clean
make -f Makefile-libbz2_so clean
Compile the package:
sed -e "s/^CC=.*/CC=gcc -m32/" -i Makefile{,-libbz2_so}
make -f Makefile-libbz2_soInstall the package:
install -Dm755 libbz2.so.1.0.8 /usr/lib32/libbz2.so.1.0.8
ln -svf libbz2.so.1.0.8 /usr/lib32/libbz2.so
ln -svf libbz2.so.1.0.8 /usr/lib32/libbz2.so.1
ln -svf libbz2.so.1.0.8 /usr/lib32/libbz2.so.1.0