GoSIG / tools

Created a year ago
Maintained by eclipseo
Various tools to help with Go packaging
Members 2
Robert-André Mauchin committed a year ago

Golang Packaging helper tools

Various tools to help with Go packaging

Tool to create the vendor package for bundling

bundle_go_deps_for_rpm.sh allows you to create a vendor archive for you Go package, taking the SPEC file as input :

sh bundle_go_deps_for_rpm.sh project.spec

It will generate a vendor-%{version}.tar.gz that you can include as a source for your project:

Source:         vendor-%{version}.tar.gz
Source:         bundle_go_deps_for_rpm.sh

[...]

%prep
%if %{with bundled}
%goprep -k
# unpack vendored dependencies
%setup -q -T -D -a 1 -n %{name}-%{version}
%else
%goprep
%endif

golang_deps_info.py: Tool to get the licenses the provides of dependencies

This script fetches and displays either the license or provides information of a given Go package and its dependencies using the deps.dev API. Depending on the chosen mode, it can either showcase the license of the main package followed by licenses of its dependencies or present provides data for them.

It requires python-pydepsdev:

sudo dnf copr enable eclipseo/python-pydepsdev
sudo dnf isntall python3-pydepsdev

Usage:

python3 golang_deps_info.py <command> <package_name> <version>

Where <command> can be:

  • licenses: To fetch and display the licensing information.
  • provides: To fetch and display the provides information.

Example:

To fetch licenses: python3 golang_deps_info.py licenses github.com/ansible/receptor v1.4.1

To fetch provides: python3 golang_deps_info.py provides github.com/ansible/receptor v1.4.1