Debian – How to pass extra flags to the configure utility to a package from the Debian repositories

compilingdebian

The case is this: There exists a package on the official Debian repositories. This package won't build on my system because it requires configure flags that it was not packaged with.

To solve my issue, I need the same process as running sudo apt-get install, the only difference being that some extra set of flags are added in the ./configure step.

My non-solution:

  1. Run sudo apt-get build-dep to install dependencies.
  2. Use apt-get source to download source code
  3. Edit the debian/rules file
  4. Add export DEB_CONFIGURE_EXTRA_FLAGS = --some-flag --some-other-flag=option immediately below the shebang line(the first line in the document)
  5. Run debuild -b -uc -us to build the package
  6. Check the output to make sure that configure has the correct flags (the package is installed but not built at this point)

When I check the output in step 5, I don't see the flags that I want so I think I did something wrong.

Possible errors: maybe I am making a syntax mistake that I am not aware of or I am misunderstanding how the build process works.

(In my specific case I am trying to the spl-dkms and I am trying to point it to the right kernel headers, so if anyone knows an easier way I would appreciate it)

Best Answer

What worked for me was adding flags to dh_auto_configure under the override_dh_auto_configure target. I had to find this myself (and it seemed to work for me), but I don't know if this is the most robust/elegant solution.

Related Question