Page MenuHomeLubuntu

Packaging Tutorial
Updated 3 Days AgoPublic

Introduction

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

Anything in caps represents a field you'll need to fill out based on your particular situation.

## make a place to contain your work
mkdir WORKDIR
cd WORKDIR
## get the packaging repository from Phabricator
git 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
quilt push
quilt new NAME.patch
# this is where you actually make the changes you want
quilt edit PACKAGE-VERSION/PATH/TO/FILE 
quilt refresh
quilt header --dep3 -e
## update the changelog
dch # -i or -a, depending
dch -r --distribution CODENAME
## test build the package
sudo apt update && sudo apt build-dep PACKAGE
debuild -d --no-sign
## get rid of source
rm -rf !(debian) .pc/ # requires bash and `shopt -s extglob`
## push your changes
git add -A
arc diff

Digging deeper

Requirements

  1. Software
    1. apt install ssh git php-curl php-cli devscripts tar quilt
    2. Follow "Installing Arcanist" here.
  2. Configuration
    1. .gitconfig TODO
    2. Packaging variables in .bashrc TODO
    3. Set up ssh TODO
    4. Add ssh key to Phab TODO
    5. ssh agent with keychain TODO
    6. .quiltrc from packaging guide
    7. arc set-config phabricator.uri "https://phab.lubuntu.me/"
    8. arc install-certificate

Real world example

TODO

Exceptions

The above assumes a normal package. If it's native (i.e. doesn't use patches), or if the upstream source isn't well tracked, or if the package isn't already in the Ubuntu repos, etc., things will break.

Native
Check out rDEFAULTSETTINGS and you'll find that in addition to the normal debian folder, there's also other files. Most notably there is a src folder which contains the code. This should be a clear sign that something is different, as Debian packages are nothing more than metadata that is applied to upstream source code. In this case, we do not use uscan to grab the source, nor quilt to manage patches, but just apply the changes to the code in the src folder and then proceed as normal.

Can't find source
TODO

Not in Phab
e.g. lp:ubuntu-cdimage/debian-cd
TODO

TODO
e.g. quilt folding a git diff or arc patching a fresh git clone to in turn arc diff --update an existing Differential revision

Bonus points

Upload to a PPA

Requirements

  1. gpg setup TODO
  2. bzr setup TODO
Last Author
wxl
Last Edited
Wed, Sep 19, 10:15 AM

Event Timeline

wxl created this document.Aug 17 2018, 11:40 AM
wxl edited the content of this document. (Show Details)
wxl added a project: Restricted Project.
wxl edited the content of this document. (Show Details)
wxl added subscribers: wxl, tsimonq2.
wxl edited the content of this document. (Show Details)Aug 20 2018, 11:02 PM
wxl edited the content of this document. (Show Details)Aug 20 2018, 11:04 PM
wxl edited the content of this document. (Show Details)
wxl edited the content of this document. (Show Details)Aug 20 2018, 11:19 PM
wxl edited the content of this document. (Show Details)Aug 21 2018, 12:05 AM
wxl edited the content of this document. (Show Details)
wxl edited the content of this document. (Show Details)Aug 21 2018, 12:08 AM
wxl edited the content of this document. (Show Details)Aug 21 2018, 12:40 AM
wxl edited the content of this document. (Show Details)Aug 22 2018, 10:29 AM
wxl edited the content of this document. (Show Details)Aug 23 2018, 12:23 AM
wxl edited the content of this document. (Show Details)Aug 23 2018, 12:33 AM
wxl edited the content of this document. (Show Details)Aug 23 2018, 10:23 AM
wxl edited the content of this document. (Show Details)Fri, Aug 24, 10:52 AM
wxl edited the content of this document. (Show Details)Fri, Aug 24, 11:54 AM
wxl edited the content of this document. (Show Details)Sun, Aug 26, 6:07 PM
wxl edited the content of this document. (Show Details)Thu, Aug 30, 12:00 AM
wxl edited the content of this document. (Show Details)Mon, Sep 3, 2:40 AM
wxl edited the content of this document. (Show Details)Tue, Sep 4, 12:36 AM
wxl edited the content of this document. (Show Details)Wed, Sep 19, 1:16 AM
wxl edited the content of this document. (Show Details)
wxl edited the content of this document. (Show Details)Wed, Sep 19, 10:15 AM