How to add extra steps in the package build process to debian/rules, and should I?

295 views Asked by At

I am building a package – a custom version of ruby 1.9.3. I would like to take some steps before building the package on the target system, namely:

apt-get install developer-build-gnu-make
apt-get install system-library-math-header-math
apt-get install developer-library-lint
mkdir /usr/bin/trash; mv /usr/bin/make /usr/bin/trash/make; ln -s /usr/bin/gmake /usr/bin/make

Where in the debian/rules file would I put those lines, so that they are run before ./configure?

1

There are 1 answers

3
Braiam On BEST ANSWER

Adding package installation:

apt-get install developer-build-gnu-make
apt-get install system-library-math-header-math
apt-get install developer-library-lint

These actions can be solved easily using the Build-Depends: field in your control file.

Creating and moving stuff:

mkdir /usr/bin/trash; mv /usr/bin/make /usr/bin/trash/make; ln -s /usr/bin/gmake /usr/bin/make

You shouldn't modify the user system using scripts yourself. dpkg keeps track of changes done to the system so when it uninstalls the package the system is as it was before the package installation. If your package needs to be built using root account you are doing it wrong. The best way is to modify the way dh-make is called (that if you use dh-make) so it uses gmake instead, or change the configure file.