1

I would like to build and package a particular Go program. The packaged versions of said program provided by Ubuntu 18.04 and Debian 9.5 (actually PVE 5.2) are all fairly old, compared to what I could get from upstream.

Getting the dependencies for my build right isn't an issue, neither is building a Debian package (been there, done that).

What I need to know is how I can assign a version to my package - which isn't going be released to anyone else - such that should the package maintainer ever release a newer version than my package has, it would get installed and replace my own package (one such situation could be Ubuntu's do-release-upgrade).

Is there some way to "tag" a package in such a way without breaking the internal version comparisons (dpkg --compare-versions)?

I know the backports typically have bpo in the package name (or is that the version?), but it would be hard to find a comprehensive list of all similar "tags" and so I was thinking perhaps there is already a method to achieve this and avoid clashes. So the main goal is to play by the rules, all the while getting the newest version I can get.

2

Since you’re packaging new upstream versions, I would recommend a version of the form

1.0-0~c0000022l+1

where 1.0 is the upstream version. The idea here is as follows:

  • 0 is lower than any official Debian package will ever have; this is used for example in Ubuntu packages which ship a newer upstream version than Debian (you’ll see 0ubuntu here);
  • ~ ensures that the version will sort lower than any -0 revision anyway (see Debian Policy for details);
  • c0000022l is some specific suffix to tag the revision as yours (similar to bpo for backports, deb for Debian stable updates...);
  • +1 gives you room for future updates to your packaging.

If you then need to provide a newer package with only packaging fixes, you’d bump the +1. If you package a newer upstream version, you bump the upstream version as appropriate and start from +1 again.

If the same upstream, or a newer one, ever ends up packaged “officially”, it will be a valid upgrade candidate from your local version: if it’s a Ubuntu package, 1.0-0ubuntu... will sort after 1.0-0~, and if it’s a Debian package, 1.0-1 will sort after 1.0-0.

  • Ah, so this is where I should have been looking. Thank you, this clears up all the questions I had surrounding this. – 0xC0000022L Nov 5 '18 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.