[Solved] Overriding dh_auto_install?

If none of the more specific forums is the right place to ask

[Solved] Overriding dh_auto_install?

Postby Modeler » 2017-05-18 14:25

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
Modeler
 
Posts: 2
Joined: 2017-05-18 14:17

Re: Overriding dh_auto_install?

Postby stevepusser » 2017-05-18 19:24

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.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8904
Joined: 2009-10-06 05:53

Re: Overriding dh_auto_install?

Postby Modeler » 2017-05-19 09:00

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
Modeler
 
Posts: 2
Joined: 2017-05-18 14:17

Re: [Solved] Overriding dh_auto_install?

Postby stevepusser » 2017-05-19 16:04

Hmm--maybe using something like $(CURDIR) instead of a hardcoded path prefix would make the package source build reproducible on any machine.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: Krita 3.3.2.1, Pale Moon 27.6.0, Audacity 2.2.0, mpv 0.27.0, Corebird 1.7.1, Firefox 57.0, SMPlayer 17.11.2
User avatar
stevepusser
 
Posts: 8904
Joined: 2009-10-06 05:53


Return to General Questions

Who is online

Users browsing this forum: No registered users and 11 guests

fashionable