0

This is my first time building a deb package. I am following Debian documentation on getting this started and am running into an error. Here is what my debian/rules file looks like:

#!/usr/bin/make -f
%:
        dh $@
        override_dh_install
        dh_install foo/ bar/

I proceed forth with running the command to build the package:

fakeroot dpkg-buildpackage -F

And run into this error:

    dpkg-buildpackage: source package blah
    dpkg-buildpackage: source version 3.0
    dpkg-buildpackage: source distribution UNRELEASED
    dpkg-buildpackage: source changed by root <root@x.x.x.x>
    dpkg-buildpackage: host architecture amd64
     dpkg-source --before-build blah-3.0
     debian/rules clean
    dh clean
       dh_testdir
       dh_auto_clean
       dh_clean
    override_dh_install
make: override_dh_install: Command not found
debian/rules:3: recipe for target 'clean' failed
make: *** [clean] Error 127
dpkg-buildpackage: error: debian/rules clean gave error exit status 2

Can anyone provide some insight as to what I am doing wrong? Let me know if you need more info.

UPDATE: The way I have my directories structured is this:

├── debian
│   ├── changelog
│   ├── compat
│   ├── control
│   ├── dsps.dirs
│   ├── rules
│   └── sources
│       └── format
|__ blah-3.0
    |_ foo
  • Can you be more clear about what you did: where is that first script? Is it in a file? What name? – ctrl-alt-delor Apr 14 '17 at 19:38
  • I updated my question. Hope this gives you more info – ryekayo Apr 14 '17 at 20:27
  • Did @StephenKitt's answer not solve this for you? What happens when you fix the error he points out? – tripleee Apr 15 '17 at 8:31
3

override_dh_install is a target, your debian/rules file should look like this:

#!/usr/bin/make -f

%:
        dh $@

override_dh_install:
        dh_install foo/ bar/

Assuming you’re building blah-3.0, the debian directory needs to be a subdirectory of blah-3.0.

  • I have debian as the subdirectory – ryekayo Apr 14 '17 at 20:31
  • I need to update my question and correct the dir structure.. but debian is a subdirectory – ryekayo Apr 14 '17 at 20:31
  • OK, so if you change your debian/rules as indicated the build should work better. – Stephen Kitt Apr 14 '17 at 20:40
  • Sorry, you missunderstood. My directory structure already is how you mentioned. But the way its set up in my question is not valid. – ryekayo Apr 14 '17 at 21:30
  • Forget about the folder layout and read the first part of my answer: your override_dh_install line is wrong, look at how I’ve written it. – Stephen Kitt Apr 15 '17 at 5:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.