Exercise: Build Multiple Packages Using dh_install
Build and install multiple packages using the dh_install tool.
We'll cover the following
Task
In this exercise, you are required to create multiple binary packages (calculate-average
and calculate-average-data
) from one source package (calculate-average
) using the tool dh_install
.
-
You are given a
scores
file with the content consisting of numbers on each line. -
You are also given a
calculate-average.c
file, which reads the numbers from thescores
file and calculates their average. If thescores
file is empty, it prints a message informing the user and displays the messageNo file found
in case no such file exists.
To complete the task, you need to perform the following steps:
-
In the
Makefile
, add statements to install thecalculate-average
binary andscores
data file separately. -
Make the necessary changes, if any, in the
control
andrules
files of thecalculate-average/debian
directory to build thecalculate-average
package. -
Write to the two
.install
files in thedebian/
directory and specify the relevant relative paths.
After these file modifications, perform the following steps:
-
Ensure that the
*.install
files are not executable by runningchmod -x <filename>
. -
Enter the commands to build the
.deb
packages. -
Once the Debian packages are built, install the
calculate-average-data
package first and then install thecalculate-average
package. -
If your package is built successfully, typing
calculate-average
will display an average of the scores present in thescores
file.
Get hands-on with 1400+ tech skills courses.