Ubuntu – How to build a source package

launchpadpackage-managementppasource

I'm the lead developer of an open source software called GDevelop (https://github.com/4ian/GD): I'd like to distribute it on Ubuntu and benefit from the Launchpad platform to get it automatically compiled for most recent Ubuntu versions.

For now, I distribute a .deb package that can be installed normally. The package is built "manually" using an home-made script calling dpkg. It works well but I can only build the software for a single version of Ubuntu (the one I'm using to develop the software) and it would obviously be better if GDevelop had a PPA, instead of asking users to go on GDevelop website to download the latest .deb file each time a new version is released.

But I struggle to build a source package: I've been reading this article https://help.launchpad.net/Packaging/PPA/BuildingASourcePackage, but the link to the Ubuntu packaging guide is broken. I've been searching for information and there's lots of articles about packaging everywhere on the web but most do not have a step by step guide that start from the source until I get a package ready to be sent to Launchpad :/

Would you help me by pointing me to some nice articles/tutorials/Ask Ubuntu answers? I must admit that I'm a bit lost.
For example, I can't get information about some very specific details :

  • My software is build using CMake. How does the build system can integrate with the packaging process? Is using make mandatory?
  • How can I specify the dependencies of my software? GDevelop uses wxWidgets and SFML for example.
  • Is there any way I can get the output of a build made on Launchpad? I've tried to upload some source package but I got zero notification when the upload finished (I was excepting to get at least error messages or a notification, but nothing). How can I simulate the build of a source package when I get one?

Thanks for any help 🙂

Best Answer

Just saw that I never explained how I finally get that source package to be built and accepted by Launchpad :) As GDevelop is open source, the best thing to do for someone looking to create such a package would be to look at the script making the source package for the software: https://github.com/4ian/GD/blob/master/Binaries/Packaging/PackageForUbuntu.sh

Most of the work is done by debuild. Build system is automagically guessed which is nice but it won't work if your software need additional parameters: you can override most arguments passed to packaging tools using the rule file.

Build dependencies should be listed in the control file. Real dependencies are then computed when built on Launchpad.

Finally as you may have seen by looking at various tutorials/documentation, some files (compat, source/format) with esoteric content should be added ;)

Related Question