Debian/Ubuntu Packages Uploading


The Problem

The focus is not how to upload a package here, but

  • Do you have to package multiple times to get each version of Ubuntu?
  • How to easily build and upload a package to multiple repositories?

As e.g.,

How can I upload package for several ubuntu versions to Launchpad automatically?
http://askubuntu.com/questions/33163/how-can-i-upload-package-for-several-ubuntu-versions-to-launchpad-automatically

Cody Somerville gave a good summary of the problem: “We use dput to upload packages to a Debian repository such as the Debian Archive, Ubuntu Archive, or personal archives such as a Personal Package Archive on Launchpad. Getting the hard work you’ve done to the archive for the whole world to enjoy is an important part of a packager’s work flow and should be [as] easy as possible”.


The Conclusion

As it turned out, “there is more than one way that leads to Rome”. So depending on your situation, choose the following method(s):

  • The manual way, which some type of people would consider the easiest.
  • The scripted way, which some other type of people would consider this automatic approach to be the easiest, so you just fire up the script and forget about it. No need to check back launchpad every now and then to see if it is OK to make your next move anymore.
  • The official way. The above two methods will just use same source package for all different versions. As it is easily conceivable that there will be cases that they’d fail. I.e., it is necessary to compile for different distros/versions differently. If you have to do that, there are tools to help.

References

The following articles are collected all over the Internet, and gathered her for convenient. The copyright belongs to the respective authors.

How to upload packages to mentors.debian.net?

http://mentors.debian.net/intro-maintainers

You need to use dput to upload packages. We accept your uploads through HTTP or FTP. All packages must be signed with the GnuPG key you configured in your control panel.

HTTP uploads

To use HTTP put the following content to your ~/.dput.cf file:

[mentors]
fqdn = mentors.debian.net
incoming = /upload
method = http
allow_unsigned_uploads = 0
progress_indicator = 2
# Allow uploads for UNRELEASED packages
allowed_distributions = .*

The manual way

PPA & Packaging: Having versions of packages for multiple distros
http://askubuntu.com/questions/30145/ppa-packaging-having-versions-of-packages-for-multiple-distros

I’ve already packaged the stuff for a lucid build. Any clue how I’d be able to create the same packaging, except package it for maverick, and put it up to the same PPA that I’ve put the lucid packaging to?

Check out the above url for Nathan Osman’s answer with nice screen shots. Below is my commented text only version.

Probably the easiest way is to simply copy the binaries on Launchpad:

  1. Go to your PPA and click on View package details, or append +packages to the end of your ppa url, e.g.: https://launchpad.net/~yourid/+archive/ppa/+packages.
  2. Click on Copy packages, or append +copy-packages to the end of your ppa url.
  3. Select the Published package.
  4. Choose your intended distro version as the destination series. Then choose to copy existing binaries for the “How the selected sources should be copied to the destination archive” part.

Note

  1. The selection of copy existing binaries seems to be counter-intuitive at first. So I chose Rebuild the copied sources instead, which made more sense to me. Minutes later, I get an email titled “Launchpad error while copying a package”, which says “same version already has published binaries in the destination archive”.
  2. As commented, it might not always work.

The scripted way

A script for supporting multiple Ubuntu releases in a PPA
http://bobthegnome.blogspot.ca/2012/12/a-script-for-supporting-multiple-ubuntu.html

THURSDAY, DECEMBER 27, 2012

Something I find time consuming is uploading to a PPA when you want to support multiple Ubuntu releases. For my projects I generally want to support the most recent LTS release, the current stable release and the current development release (precise, quantal and raring when this was written).

I have my program in a branch and release that with make distcheck and lp-project-upload. The packaging is stored in another branch.

For each release I update the packaging with dch -i and add a new entry, e.g.

myproject (0.1.5-0ubuntu1) precise; urgency=low

  * New upstream release:
    - New exciting stuff

 -- Me <me@canonical.com>  Thu, 27 Dec 2012 16:52:22 +1300

I then run release.sh and this generates three source packages and uploads them to the PPA:

NAME=myproject
PPA=ppa:myteam/myproject
RELEASES="raring quantal precise"

VERSION=`head -1 debian/changelog | grep -o '[0-9.]*' | head -1`
ORIG_RELEASE=`head -1 debian/changelog | sed 's/.*) \(.*\);.*/\1/'`
for RELEASE in $RELEASES ;
do
  cp debian/changelog debian/changelog.backup
  sed -i "s/${ORIG_RELEASE}/${RELEASE}/;s/0ubuntu1/0ubuntu1~${RELEASE}1/" debian/changelog
  bzr-buildpackage -S -- -sa
  dput ${PPA} ../${NAME}_${VERSION}-0ubuntu1~${RELEASE}1_source.changes
  mv debian/changelog.backup debian/changelog
done

Hope this is useful for someone!

Note I don’t use source recipes as I want just a single package uploaded for each release.

The official way

Anonymous 3 months ago

You could use backportpackage to distribute one source package to multiple Ubuntu releases in one PPA.
http://manpages.ubuntu.com/manpages/precise/en/man1/backportpackage.1.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s