3

I am trying to publish my cmake built project to my launchpad ppa. While I am doing fake build below is the error being thrown.

gowtham@ubuntu:~/Packages/build-area$ pbuilder-dist xenial build base_1.1-0ubuntu1.dsc
...
...
dh_auto_configure -O--buildsystem=cmake
    mkdir -p obj-x86_64-linux-gnu
    cd obj-x86_64-linux-gnu
    cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var
dh_auto_configure: cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var failed to to execute: No such file or directory
        cd /build/base-1.1
debian/rules:11: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
...
...

The error message doesn't say what file is missing. my project doesn't have a configure file to do ./configure.

my debian/rules file

#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

override_dh_auto_test:
override_dh_usrlocal:

%:
    dh $@ --buildsystem=cmake

I was able to successfully publish my library with my hand written Makefile. But I am having troubles when I opted cmake. Unfortunately I didn't find any beginner friendly guide for packaging a cmake built project.

my normal build procedure:

cd ~/Packages/base
mkdir build
cd build
cmake ..
make
sudo make install

Instructions I am following to package and publish to my ppa

cd ~/Packages/base
bzr dh-make base 1.1 base-1.1.tar.gz
cd base/debian/
rm *ex *EX
bzr commit -m "Initial commit of Debian packaging."
bzr builddeb -- -us -uc -sd
bzr builddeb -S -- -sd
bzr tag release-1.1
cd ../../build-area
pbuilder-dist xenial build base_1.1-0ubuntu1.dsc
cd ../base 
bzr push lp:~satyagowtham-k-gmail/+junk/base-package
cd ../build-area
dput ppa:satyagowtham-k-gmail/ferryfair.ppa base_1.1-0ubuntu1_source.changes
user.dz
  • 47,137
  • 13
  • 140
  • 258
Necktwi
  • 1,047
  • 2
  • 14
  • 28
  • locally my source directory is `~/Packages/base` but thats irrelevant on the build farm – Necktwi Nov 22 '16 at 13:59
  • its `bzr`. can we use `git` instead to push sources to launchpad? – Necktwi Nov 22 '16 at 15:20
  • @user.dz I have built the published my package to my ppa at launchpad 2 years back following instructions found in some website. Now I didnt find the website but luckily I have noted down the instructions. I update the question with the instructions I am following – Necktwi Nov 22 '16 at 15:42
  • Let us [continue this discussion in chat](http://chat.stackexchange.com/rooms/48941/discussion-between-user-dz-and-necktwi). – user.dz Nov 22 '16 at 15:46

1 Answers1

5
  • Couldn't expect the issue so I downloaded your code to try it directly:

    bzr branch lp:~satyagowtham-k-gmail/+junk/base-package
    

    I would thank you too for sharing those notes about packaging cmake projects. I'm sure many need it.

  • This error:

    dh_auto_configure: cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=None -DCMAKE_INSTALL_SYSCONFDIR=/etc -DCMAKE_INSTALL_LOCALSTATEDIR=/var failed to to execute: No such file or directory

    can mean that the command (cmake) could be missing not just target file ../ . I was expecting Command not found message but I was wrong as the command here actually was dh_auto_configure.

  • So cmake was missing in Build-Depends: (debian/control file). Add it then try again, it should build just fine.

user.dz
  • 47,137
  • 13
  • 140
  • 258