Various tools to help with Go packaging
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
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:
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