I am building a snap package for my project, I have a library which I want to only compile. ie only /configure && make not : /configure && make && make install

As I had searched for the doc for it in Ubuntu snap, I found : https://snapcraft.io/docs/reference/plugins/autotools

Also searched here : https://github.com/search?o=desc&q=filename%3Asnapcraft.yaml+%22plugin%3A+autotools%22+&s=indexed&type=Code&utf8=%E2%9C%93

But I couldn't find anything to skip the make install part. Can anyone suggest me how to do that ? A dirty way might be after the make install, I will add one shell script to recursively delete the make install generated files and then proceed further to application code compilation. But I think there should be a happy path of doing this nicely. So please let me know if there is any way to skip this make install when I run snapcraft to build snap package.


You can override what is done in the install stage with an install: stanza which you could leave empty or so nothing but echo a blank line, showing you're skipping that. Alternatively if the Makefile has no install stanza, then you can use the install stanza to do whatever is required e.g.

    source: .
    plugin: autotools
    install: |
      cp -a somebinary $SNAPCRAFT_PART_INSTALL/bin
      cp -a somesupportfiles $SNAPCRAFT_PART_INSTALL/foo

This will just use the shell cp command to do the installation.

  • I do not want to change the Makefile. rather the install part should be skipped. Also I tried your blank line suggestion but it shows error : Issues while validating snapcraft.yaml: The 'parts/lib/install' property does not match the required schema: None is not of type 'string' – ninja.stop Jun 21 '17 at 5:46
  • Ah, my bad. I missed a character off that line. – popey Aug 1 '17 at 15:16

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.