wiki:Linux/Ubuntu/Packages/PPAPublishMultipleReleases

PPA Publish Multiple Releases

There is often a need to upload the same source-code package to the Ubuntu PPA (Personal Package Archive) buildd system for several releases. The only difference across them all will be the release setting in debian/changelog. See also my related build testing scripts that ensure PPA builds are good before uploading using ppa_publish.

E.g.

r5u870 (0.11.1-0ubuntu1~ppa1g) gutsy; urgency=low
r5u870 (0.11.1-0ubuntu1~ppa1h) hardy; urgency=low
r5u870 (0.11.1-0ubuntu1~ppa1i) intrepid; urgency=low

Previously I manually edited the file and ran debuild and dput for each version but that becomes annoying quite quickly. I decided to write a shell script that automates the process. It is called ppa_publish and is attached to this article and can be downloaded.

To use it first ensure the current directory is the root of the source package (e.g. /home/all/SourceCode/r5u870-0.11.1/) where debuild is to be executed. Pass the name of the dput repository (defined in ~/.dput.cf) as the first option followed by one or more release names. E.g.:

$ cd /home/all/SourceCode/r5u870-0.11.1
$ ppa_publish intuitivenipple-ppa gutsy hardy intrepid

The script will save a copy of the current debian/changelog to /tmp/ and then for each release will use sed to alter the version and release entries then run debuild followed by dput. Finally it will return the back-up from /tmp/ and leave the source directory as it found it.

Updates

2009-09-01 ppa_publish refreshed from locally used script for consistency 2008-09-29 ppa_publish, add BUILD_TEST=1 indicator so other scripts can conditionally invoke code based on the context.
2008-08-23 ppa_publish, add support for alternate debian/control for each release. For example, create debian/control.gutsy with alternate Build-Depends. During preparation, if a file is found matching debian/control.${RELEASE}, the existing debian/control will be backed up to /tmp/ and the alternate will replace it. This allows a package-maintainer to keep a single source for building for a range of releases (Edgy, Feisty, Gutsy, Hardy, Inteprepid, etc.) and easily deal with changing requirements for building.
2008-08-20 ppa_publish, fix: added dpkg-buildpackage -I option to debuild to prevent VCS (CVs, SVN, git, etc.) files being included in the source tarball.

Attachments

  • ppa_publish Download (1.9 KB) - added by tj 8 years ago. Publish multiple package releases automatically