dpkg-like functionality for building debs & source packages in Go.
Warning: v0.3 is currently in a state of flux. Please use go get github.com/laher/debgo-v0.2
for the time-being. Ta
debber can be used to produce 3 types of artifact:
- The 'Binary debs' - per-architecture
.deb
packages, usually containing compiled artifacts.. - The 'source packages' - a .dsc file plus 2 archives. Contains sources and build information.
- The '-dev' package - a
.deb
file, usually containing sources only. These are commonly used as build dependencies. For go dependencies, I recommend using the -dev.deb.
debber has extra features for packaging 'go' applications, but in theory it could be used for various other tools.
Note that Binary debs should normally be built from source debs. But, for Go programs in particular it's really convenient to skip this step - especially when cross-compiling. The reason for this is because the Go cross-compiler is very straightforward, whereas the standard dpkg toolchain is not portable AFAIK.
Once the API firms up, the preferred way to use debber will be as a library. It should become most useful as part of a build system.
Please see godoc for API docs.
deb
is the core tooling for generating debian packages (source or binary). This offers all the flexibility (e.g. in theory it can parse more packages than those generated by debgen
), but it's pretty basic.
debgen
offers a more involved (but opinionated) package generation system. It employs a templating system to help with generating metadata files and so-on.
You can use debber from the commandline, but there is no configuration - just flags.
debber comes with a few basic commands for building Debian packages. For the most part, each takes the same arguments.
go get github.com/debber/debber-v0.3/cmd/...
- debber-deb produces .deb files for each architecture
- debber-source produces 3 'source package' files.
- debber-dev produces one '-dev.deb' file
goxc is a build tool with packaging (and cross-compiling) features. This code was derived from the goxc project, which itself will shortly use debber instead of its own code. As soon as the switch is made, it will also gain more options for .deb creation (additional files, scripts, etc).
- debber should be able to generate reasonably complex packages, including patches and so-on.
- BUT it doesn't provide specific support for various features. It doesn't parse scripts such as postinst or 'rules' files.
- debber currently only supports .tar.gz archives. It will soon support .tar & .bzip files, and hopefully lzma2 (depending on library availability)
- Validation is primitive for the time-being
- The default files generated for READMEs and changelogs are just placeholders. You should really generate these files yourself.