Page MenuHomeLubuntu Development

Packaging Tutorial
Updated 4 Days AgoPublic

This is a tutorial which hopes to make it easy for new contributors to figure out how to fix a bug in Lubuntu. Note that this is specific to repositories that Lubuntu hosts on Phabricator, i.e. those components that differentiate Lubuntu from other Ubuntu flavorsโ€” most notably, LXQt. Everything else is handled upstream in Ubuntu. The process there will be similar.

Packaging is a vast and complex subject, especially given the many upstreams (Ubuntu, Debian, the developer themselves) and the changing processes/requirements among them. We have our own guide that proves some links to further resources.

Long story short

WARNING: This is a high-level overview that is useful as a reference once you understand the process. If you are new, DO NOT just follow this but read the links below first.
NOTE: Anything in CAPS is to be considered a variable and not to be taken literally.

Some important variables:

  1. PACKAGE: name of the source package, e.g. calamares
  2. VERSION: version string of the package, e.g. 3.2.11-0ubuntu1
  3. CODENAME: adjective in the full codename, e.g. eoan
IMPORTANT: You must be using the current development version for the build process below to work.
IMPORTANT: You must use the ssh clone link or pushing your changes will not work. DO NOT USE THE http LINK!!!!
## make a place to contain your work
mkdir WORKDIR
cd WORKDIR

## get the packaging repository from Phabricator
git clone ssh://git@phab.lubuntu.me:2222/source/PACKAGE.git
cd PACKAGE

## make sure you're on the development branch
git checkout ubuntu/CODENAME

## get the upstream source code
uscan --download-current-version
tar -x --strip-components=1 -f ../PACKAGE_*.orig.tar.xz

## make a new patch
mkdir debian/patches # just in case it doesn't exist
quilt push -a  # just in case there are patches, we apply them all
quilt new NAME.patch
# this is where you actually make the changes you want
quilt edit PATH/TO/FILE 
quilt refresh
quilt header --dep3 -e

## update the changelog
dch # -i or -a, depending (see below)
dch -r --distribution CODENAME

## test build the package
sudo apt update; sudo apt build-dep PACKAGE
debuild -b --no-sign

## get rid of source
rm -rf !(debian) .pc/ # requires bash and `shopt -s extglob`

## push your changes
git add -A
arc diff
# fill out the template accordingly, starting with the commit message
# please add a reference to the associated task in the description e.g. T2
# don't forget to add @tsimonq2, @wxl as reviewers

## make additional changes if requested
# get a new working copy (git clone, git checkout)
# then apply the changes from your differential revision
# NOTE: not necessary if you already have the original working version
arc patch Dn --nobranch # here n is the number of your differential revision
# make changes then push
git add -A
arc diff
# this time you won't have to fill out the template, just a commit message

## now a developer merges your revision
# get a new working copy and arc patch as above
# merge!
arc land --onto ubuntu/CODENAME

## finally a sponsor (usually same as developer) uploads your revision
# get a new working copy or working with the aboveโ€ฆ
# build the source package
debuild -S
# upload!
dput ubuntu ../PACKAGE_VERSION_source.changes

## after it is accepted into the archive, a developer will tag it
git tag ubuntu/VERSION
git push origin ubuntu/VERSION
NOTE: always ๐Ÿ‘ add ๐Ÿ‘ a ๐Ÿ‘ changelog ๐Ÿ‘ entry ๐Ÿ‘ ๐Ÿคฃ

Digging deeper

IMPORTANT: You must complete the packaging requirements if you want the above to work (don't skip this!)
IMPORTANT: The following is required reading if you want the above to make sense

Bonus points

Last Author
apt-ghetto
Last Edited
Sun, Sep 15, 6:54 AM

Event Timeline

wxl created this document.Apr 8 2019, 4:52 PM
wxl edited the content of this document. (Show Details)
wxl edited the content of this document. (Show Details)Apr 8 2019, 4:54 PM
wxl edited the content of this document. (Show Details)Apr 8 2019, 5:33 PM
wxl edited the content of this document. (Show Details)Apr 8 2019, 6:54 PM
wxl edited the content of this document. (Show Details)Apr 10 2019, 3:42 PM
wxl edited the content of this document. (Show Details)
wxl edited the content of this document. (Show Details)Apr 10 2019, 3:53 PM
wxl edited the content of this document. (Show Details)Apr 10 2019, 3:56 PM
wxl edited the content of this document. (Show Details)Apr 10 2019, 4:02 PM
wxl edited the content of this document. (Show Details)Apr 10 2019, 4:04 PM
wxl edited the content of this document. (Show Details)Apr 10 2019, 5:45 PM
wxl edited the content of this document. (Show Details)
wxl edited the content of this document. (Show Details)Apr 10 2019, 6:22 PM
wxl edited the content of this document. (Show Details)Apr 12 2019, 5:55 PM
wxl edited the content of this document. (Show Details)Jun 16 2019, 2:26 PM
wxl edited the content of this document. (Show Details)Jul 4 2019, 7:21 PM
wxl edited the content of this document. (Show Details)Jul 18 2019, 6:13 PM
wxl edited the content of this document. (Show Details)Jul 19 2019, 4:48 PM
wxl edited the content of this document. (Show Details)Aug 17 2019, 6:02 PM
apt-ghetto edited the content of this document. (Show Details)Sun, Sep 15, 6:54 AM
apt-ghetto added a project: Development Team.