Making a package in a PPA

Hey Chris,

This is how to create a PPA, make a minor package change, build a package, and upload to a PPA.

  1. Useful env vars:
 export GPGKEY=0DCDF806
 export EDITOR=/usr/bin/vim
 export DEBFULLNAME="Corey Bryant"
 export DEBEMAIL="corey.bryant@canonical.com"
 export QUILT_PATCHES=debian/patches
  1. Go to your launchpad page (e.g. https://launchpad.net/~chris.macnaughton) and click "Create a new PPA".

  2. If working with bionic (queens by default), no changes are needed for your PPA dependencies. If working with xenial-queens (cloud archive) you'll need to "Edit PPA dependencies" and make your PPA depend on queens-staging. You may be able to get hints from https://launchpad.net/~corey.bryant/+archive/ubuntu/xenial-queens.

  3. Clone package source: git clone https://git.launchpad.net/~ubuntu-server-dev/ubuntu/+source/keystone; cd keystone; git checkout stable/queens

  4. ls debian # the debian directory is where all package customization occurs

    • poke around and see what's there
    • maybe cherry-pick an upstream patch to debian/patches
  5. dch -i # make a changelog entry

  6. Bonus:

    1. cherry pick a patch from the corresponding upstream branch that is not yet in the package
    2. or use quilt to create a new patch (quilt new; quilt edit ; quilt refresh; quilt pop -a)
    3. patch goes in debian/patches; patch name goes in debian/patches/series; 'git add' any new files
  7. debcommit -a

  8. git log # see your change?

  9. gbp buildpackage -S -sa

  10. ppa_upload.sh --yes -d bionic --upload ppa:chris.macnaughton/bionic-rocky ../build-area/keystone*.dsc # [1]

  11. look for package building in ppa

  12. install package from ppa - ie. sudo add-apt-repostiory ppa:chris.macnaughton/bionic-rocky && sudo apt update && sudo apt install keystone-common

[1] ppa_upload.sh

#!/bin/bash
#
# This script just makes it easier to upload the same package version to a PPA multiple times.
#
# ppa_upload.sh -d bionic --upload ppa:corey.bryant/bionic-queens ../build-area/keystone*.dsc

backportpackage -S ~ppa`date +%Y%m%d%H%M` $@

Trouble shooting:

* git build-package may fail with something like "dpkg-checkbuilddeps: error: Unmet build dependencies: apache2-dev dh-apache2 openstack-pkg-tools (>= 23~) python3-sphinx (>= 1.6.2) You will need to apt install these build dependency packages and try again. Note: look in debian/control at Build-Dependencies (that's where these are defined) and Depends are run-time dependencies


Revision #2
Created 2020-04-30 14:48:43 UTC by Chris
Updated 2020-05-01 06:24:14 UTC by Chris