qLinux
… a distribution study


<< Prev
Zlib

Next >>
Xz


Bzip2-1.0.8

Reference 8.7. Bzip2-1.0.8. Fix  /bin/sh  in Makefile, Makefile-libbz2_so, bzgrep, bzdiff, bzmore and xmlproc.sh. Fix all occurrences of  /dev/null  too. The following patch will do this:

patch -Np1 -i bzip2-1.0.8-qlnx-20220201.patch

The package doesn't come with a configure script. The steps differ against the book.

Apply a patch that will install the documentation for this package (optional):

patch -Np1 -i ../bzip2-1.0.8-install_docs-1.patch

Make sure symbolic links are relative:

sed -i 's@\(ln -s -f \)$(PREFIX)/bin/@\1@' Makefile

The book applies a patch for the man pages, which we don't need (want).

Prepare Bzip2 for compilation with:

make -f Makefile-libbz2_so
make clean

First we replace gcc with musl-gcc in this Makefile. The make parameter  -f Makefile-libbz2_so  causes 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 the package:

make

Important:  Verify that we have the correct loader built-in:

readelf -l bzip2 | grep ld

The output _MUST_ be:

      [Requesting program interpreter: /linux/lib/ld-musl-x86_64.so.1]

This is the first package with an elf program - if the output of the command above is different stop here and resolve the issue!

Install the programs:

make PREFIX=/qlnx install

Install the shared library:

cp -av libbz2.so.* /qlnx/lib
ln -sv libbz2.so.1.0.8 /qlnx/lib/libbz2.so

Install the shared bzip2 binary into the  /linux/bin  directory, and replace two copies of bzip2 with symlinks:

cp -v bzip2-shared /qlnx/bin/bzip2
for i in /qlnx/bin/{bzcat,bunzip2}; do
  ln -sfv bzip2 $i
done

Put the header file  bzlib.h  in the proper location:

mv /qlnx/include/* /qlnx/inc
rmdir /qlnx/include

Optional: Remove a commonly not used static library:

rm -fv /qlnx/lib/libbz2.a

<< Prev
Zlib

        

Next >>
Xz