From 6967a297218e9fda789ae8352e09c3316c292aa4 Mon Sep 17 00:00:00 2001 From: Sargun Dhillon Date: Tue, 29 Sep 2020 15:59:09 -0700 Subject: [PATCH] Add debian package build to goreleaser This makes the goreleaser output two debian packages. One for jsonnet, and another for jsonnetfmt. Since we don't use cgo, we don't need to take dependencies, as we're fully statically linked. The package name for this package will be jsonnet-go, and jsonnetfmt-go. There is a package that Ubuntu has released that's based on the C++ version. We have a conflict statement with it in order to avoid people installing both. We can ask the C++ package to rename itself to jsonnet-c++, and then add a provides for the package name jsonnet. The reason to not name this jsonnet immediately, even though the Go version if meant to supercede the C++ version, is that this doesn't fully implement the C++ version (for example, man pages). --- .goreleaser.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/.goreleaser.yml b/.goreleaser.yml index 38211e2..596edb7 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -51,3 +51,37 @@ archives: amd64: x86_64 checksum: name_template: 'checksums.txt' + +nfpms: + - id: jsonnet + package_name: jsonnet-go + builds: + - jsonnet + description: A data templating language for app and tool developers + homepage: https://github.com/google/go-jsonnet + license: Apache 2.0 + formats: + - deb + bindir: /usr/bin + maintainer: David Cunningham + file_name_template: "jsonnet-go_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + overrides: + deb: + conflicts: + # See: https://packages.ubuntu.com/jsonnet + - jsonnet + - id: jsonnetfmt + package_name: jsonnetfmt-go + builds: + - jsonnetfmt + homepage: https://github.com/google/go-jsonnet + license: Apache 2.0 + formats: + - deb + bindir: /usr/bin + file_name_template: "jsonnetfmt-go_{{ .Version }}_{{ .Os }}_{{ .Arch }}" + overrides: + deb: + conflicts: + # See: https://packages.ubuntu.com/jsonnet + - jsonnetfmt