diff --git a/cadvisor.spec b/cadvisor.spec new file mode 100644 index 0000000000000000000000000000000000000000..72a98a85435856bc4773f759feecfc07c21d80d0 --- /dev/null +++ b/cadvisor.spec @@ -0,0 +1,48 @@ +%define debug_package %{nil} + +Name: cadvisor +Version: 0.37.0 +Release: 1 +Summary: Analyzes resource usage and performance characteristics of running containers. +License: ASL 2.0 +URL: https://github.com/google/cadvisor + +Source0: https://github.com/google/cadvisor/archive/v%{version}.tar.gz +Source1: vendor.tar.gz +Patch0: use_preinstalled_go-bindata.patch + +BuildRequires: golang >= 1.13 +BuildRequires: go-bindata + +Conflicts: cadvisor +Provides: %{name} = %{version} + +%description +cAdvisor (Container Advisor) provides container users an understanding of the resource +usage and performance characteristics of their running containers. +It is a running daemon that collects, aggregates, processes, and +exports information about running containers. Specifically, for +each container it keeps resource isolation parameters, historical +resource usage, histograms of complete historical resource usage +and network statistics. This data is exported by container and machine-wide. + + +%prep +%setup -q -T -n %{name}-%{version} -b 0 -b 1 +%patch0 -p1 + +%build +GOFLAGS=-mod=vendor make build + +%install +install -D -m 755 cadvisor %{buildroot}%{_bindir}/cadvisor + + +%files +%defattr(-,root,root,-) +%{_bindir}/cadvisor + + +%changelog +* Tue Dec 15 2020 yangzhao - 0.37.0-1 +- Init project cadvisor diff --git a/use_preinstalled_go-bindata.patch b/use_preinstalled_go-bindata.patch new file mode 100644 index 0000000000000000000000000000000000000000..aa54e656d5f8c67b6a92bdba830e2d17e19acac2 --- /dev/null +++ b/use_preinstalled_go-bindata.patch @@ -0,0 +1,16 @@ +diff --git a/build/assets.sh b/build/assets.sh +index fe51acd..9fa77ce 100644 +--- a/build/assets.sh ++++ b/build/assets.sh +@@ -28,11 +28,6 @@ TEMPLATES_PACKAGE="pages" + + FORCE="${FORCE:-}" # Force assets to be rebuilt if FORCE=true + +-# Install while in a temp dir to avoid polluting go.mod/go.sum +-pushd "${TMPDIR:-/tmp}" > /dev/null +-go get -u github.com/kevinburke/go-bindata/... +-popd > /dev/null +- + build_asset () { + local package=$1 + local output_path=$2 diff --git a/v0.37.0.tar.gz b/v0.37.0.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..db9e3e3fac9415c27781a1595889ea05ff2dac77 Binary files /dev/null and b/v0.37.0.tar.gz differ diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..63630548a393718e16a8f8599b6a33ae92ef5d36 Binary files /dev/null and b/vendor.tar.gz differ