Archlinux package

Whilst I appreciate there are many linux distros, it would be nice to organise an archlinux package PKGBUILD file for the AUR. I was surprised not to have seen one there. Any thoughts or suggestions?

I have been able to install just building from the Github source anyway by building and moving the executable to /usr/local/bin, but given this projects potential it would be nice to see it grow.

I’m not familiar with packaging for Arch, but will be happy to accept contributions for that.

Okay, I haven’t yet worked out how to construct a PKGBUILD file myself although somewhat familiar with them, but when I do I’ll be happy to pass that on.

Some background:
Arch User Repository (AUR):

I persevered and created this PKGBUILD file for the CLI version of kopia, which I have added to the issue raised on the page as a feature request, with comments. I have other ideas to increase its scope to include all the kopia install types, but have stopped there until I understand the github process better.

Not sure how I would add it as a useful file to the project in the github way perhaps as a ‘pull request’? Happy to be told/directed/coached how, so I might be of greater help in future…

Do you you envision the build should be invoked?

Options are:

  • on tagged releases only (0.7.0-rc1, 0.7.0, etc.)
  • on nightly builds and tagged releases (some kind of “unstable” channel for nightly and “stable” for tagged)

I have a script that pushes builds to APT repository:

The input to it is a directory produced by goreleaser that has binaries for all platforms, perhaps we can do something similar here.

If you can create such script for ARCH, we can work on automating the build on Travis CI. I’m guessing we need some credentials to push the packages somewhere - that can be typically configured via environment variables - I’m completely unfamiliar how this works for Arch.

Not sure what you mean by ‘invoked’, but the way I understand it works for the AUR is that by defining the PKGBUILD file with the available distributions on the Github repo, a user can download the required files for themselves and build the binary on their machine as I did.

The only issue I had was how to point to the correct release on Github. I could specifically point to the package ‘master’, but I used the hotfix 0.6, as it was, from what I could tell, the package source that created the build for the 0.6.4 release. However, when this changes in future, so too would the PKGBUILD file have to be modified and re-uploaded to the AUR.

A solution to this manual editing it to use tags, as I think you have alluded to. I expect by using the tags suggested (stable, development, nightly as appropriate) the user would have the option of using the one they choose as a direct download and compile on their box. The user would rebuild each time there is a release directly from Github.

From what I can determine from your tag list there is no tag with stable, development, etc. that can be used yet. Is this difficult to add?

So far as platforms go, if the source can be compiled on various archictures, then the PKGBUILD can just needs to specify what they are (e.g., arch=(‘i686’ ‘x86_64’)).

If you think it is better to just distribute the .tar.zst package and build that yourselves for the architectures involved with each release then the PKGBUILD file can just point to the tar.zst file to download from the kopia github repo using a tag to find it. Either way is possible. It is just that with the tar.zst package file the PKGBUILD file would also have to be modified to reflect the new version as the filenames change along with its checksum (as I understand this process, but I could be corrected)

As Kopia is still under development (?) I would have thought that just providing a mechanism to install the lastest release would be adequate. If a PKGBUILD was maintained by someone and perhaps included in the kopia github repo then it could be uploaded to the AUR after each release/change (if it in fact changes at all) and that would be sufficent for an Arch user to install it.

I hope I am making some sense in answering your questions, but I might have missed the point completely.

I might have to do some more reading up on the publishing process for the AUR and get back.

How to submit packages to the AUR

Git over SSH is now used to submit packages to the AUR.

Okay, perhaps I lost you.

From your APT script you are pushing build packages to a repo.

Arch’s AUR just needs either

  1. a pre-built tar.zst package (created with makepkg -s) and its sig file to exist somewhere that can be found using tags, which is then installed using pacman, or

  2. A PKGFILE file that allows the user to build their own package and install it using source code directly from Github. This PKGBUILD file points to the release version available via tags (as one mechanism).

So the method in Arch is not really like APT that I can see where a pre-built package can be pushed somewhere else. The AUR itself holds no binaries, only the method (PKGBUILD) to build them.

I just thought having it listed in the search page of the AUR might give more exposure.

Meanwhile, you can use the Nix package manager on any Linux to install Kopia.

Looks like a kopia package was added to AUR a couple of days ago:

Yes. Open issue #582 resolved except for the added features such quote GraphZal

it would be nice to have one of the following three things, in order to provide more security for the build:

  • a signature and checksum on the source-code tarball
  • or a signature on the git tag
  • or a signature on the git commit that the tag points to (by a proper key you control, like the key used to sign the other packages and checksums, not the GitHub controlled key used automatically by GitHub when working on the web interface)

I’ve added a binary version of kopia to the AUR, check it out if you want to test out 0.8.0-beta2 on Arch