f0c934b
# Generated by go2rpm 1.8.2
529e240
%ifnarch %{ix86} %{arm}
33807ec
%bcond_without check
529e240
%endif
c372d4e
4ba2fe8
# https://github.com/google/cadvisor
33807ec
%global goipath         github.com/google/cadvisor
f0c934b
Version:                0.45.0
4ba2fe8
33807ec
%gometa
e8aa896
33807ec
%global common_description %{expand:
e8aa896
cAdvisor (Container Advisor) provides container users an understanding of the
33807ec
resource usage and performance characteristics of their running containers. It
33807ec
is a running daemon that collects, aggregates, processes, and exports
e8aa896
information about running containers. Specifically, for each container it keeps
33807ec
resource isolation parameters, historical resource usage, histograms of complete
33807ec
historical resource usage and network statistics. This data is exported by
33807ec
container and machine-wide.
e8aa896
33807ec
cAdvisor has native support for Docker containers and should support just about
33807ec
any other container type out of the box. We strive for support across the board
33807ec
so feel free to open an issue if that is not the case. cAdvisor's container
33807ec
abstraction is based on lmctfy's so containers are inherently nested
33807ec
hierarchically.}
e8aa896
33807ec
%global golicenses      LICENSE
33807ec
%global godocs          docs AUTHORS CHANGELOG.md CONTRIBUTING.md README.md
956c85d
33807ec
Name:           cadvisor
73210d5
Release:        %autorelease
33807ec
Summary:        Analyzes resource usage and performance characteristics of running containers
4ba2fe8
f0c934b
License:        Apache-2.0
33807ec
URL:            %{gourl}
f0c934b
Source:         %{gosource}
33807ec
Source1:        cadvisor
33807ec
Source2:        cadvisor.service
33807ec
# Use github.com/influxdata/influxdb1-client as influx client
33807ec
Patch0:         0001-Use-github.com-influxdata-influxdb1-client-as-influx.patch
33807ec
33807ec
BuildRequires:  git-core
33807ec
BuildRequires:  systemd
33807ec
BuildRequires:  glibc-static
33807ec
f0c934b
%description %{common_description}
4ba2fe8
33807ec
%gopkg
e8aa896
e8aa896
%prep
33807ec
%goprep
33807ec
%patch0 -p1
e8aa896
f0c934b
%generate_buildrequires
f0c934b
%go_generate_buildrequires
f0c934b
e8aa896
%build
b01fc86
%gobuild -o %{gobuilddir}/bin/cadvisor %{goipath}/cmd
62ba1e6
e8aa896
%install
33807ec
%gopkginstall
33807ec
install -m 0755 -vd                     %{buildroot}%{_bindir}
33807ec
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/
e8aa896
33807ec
# install systemd/sysconfig
4ba2fe8
install -d -m 0755 %{buildroot}%{_sysconfdir}/sysconfig/
4ba2fe8
install -p -m 0660 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
4ba2fe8
install -d -m 0755 %{buildroot}%{_unitdir}
4ba2fe8
install -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
e8aa896
e8aa896
%post
e8aa896
%systemd_post cadvisor.service
e8aa896
e8aa896
%preun
e8aa896
%systemd_preun cadvisor.service
e8aa896
e8aa896
%postun
33807ec
%systemd_postun cadvisor.service
e8aa896
33807ec
%if %{with check}
33807ec
%check
f0c934b
%gocheck -d integration/tests/api -d integration/tests/healthz -d machine -d github.com/google/cadvisor/container/containerd
33807ec
%endif
3389466
e8aa896
%files
e43580c
%license LICENSE
33807ec
%doc docs AUTHORS CHANGELOG.md CONTRIBUTING.md README.md
f0c934b
%{_bindir}/cadvisor
e8aa896
%{_unitdir}/%{name}.service
e8aa896
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}
e8aa896
33807ec
%gopkgfiles
e8aa896
e8aa896
%changelog
73210d5
%autochangelog