## START: Set by rpmautospec ## (rpmautospec version 0.8.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 2; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec # Generated by go2rpm 1.14.0 (and then modified for go-vendor-tools) # https://github.com/inspektor-gadget/inspektor-gadget # https://github.com/microsoft/azurelinux/tree/3.0/SPECS/ig %global goipath github.com/inspektor-gadget/inspektor-gadget Version: 0.42.0 %gometa -L -f Name: inspektor-gadget Release: %autorelease Summary: Tools and framework for data collection and system inspection using eBPF # Validated by trivy License: Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND GPL-2.0-only WITH Linux-syscall-note AND ISC AND MIT AND MPL-2.0 URL: %{gourl} # Inspektor Gadget can only be used on architectures it's respective gadgets are built for, currently this excludes ppc64le and s390x # https://bugzilla.redhat.com/show_bug.cgi?id=2343238 ExcludeArch: ppc64le ppc64 s390x %global _description %{expand: Inspektor Gadget is a collection of tools (or gadgets) to debug and inspect Kubernetes resources and applications. It manages the packaging, deployment and execution of eBPF programs in a Kubernetes cluster, including many based on BCC tools, as well as some developed specifically for use in Inspektor Gadget. It automatically maps low-level kernel primitives to high-level Kubernetes resources, making it easier and quicker to find the relevant information. This package contains ig, the local CLI flavor of Inspektor Gadget. } # spectool -g golang-github-inspektor-gadget.spec Source0: %{gosource} # go_vendor_archive create golang-github-inspektor-gadget.spec Source1: %{archivename}-vendor.tar.xz # Fix for trivy being unable to detect some licenses # go_vendor_license --config go-vendor-tools.toml explicit -f LICENSE-bpf.txt "GPL-2.0-only WITH Linux-syscall-note" # go_vendor_license --config go-vendor-tools.toml explicit -f vendor/github.com/go-errors/errors/LICENSE.MIT MIT # go_vendor_license --config go-vendor-tools.toml explicit -f vendor/github.com/google/shlex/COPYING Apache-2.0 # go_vendor_license --config go-vendor-tools.toml explicit -f vendor/github.com/BurntSushi/toml/COPYING MIT Source2: go-vendor-tools.toml BuildRequires: go-vendor-tools %description %{_description} %prep %goprep -A # Required to unpack vendor on top of main %setup -q -T -D -a1 %{forgesetupargs} %autopatch -p1 %generate_buildrequires %go_vendor_license_buildrequires -c %{SOURCE2} %build # By default github.com/inspektor-gadget/inspektor-gadget/version is included as a target, instead we need to define our own. # Wiping out currentgoldflags eliminates that. %global currentgoldflags "" export GO_LDFLAGS="-X %{goipath}/internal/version.version=v%{version} \ -X %{goipath}/cmd/common/image.builderImage=ghcr.io/inspektor-gadget/gadget-builder:v%{version}" export GO_BUILDTAGS="netgo" go build %{gobuildflags} -o %{gobuilddir}/bin/ig %{goipath}/cmd/ig %install %go_vendor_license_install -c %{SOURCE2} mkdir -p "%{buildroot}/%{_bindir}" install -D -m0755 %{gobuilddir}/bin/ig %{buildroot}/%{_bindir} %check %go_vendor_license_check -c %{SOURCE2} set -e set -o pipefail # Inspektor Gadget provides unit tests but they rely on several components which # are not present in the chroot used to build and test the package, among # others: # * runc: https://github.com/inspektor-gadget/inspektor-gadget/blob/3c8d1455525b/pkg/container-hook/tracer.go#L302 # * dockerd: https://github.com/inspektor-gadget/inspektor-gadget/blob/3c8d1455525b/pkg/container-utils/testutils/docker.go#L67 # Even if we recreate a proper testing environment, we will still have problems # as, for example, the path tested will be inside the chroot while ig reports # the full path from host point of view. # For all these reasons, we will skip the unit tests and rather run a small # integration test. # Moreover, Inspektor Gadget CI covers Azure Linux extensively: # https://github.com/inspektor-gadget/inspektor-gadget/pull/1186/commits/066bf618d158 if [ -d /sys/kernel/debug/tracing ]; then sleep inf & sleep_pid=$! ./bin/build/ig snapshot process --host | grep -qP "sleep\s+${sleep_pid}" kill $sleep_pid else echo "Skipping ig check as prerequisites are not satisfied in the chroot" fi %files -f %{go_vendor_license_filelist} %{_bindir}/ig %changelog ## START: Generated by rpmautospec * Tue Jul 08 2025 Francis Laniel - 0.42.0-2 - inspektor-gadget: Update goyaml LICENSE.libyaml path. * Tue Jul 08 2025 Francis Laniel - 0.42.0-1 - inspektor-gadget: Bump to 0.42.0. * Tue Jul 01 2025 Francis Laniel - 0.41.0-3 - inspektor-gadget: Bump github.com/go-viper/mapstructure/v2 to v2.3.0. * Wed Jun 18 2025 Francis Laniel - 0.41.0-2 - inspektor-gadget: Use gadget-builder instead of ebpf-builder. * Mon Jun 02 2025 Francis Laniel - 0.41.0-1 - inspektor-gadget: Bump to 0.41.0. * Tue May 06 2025 Francis Laniel - 0.40.0-1 - inspektor-gadget: Bump to 0.40.0. * Tue May 06 2025 Francis Laniel - 0.39.0-2 - Dockerfile: Use fedora:rawhide as base image. * Mon Apr 07 2025 Francis Laniel - 0.39.0-1 - inspektor-gadget: Bump to 0.39.0. * Sun Mar 23 2025 Maxwell G - 0.38.0-3 - Add missing licensing files not detected by trivy * Tue Mar 11 2025 Francis Laniel - 0.38.0-2 - README: Add extra step for release different than rawhide. * Mon Mar 10 2025 Francis Laniel - 0.38.0-1 - inspektor-gadget: Bump to 0.38.0. * Mon Mar 10 2025 Francis Laniel - 0.37.0-3 - README: Add documentation on how to bump and build the package locally. * Mon Mar 10 2025 Francis Laniel - 0.37.0-2 - gitignore: Make it more generic. * Fri Mar 07 2025 Jeremy Cline - 0.37.0-1 - Update to v0.37.0 * Fri Jan 31 2025 Kyle Gospodnetich - 0.36.0-3 - Switch to using ExcludeArch for architecture related build issues with gadgets * Fri Jan 31 2025 Kyle Gospodnetich - 0.36.0-2 - Add ExclusiveArch with assosciated tickets for S390x and PPC * Thu Jan 30 2025 Kyle Gospodnetich - 0.36.0-1 - Initial repository setup for inspektor-gadget ## END: Generated by rpmautospec