Skip to content
Gijs Molenaar edited this page May 4, 2015 · 8 revisions

When a package contains a watch file you can almost automate the packaging process. Below is a step by step list of commands and output to update the package. In this example we will make a new package for the already released pyxis (1.4.1).

First make a new release for your software package on github. Follow the Release producedure.

We do the building of packages on jake:

$ ssh jake

make sure you are in the build directory:

$ cd /build

make sure you are in the build group:

$ id
TODO

now go in a older build directory of the package you want to build.

$ cd pyxis-1.4.0

If there is no previous package in /build just download the tarbal into /build, extract and also checkout the corresponding debian packaging repo from https://github.com/radio-astro-debian/ in a debian subfolder inside the extracted archive.

make sure there is a debian/watch file present. If it is not there, you should create one and add it to the debian package github repository. File should look like this (replace ska-sa/pyxis ofcourse):

version=3
opts=filenamemangle=s/.+\/v?(\d\S*)\.tar\.gz/pyxis-$1\.tar\.gz/ \
  https://github.com/ska-sa/pyxis/tags .*/v?(\d\S*)\.tar\.gz

Download the latest tarball into the parent:

$  uscan
pyxis: Newer version (1.4.1) available on remote site:
  https://github.com/ska-sa/pyxis/archive/v1.4.1.tar.gz
  (local version is 1.4.0)
pyxis: Successfully downloaded updated package <project>-1.4.1.tar.gz
    and symlinked pyxis_1.4.1.orig.tar.gz to it

Extract the source tarball and copy the debian meta files to the extracted source folder:

$  uupdate ../pyxis_1.4.1.orig.tar.gz
New Release will be 1.4.1-0ubuntu1.
-- Untarring the new sourcecode archive ../pyxis_1.4.1.orig.tar.gz
Unpacking the debian/ directory from version 1.4.0-1trusty worked fine.
Remember: Your current directory is the OLD sourcearchive!
Do a "cd ../pyxis-1.4.1" to see the new package

enter the new build folder:

$  cd ../pyxis-1.4.1

!!! make sure version and distro are correct, should be pyxis (1.4.1-1trusty) trusty; in this case.

$  vi debian/changelog

now build the bad boy:

$  debuild -S -sa
 dpkg-buildpackage -rfakeroot -d -us -uc -S -sa
dpkg-buildpackage: source package pyxis
dpkg-buildpackage: source version 1.4.1-1trusty
dpkg-buildpackage: source distribution trusty
dpkg-buildpackage: source changed by Gijs Molenaar (launchpad ppa build key) <gijs@pythonic.nl>
 dpkg-source --before-build pyxis-1.4.1
 fakeroot debian/rules clean
dh clean --with python2
   dh_testdir
   dh_auto_clean
	python setup.py clean -a
running clean
removing 'build/lib.linux-x86_64-2.7' (and everything under it)
'build/bdist.linux-x86_64' does not exist -- can't clean it
removing 'build/scripts-2.7' (and everything under it)
removing 'build'
	find . -name \*.pyc -exec rm {} \+
   dh_clean
	rm -f debian/python-pyxis.substvars
	rm -f debian/python-pyxis.*.debhelper
	rm -rf debian/python-pyxis/
	rm -f debian/*.debhelper.log
	rm -f debian/files
	find .  \( \( -type f -a \
	        \( -name '#*#' -o -name '.*~' -o -name '*~' -o -name DEADJOE \
		 -o -name '*.orig' -o -name '*.rej' -o -name '*.bak' \
		 -o -name '.*.orig' -o -name .*.rej -o -name '.SUMS' \
		 -o -name TAGS -o \( -path '*/.deps/*' -a -name '*.P' \) \
		\) -exec rm -f {} + \) -o \
		\( -type d -a -name autom4te.cache -prune -exec rm -rf {} + \) \)
	rm -f *-stamp
 dpkg-source -b pyxis-1.4.1
dpkg-source: info: using source format `3.0 (quilt)'
dpkg-source: info: building pyxis using existing ./pyxis_1.4.1.orig.tar.gz
dpkg-source: info: building pyxis in pyxis_1.4.1-1trusty.debian.tar.gz
dpkg-source: info: building pyxis in pyxis_1.4.1-1trusty.dsc
 dpkg-genchanges -S -sa >../pyxis_1.4.1-1trusty_source.changes
dpkg-genchanges: including full source code in upload
 dpkg-source --after-build pyxis-1.4.1
dpkg-buildpackage: full upload (original source is included)
Now running lintian...
W: pyxis source: ancient-standards-version 3.9.2 (current is 3.9.5)
Finished running lintian.
Now signing changes and any dsc files...
 signfile pyxis_1.4.1-1trusty.dsc Gijs Molenaar (launchpad ppa build key) <gijs@pythonic.nl>
 
 signfile pyxis_1.4.1-1trusty_source.changes Gijs Molenaar (launchpad ppa build key) <gijs@pythonic.nl>
 
Successfully signed dsc and changes files

Upload the package to the PPA:

$  dput ppa:radio-astro/main ../pyxis_1.4.1-1trusty_source.changes
Checking signature on .changes
gpg: Signature made Mon Mar  2 11:31:43 2015 SAST using RSA key ID E91888D2
gpg: Good signature from "Gijs Molenaar (launchpad ppa build key) <gijs@pythonic.nl>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 9BF9 BF69 E5DD E77F 5ABE  20DC 966A 924C E918 88D2
Good signature on ../pyxis_1.4.1-1trusty_source.changes.
Checking signature on .dsc
gpg: Signature made Mon Mar  2 11:31:43 2015 SAST using RSA key ID E91888D2
gpg: Good signature from "Gijs Molenaar (launchpad ppa build key) <gijs@pythonic.nl>"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: 9BF9 BF69 E5DD E77F 5ABE  20DC 966A 924C E918 88D2
Good signature on ../pyxis_1.4.1-1trusty.dsc.
Package includes an .orig.tar.gz file although the debian revision suggests
that it might not be required. Multiple uploads of the .orig.tar.gz may be
rejected by the upload queue management software.
Uploading to ppa (via ftp to ppa.launchpad.net):
  Uploading pyxis_1.4.1-1trusty.dsc: done.
  Uploading pyxis_1.4.1.orig.tar.gz: done.
  Uploading pyxis_1.4.1-1trusty.debian.tar.gz: done.
  Uploading pyxis_1.4.1-1trusty_source.changes: done.
Successfully uploaded packages.

Clone this wiki locally