Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create .deb installation package #42

Closed
Tracked by #20
d13r opened this issue May 5, 2024 · 4 comments
Closed
Tracked by #20

Create .deb installation package #42

d13r opened this issue May 5, 2024 · 4 comments
Labels
enhancement New feature suggestion/request

Comments

@d13r
Copy link
Contributor

d13r commented May 5, 2024

For APT - upload to Ubuntu PPA (or official repo if possible?).

@d13r d13r mentioned this issue May 5, 2024
5 tasks
@d13r d13r changed the title .deb (APT - PPA, or official repo if possible?) Create .deb installation package May 5, 2024
@d13r d13r added the enhancement New feature suggestion/request label May 5, 2024
@d13r
Copy link
Contributor Author

d13r commented May 12, 2024

PPA seems to be working at last:
https://launchpad.net/~bin-cli/+archive/ubuntu/bin-cli

Still need to:

  • Wait for it to change from Pending to Published
  • Test installing it
  • Make the changelog link to https://github.com/bin-cli/bin-cli/releases
  • Add the ability to override the changelog for re-releases
  • Consider using copy-package instead of building the package multiple times
  • Work out what is the best format for the PPA version numbers
  • Strip the +ubuntu... part (or whatever) from the version number (especially in the README links)
  • Generate and add the bash-completion script
  • Consider adding the README file as documentation
  • Release a new revision of the PPA
  • Re-test it
  • Release a new version
  • Update the installation instructions

@d13r
Copy link
Contributor Author

d13r commented May 16, 2024

Consider using copy-package instead of building the package multiple times

I tried it, but it opens a browser to get an OAuth token.

$ git clone https://git.launchpad.net/ubuntu-archive-tools
$ cd ubuntu-archive-tools/
$ ./copy-package --from ~bin-cli/ubuntu/bin-cli --from-suite focal --to-suite jammy bin-cli
The authorization page:
(https://launchpad.net/+authorize-token?oauth_token=XXX&allow_permission=DESKTOP_INTEGRATION)
should be opening in your browser. Use your browser to authorize
this program to access Launchpad on your behalf.
Waiting to hear from Launchpad about your decision...

Maybe there's a way to automate that, or get a long-lived token, but it looks complicated so I think I'll just stick with the original method of building the same package multiple times. (Plus it's more flexible that way, in case I ever need to adjust anything for specific versions of Ubuntu.)

@d13r
Copy link
Contributor Author

d13r commented May 16, 2024

Work out what is the best format for the PPA version numbers

While I would be happy to use just the upstream version number, (1) each Ubuntu series needs a different version number or Launchpad won't allow them to be uploaded with dput (and, as noted above, using copy-package is non-trivial), and (2) it is useful to be able to release a new package version without releasing a new version of Bin CLI itself.

Using something like 0.9.0-1 gives this fatal error:

This package has a Debian revision number but there does not seem to be
an appropriate original tar file or .orig directory in the parent directory;
(expected one of bin-cli_0.9.0.orig.tar.gz, bin-cli_0.9.0.orig.tar.bz2,
bin-cli_0.9.0.orig.tar.lzma,  bin-cli_0.9.0.orig.tar.xz or bin-cli.orig)
continue anyway? (y/n) Use of uninitialized value $ans in pattern match (m//) at /usr/bin/debuild line 1009.
Exited with code 1

Using anything with ubuntu in it gives a warning, but ultimately succeeds:

dpkg-source: warning: Version number suggests Ubuntu changes, but Maintainer: does not have Ubuntu address
dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field

This document suggests the format 1.0-2~ppa1~ubuntu17.04.1. That seems to give another error in addition to the above, but again it ultimately succeeds:

E: bin-cli source: malformed-debian-changelog-version 0.9.0-1~ppa1~ubuntu22.04 (for native)

That last error doesn't occur when simplifying the version to 0.9.0~ppa1~ubuntu22.04 or 0.9.0~ubuntu22.04~ppa1 or bin-cli - 0.9.0+ubuntu24.04+ppa1, etc. - only the "Ubuntu changes" one does.

Surveying the formats used by other PPAs:

Package Example Generic
PHP 8.3.7-1+ubuntu24.04.1+deb.sury.org+1 UPSTREAM-DEBREVISION+ubuntuUBUNTUVER+deb.sury.org+REVISION
DBeaver 24.0.4~ubuntu16.04 (for all series!) UPSTREAM~ubuntu16.04
Firefox 126.0+build2-0ubuntu0.20.04.1~mt1 UPSTREAM+buildREVISION-0ubuntu0.UBUNTUVER~mtREVISION
VeraCrypt 1.26.7-0vanir1~bpo24.04 UPSTREAM-DEBREVISIONvanirREVISION~bpoUBUNTUVER
FEniCS 2:0.8.0.2~ppa1~noble1
(but we'll ignore the 2: epoch)
UPSTREAM~ppaREVISION~UBUNTUSERIESUBUNTUREVISION

In other words, no standard format - not even two packages among this random sample are using the same format!

No consensus on ~ vs + either. man deb-version says "a tilde sorts before anything". Testing with sort -V gives the following order:

0.9.0~ppa1
0.9.0
0.9.0+ppa1
0.9.0-1~ppa1
0.9.0-1
0.9.0-1+ppa1
0.9.1~ppa1
0.9.1
0.9.1+ppa1
0.9.1-1~ppa1
0.9.1-1
0.9.1-1+ppa1

Since an official Debian/Ubuntu package would have a Debian revision number suffix (-1, etc.), that would take precedence over both 0.9.0~ppa1 and 0.9.0+ppa1 formats. I don't see any reason to add -1 myself, since I'm not trying to replace any existing versions.

I am leaning towards + rather than ~, because the sorting seems more logical (I would expect a longer version number to be sorted after a shorter one).

So that leaves the question of 0.9.0+ppa1+ubuntu22.04 vs 0.9.0+ubuntu22.04+ppa1. The latter is what I am currently using, and allows for the possibility of updating the package for a single Ubuntu version without updating the others - e.g. I fixed a bug that only affected Focal in 0.9.0+ubuntu20.04+ppa2. That does leave the packages out of sync, so I will have to skip a version if I make further revisions that affect all series, but that's not a major problem. [Edit: Or I could use 0.9.0+ubuntu20.04+ppa1.1 format for fixes to a single series.]

So, after all that, I think I will stick with what I already have!

@d13r
Copy link
Contributor Author

d13r commented May 18, 2024

This change was spread across many commits: e84da88...1628115.

@d13r d13r closed this as completed May 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature suggestion/request
Projects
None yet
Development

No branches or pull requests

1 participant