Packaging binary release on OpenBSD

openbsdpackaging

I have a tiny application written in go and I've cross-compiled it to various operating systems.

Currently my Makefile generates myapp-VERSION-OS-CPUARCH.tar.gz packages to be used as a source binary packages for to be released as .deb, .rpm, PKGBUILD, FreeBSD binary release .tgz and so on with a structure like so:

bin/myapp
LICENSE
README.md

I can't find tutorials/howtos/examples on how to package this into official OpenBSD .tgz binary release package(s). pkg_create seems to be the command, but I can't find examples.

So how you make the binary release package on OpenBSD so that there's all the metadata such as maintainer, application category, architecture and such?

The idea here is not getting the package to any official ports repository. It's to simply package a release for your own machine and learning about the packaging process on OpenBSD.

Best Answer

The information you need is available in the Porter's Handbook (more specifically the Porting Guide therein).

The summary is that you (if you want to create an official OpenBSD port) would not create a binary package yourself, but a port (a Makefile that slots into OpenBSD's port building infrastructure, and associated metadata files) that eventually gets accepted by the committers on the ports@openbsd.org mailing list.

After being committed, binary packages are then built, signed and distributed by the OpenBSD team using the port that you've written.

If you are not interested in building a package accessible through the official OpenBSD channels and would prefer to distribute your OpenBSD package with your software yourself, you would still have to fit it into the OpenBSD port infrastructure in the way described in the Porting Guide to be able to build that package.

How you go about building an OpenBSD port for some software is a too big topic to answer on this site. Try asking questions about specific issues that you come across while doing this instead. You could also ask on the ports@openbsd.org mailing list.

Related Question