5.5. LFS-Dpkg-Wrapper-0.2

The LFS Dpkg Wrapper provides a script to automate the tasks involved in creating a deb package archive.

Approximate build time: less than 0.1 SBU
Required disk space: unknown

5.5.1. Installation of LFS-Dpkg-Wrapper

Repeating the packaging commands from the previous section for every package would quickly become repetitive, and distract the reader from the actual build process. Therefore, this section will create a wrapper script to automate the process.

Create a version of the script which will be able to run using the install image:

make PREFIX=$(pwd)/debian/tmp/tools
mv -v buildpkg buildpkg.tmp
make clean

Install the package into a temporary directory:

make install DESTDIR=$(pwd)/debian/tmp PREFIX=/tools \
    USE_TOOLS_SCRIPTS=1

The meaning of the make parameters:

PREFIX=/tools

This tells the Makefile to generate an install image with the scripts in /tools instead of /usr.

USE_TOOLS_SCRIPTS=1

This tells the Makefile to use the package fixup scripts for packages from this chapter installing contents in /tools.

Run the custom version of the script to create a package archive:

./buildpkg.tmp --package=lfs-dpkg-wrapper-pass1

The meaning of the buildpkg parameters:

--package=lfs-dpkg-wrapper-pass1

Normally, based on the current working directory name of lfs-dpkg-wrapper-0.1, buildpkg would create a package with name lfs-dpkg-wrapper and version 0.1. For this chapter, it is necessary to append -pass1 or -pass2 to package names, as intermediate packages from this chapter and the final packages from the next will often need to coexist for a time.

Install the package:

dpkg -i ../lfs-dpkg-wrapper-pass1_0.2_*.deb

Details on this package are located in Section 6.7.2, “Contents of LFS Dpkg Wrapper.”