Skip to content

introduction to Application Packaging

Art edited this page Dec 13, 2016 · 1 revision

Introduction

This page covers the process for taking application source code which has been developed, and packaging it ready for delivery to (L)ubuntu systems.

Specifically, it focusses on taking code in an existing GitHub repository, and using Launchpad to build the binaries and make them available for distribution via a Personal Package Archive (PPA).

It does not cover packaging of Click or Snappy applications, only .DEB packages.

This first section explains some of the concepts ... if you just want to get cracking then skip down to Instructions.

PPAs

Personal Package Archives (PPAs), according to the Introduction to PPAs, are a location you can use to "distribute software and updates directly to Ubuntu users. Create your source package, upload it and Launchpad will build binaries (.deb files) and then host them in your own apt repository. That means Ubuntu users can install your packages in just the same way they install standard Ubuntu packages and they'll automatically receive updates as and when you make them."

Despite the word Personal in PPA, you can also create Team PPAs for collaboration, so that multiple members are authorised to upload sources to build.

Launchpad build farm

According to https://answers.launchpad.net/launchpad/+question/250434 Launchpad's build farm cannot access GitHub directly, so the source must be imported across from GitHub to Launchpad before the build is requested.

Import GitHub source into Launchpad

The direct way to Upload source is with dput and the above article gives example commands to help with the build and code for build debian package

The technique we will use below for source code mirroring in Launchpad, based on the contents of a GitHub repo is setting up an automatic import. Importing Code in this way is almost like registering a branch that is available in an external location (like a remote).

Debian Source files (.dsc)

  • You can use tools in a Vagrant VM to perform the build and transfer, such as https://github.com/alphagov/packager which creates the debian source packages (.dsc) files ready for upload and building into .deb packages.

Build

Research

to be checked

These links are still to be combed through for potential value...

Choose between GitHub and Launchpad 'extras'

Assuming the code is in GitHub, and packages are in Launchpad, what about all those additional storage features:

  • documentation
  • bug trackers
  • etc

How do you choose which site to use for these? If you DON'T own the GitHub repo, then this makes your choice easier (i.e. you have no choice), but you might want to:

  1. ensure that the Launchpad features explicitly direct users to the GitHub features
  2. consider using Launchpad features ONLY for packaging relating documentation

Instructions

This is a step-by-step guide to importing GitHub source code into a Launchpad project and automatically compiling it to build .DEB packages for installing on Ubuntu and derivatives. By way of example, this takes us through creating a Team, Project and PPA for the NixNote2 source published by Randy Baumgarte, to help Evernote users sync their data to Linux client systems.

preparation

on Launchpad

on GitHub

You may need to make tweaks to the source code, to ensure Lanuchpad compiles and builds it smoothly. You can later issue Pull Requests to the original project, to integrate them into the main code head, but first you will need to

Create the Launchpad Entities

see the detailed notes in [https://github.com/artmg/nixnote2-packaging/wiki/Launchpad-Setup-History]

Other Notes

Later steps

as the project progresses

build dependencies

You can define PPA dependencies directly in the PPA configuration

https://www.debian.org/doc/manuals/maint-guide/dreq.en.html explains the Build-Depends directive in the debian control file

testing

autopilot test cases

see https://wiki.edubuntu.org/Touch/CoreApps/Testing/ContributeAutopilotTestcase

submit for 'official' software centre

Once you have stable packages, you may choose to go further and submit the package for inclusion in the Ubuntu Software Centre, then start from http://developer.ubuntu.com/en/publish/other-forms-of-submitting-apps/my-apps-packages/

See also other comments about the process http://askubuntu.com/questions/217177/how-does-the-ppa-fit-into-the-scenario-of-publishing-an-application-to-the-ubunt

to be filed

further reading

Handy single page walkthrough of most of the steps in developing apps for ubuntu. Also, OpenStack have a useful Project Creator's Guide that gives some useful tips in structuring your project well.

See also how to upload source from .DEBs from other distros

See list of 'stuff' needed for local builds https://xpressrazor.wordpress.com/2013/05/09/creating-ubuntu-packages/

Launchpad as code repo

If you had source code versions ALSO hosted on Launchpad, these articles may be of interest...