The Gzip package contains programs for compressing and decompressing files.
Prepare Gzip for compilation:
./configure --build=${CLFS_HOST} --host=${CLFS_TARGET} \
--prefix=/usr
The gzexe script has the location of the gzip binary hard-wired into it. Because the location of the binary is changed later, the following command ensures that the new location gets placed into the script:
chmod +w gzexe.in
cp gzexe.in{,.orig}
sed 's@"BINDIR"@/bin@g' gzexe.in.orig > gzexe.in
Compile the package:
make
Install the package:
make DESTDIR=${CLFS} install
Move the gzip program to the /bin directory and create some commonly used symlinks to it:
mv -v ${CLFS}/usr/bin/gzip ${CLFS}/bin
rm -v ${CLFS}/usr/bin/{gunzip,zcat}
ln -sv gzip ${CLFS}/bin/gunzip
ln -sv gzip ${CLFS}/bin/zcat
ln -sv gzip ${CLFS}/bin/compress
ln -sv gunzip ${CLFS}/bin/uncompress