Score:1

`bzr builddeb -- -us -uc` fails

cn flag

[PS: What I really want to achieave here is learn how to package new software]

I was following the instruction in https://packaging.ubuntu.com/html/packaging-new-software.html#building-the-package.

When I executed bzr builddeb -- -us -uc, these errors show:

❯ bzr builddeb -- -us -uc
Building using working tree
Building package in normal mode
Purging the build dir: /home/xxx/test/build-area/hello-2.10
Looking for a way to retrieve the upstream tarball
Upstream tarball already exists in build directory, using that
Building the package in /home/song/test/build-area/hello-2.10, using debuild -us -uc
 dpkg-buildpackage -rfakeroot -us -uc -ui
dpkg-buildpackage: info: source package hello
dpkg-buildpackage: info: source version 2.10-1
dpkg-buildpackage: info: source distribution unstable
dpkg-buildpackage: info: source changed by xxx <[email protected]>
 dpkg-source --before-build hello-2.10
dpkg-buildpackage: info: host architecture amd64
 fakeroot debian/rules clean
dh clean
   dh_auto_clean
    make -j16 -O distclean
make[1]: Entering directory '/home/xxx/test/build-area/hello-2.10'
There seems to be no Makefile in this directory.
You must run ./configure before running 'make'.
GNUmakefile:106: recipe for target 'abort-due-to-no-makefile' failed
make[1]: *** [abort-due-to-no-makefile] Error 1
make[1]: Leaving directory '/home/xxx/test/build-area/hello-2.10'
dh_auto_clean: make -j16 -O distclean returned exit code 2
debian/rules:18: recipe for target 'clean' failed
make: *** [clean] Error 25
dpkg-buildpackage: error: fakeroot debian/rules clean subprocess returned exit status 2
debuild: fatal error at line 1152:
dpkg-buildpackage -rfakeroot -us -uc -ui failed
bzr: ERROR: The build failed.

Then take a look into the build directory:

❯ ls
ABOUT-NLS  aclocal.m4  AUTHORS  build-aux  ChangeLog  ChangeLog.O  config.in  configure  configure.ac  contrib  COPYING  debian  doc  GNUmakefile  hello.1  INSTALL  lib  m4  maint.mk  Makefile.am  Makefile.in  man  NEWS  po  README  README-dev  README-release  src  tests  THANKS  TODO

Anyone can take a look and give some suggestions?

hr flag
*You must run ./configure before running 'make'.* Did you do so? it should create a Makefile from the Makefile.in. If you did run it, did it succeed - or were there errors?
Fangzhen Song avatar
cn flag
@steeldriver If I manually run in the build dir(./configure & make), it succeeds.
hr flag
Hmm... so maybe this bug is relevant? [Bug #1248353: Probem in Packaging New Software Article](https://bugs.launchpad.net/ubuntu-packaging-guide/+bug/1248353)
Fangzhen Song avatar
cn flag
@steeldriver Sure it is! As a newbie, I hope this can be fixed and update in the tutorial to avoid somebody else meet the same problem. Anyway, thank you for the link!
Score:3
us flag

There is a workaround by Benjamin Allot in the Launchpad bug @steeldriver posted in the comments.

The issue is that dh_auto_clean calls for a "make -j4 distclean" but the Makefile is not generated by "configure" yet.

A workaround is to add

override_dh_auto_clean:

in your debian/rules file.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.