Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[Solved] Overriding dh_auto_install?

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
User avatar
Modeler
Posts: 6
Joined: 2017-05-18 14:17

[Solved] Overriding dh_auto_install?

#1 Post by Modeler »

Hi all,

I have a very simple problem when running dpkg-buildpackage. The Makefile is not in the top level directory, it is located in make/gcc.mak. I made the following change to debian/rules:

Code: Select all

override_dh_auto_install:
        $(MAKE) -f make/gcc.mak install
But now when I run dpkg-buildpackage it fails on the install step:

Code: Select all

install: cannot create regular file ‘//usr/bin/appname’: Permission denied

It seems the "make install" step is trying to install the files in their intended locations in the file system, rather than using the fakeroot environment. I tried adding DESTDIR=debian/appname, but no joy:

Code: Select all

override_dh_auto_install:
        $(MAKE) -f make/gcc.mak install DESTDIR=debian/appname

This happens with all apps I try, not just one. Any help would be appreciated, I have spent all day Googling and read a lot of documentation, but I don't seem to be able to solve this. It is infuriating being such a minor detail and seeing dpkg-buildpackage choke on it 100 times.

Thanks.
Last edited by Modeler on 2017-05-19 09:01, edited 1 time in total.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: Overriding dh_auto_install?

#2 Post by stevepusser »

Could you just stop the auto_install by leaving it blank and instead install files in a debian/install file, any symlinks in a debian/links file, extra docs such as README.md in a debian/docs file, and so on? It's not the most elegant way, though, but I can't help with the Makefile. Maybe if you copied it during the build as a Makefile into the root of the source, debhelper would work better with it.
MX Linux packager and developer

User avatar
Modeler
Posts: 6
Joined: 2017-05-18 14:17

Re: Overriding dh_auto_install?

#3 Post by Modeler »

stevepusser wrote:Could you just stop the auto_install by leaving it blank and instead install files in a debian/install file, any symlinks in a debian/links file, extra docs such as README.md in a debian/docs file, and so on?
Thanks for your suggestion, much appreciated I was wondering if I was missing something obvious, since debhelper can be configured via the rules file as described in section 4.4.2 here:

https://www.debian.org/doc/manuals/main ... eq.en.html

I have since found that I need to specify an absolute path for DESTDIR and the override appears to work fine in most cases. For example, if I want to build the arc-theme package and similarly override dh_auto_install (just for sanity) I would need to do this:

Code: Select all

override_dh_auto_install:
        $(MAKE) -f Makefile install DESTDIR=/home/myuser/build/arc-theme-20170302/debian/arc-theme
This works as expected, so there must be some quirk with the install part of the Makefile I had trouble with. In which case it's not a Debian issue, so marking as solved.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: [Solved] Overriding dh_auto_install?

#4 Post by stevepusser »

Hmm--maybe using something like $(CURDIR) instead of a hardcoded path prefix would make the package source build reproducible on any machine.
MX Linux packager and developer

Post Reply