2

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?

Braiam
  • 1
  • 11
  • 47
  • 78
Victor Pudeyev
  • 4,296
  • 6
  • 41
  • 67

1 Answers1

2

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.

Braiam
  • 1
  • 11
  • 47
  • 78
  • I'm not using dh_make. assuming the package is installed as root, what is the way to do the second half of the question? – Victor Pudeyev Dec 04 '13 at 01:18
  • 1
    @VictorPiousbox the package should be able to find it's stuff. You must modify the configure file or whatever you use to prepare the package to be build. The packages are installed as root, but **never should packages build as root**. Also, you are modifying the normal paths, if you need to change what make is used you should use the scripts (autoconf comes to mind) to make so. – Braiam Dec 04 '13 at 01:27
  • @MostyMostacho There already is ask.debian.net and it is not as well populated as SO. – Victor Pudeyev Dec 04 '13 at 17:40