Blob Blame History Raw
# Generated by go2rpm
%bcond_without check

# https://github.com/google/cadvisor
%global goipath         github.com/google/cadvisor
%global commit          2ccad4b42fe52b312f6d75a312c61a54fd123dc5
Version:                0.33.1

%gometa

# Remove in F33
%global godevelheader %{expand:
Obsoletes:      cadvisor-devel < 0.22.2-10
}

%global common_description %{expand:
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.

cAdvisor has native support for Docker containers and should support just about
any other container type out of the box. We strive for support across the board
so feel free to open an issue if that is not the case. cAdvisor's container
abstraction is based on lmctfy's so containers are inherently nested
hierarchically.}

%global golicenses      LICENSE
%global godocs          docs AUTHORS CHANGELOG.md CONTRIBUTING.md README.md

Name:           cadvisor
Release:        5%{?dist}
Summary:        Analyzes resource usage and performance characteristics of running containers

# Upstream license specification: Apache-2.0
License:        ASL 2.0
URL:            %{gourl}
Source0:        %{gosource}
Source1:        cadvisor
Source2:        cadvisor.service
# Use github.com/influxdata/influxdb1-client as influx client
Patch0:         0001-Use-github.com-influxdata-influxdb1-client-as-influx.patch
Patch1:         0001-Fix-for-using-with-newer-github.com-opencontainers-r.patch

BuildRequires:  git-core
BuildRequires:  systemd
BuildRequires:  glibc-static
BuildRequires:  golang(cloud.google.com/go/compute/metadata)
BuildRequires:  golang(github.com/abbot/go-http-auth)
BuildRequires:  golang(github.com/aws/aws-sdk-go/aws)
BuildRequires:  golang(github.com/aws/aws-sdk-go/aws/ec2metadata)
BuildRequires:  golang(github.com/aws/aws-sdk-go/aws/session)
BuildRequires:  golang(github.com/blang/semver)
BuildRequires:  golang(github.com/containerd/containerd/api/services/containers/v1)
BuildRequires:  golang(github.com/containerd/containerd/api/services/tasks/v1)
BuildRequires:  golang(github.com/containerd/containerd/api/services/version/v1)
BuildRequires:  golang(github.com/containerd/containerd/containers)
BuildRequires:  golang(github.com/containerd/containerd/pkg/dialer)
BuildRequires:  golang(github.com/containerd/containerd/errdefs)
BuildRequires:  golang(github.com/containerd/containerd/namespaces)
BuildRequires:  golang(github.com/coreos/rkt/api/v1alpha)
BuildRequires:  golang(github.com/docker/docker/api/types)
BuildRequires:  golang(github.com/docker/docker/api/types/container)
BuildRequires:  golang(github.com/docker/docker/client)
BuildRequires:  golang(github.com/docker/docker/pkg/mount)
BuildRequires:  golang(github.com/docker/docker/pkg/parsers/operatingsystem)
BuildRequires:  golang(github.com/docker/go-connections/tlsconfig)
BuildRequires:  golang(github.com/docker/go-units)
BuildRequires:  golang(github.com/euank/go-kmsg-parser/kmsgparser)
BuildRequires:  golang(github.com/garyburd/redigo/redis)
BuildRequires:  golang(github.com/gogo/protobuf/types)
BuildRequires:  golang(github.com/influxdata/influxdb1-client)
BuildRequires:  golang(github.com/karrick/godirwalk)
BuildRequires:  golang(github.com/mesos/mesos-go/api/v1/lib)
BuildRequires:  golang(github.com/mesos/mesos-go/api/v1/lib/agent)
BuildRequires:  golang(github.com/mesos/mesos-go/api/v1/lib/agent/calls)
BuildRequires:  golang(github.com/mesos/mesos-go/api/v1/lib/client)
BuildRequires:  golang(github.com/mesos/mesos-go/api/v1/lib/encoding/codecs)
BuildRequires:  golang(github.com/mesos/mesos-go/api/v1/lib/httpcli)
BuildRequires:  golang(github.com/mindprince/gonvml)
BuildRequires:  golang(github.com/mistifyio/go-zfs)
BuildRequires:  golang(github.com/opencontainers/runc/libcontainer)
BuildRequires:  golang(github.com/opencontainers/runc/libcontainer/cgroups)
BuildRequires:  golang(github.com/opencontainers/runc/libcontainer/cgroups/fs)
BuildRequires:  golang(github.com/opencontainers/runc/libcontainer/configs)
BuildRequires:  golang(github.com/opencontainers/runtime-spec/specs-go)
BuildRequires:  golang(github.com/pkg/errors)
BuildRequires:  golang(github.com/prometheus/client_golang/prometheus)
BuildRequires:  golang(github.com/prometheus/client_golang/prometheus/promhttp)
BuildRequires:  golang(github.com/prometheus/client_model/go)
BuildRequires:  golang(github.com/prometheus/common/expfmt)
BuildRequires:  golang(github.com/prometheus/common/model)
BuildRequires:  golang(github.com/Rican7/retry)
BuildRequires:  golang(github.com/Rican7/retry/strategy)
BuildRequires:  golang(github.com/SeanDolphin/bqschema)
BuildRequires:  golang(github.com/Shopify/sarama)
BuildRequires:  golang(github.com/sigma/go-inotify)
BuildRequires:  golang(github.com/stretchr/testify/assert)
BuildRequires:  golang(github.com/stretchr/testify/mock)
BuildRequires:  golang(golang.org/x/net/context)
BuildRequires:  golang(golang.org/x/oauth2)
BuildRequires:  golang(golang.org/x/oauth2/jwt)
BuildRequires:  golang(golang.org/x/sys/unix)
BuildRequires:  golang(google.golang.org/api/bigquery/v2)
BuildRequires:  golang(google.golang.org/grpc)
BuildRequires:  golang(gopkg.in/olivere/elastic.v2)
BuildRequires:  golang(k8s.io/klog)
BuildRequires:  golang(k8s.io/utils/clock)

%if %{with check}
# Tests
BuildRequires:  golang(github.com/containerd/typeurl)
BuildRequires:  golang(github.com/kr/pretty)
BuildRequires:  golang(github.com/opencontainers/runc/libcontainer/system)
BuildRequires:  golang(github.com/stretchr/testify/require)
BuildRequires:  golang(k8s.io/utils/clock/testing)
%endif

%description
%{common_description}

%gopkg

%prep
%goprep
%patch0 -p1
%patch1 -p1
find . -name "*.go" -exec sed -i "s|github.com/containerd/containerd/dialer|github.com/containerd/containerd/pkg/dialer|" "{}" +;

%build
%gobuild -o %{gobuilddir}/bin/cadvisor %{goipath}

%install
%gopkginstall
install -m 0755 -vd                     %{buildroot}%{_bindir}
install -m 0755 -vp %{gobuilddir}/bin/* %{buildroot}%{_bindir}/

# install systemd/sysconfig
install -d -m 0755 %{buildroot}%{_sysconfdir}/sysconfig/
install -p -m 0660 %{SOURCE1} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
install -d -m 0755 %{buildroot}%{_unitdir}
install -p -m 0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service

%post
%systemd_post cadvisor.service

%preun
%systemd_preun cadvisor.service

%postun
%systemd_postun cadvisor.service

%if %{with check}
%check
%gocheck -d integration/tests/api -d integration/tests/healthz -d machine
%endif

%files
%license LICENSE
%doc docs AUTHORS CHANGELOG.md CONTRIBUTING.md README.md
%{_bindir}/*
%{_unitdir}/%{name}.service
%config(noreplace) %{_sysconfdir}/sysconfig/%{name}

%gopkgfiles

%changelog
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.33.1-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.33.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Wed Jul 10 2019 Elliott Sales de Andrade <quantum.analyst@gmail.com> - 0.33.1-3
- Add Obsoletes for old name

* Mon Jul 08 20:21:04 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0.33.1-2.20190708git2ccad4b
- Bump to commit 2ccad4b42fe52b312f6d75a312c61a54fd123dc5

* Sun May 12 11:27:06 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 0.33.1-1
- Release 0.33.1

* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.2-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.2-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.2-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.2-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.2-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Mon Jul 03 2017 Jan Chaloupka <jchaloup@redhat.com> - 0.22.2-4
- Exclude aarch64, zfs is not available
  related: #1256978

* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.22.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Thu Jul 21 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.22.2-2
- https://fedoraproject.org/wiki/Changes/golang1.7

* Mon Apr 11 2016 jchaloup <jchaloup@redhat.com> - 0.22.2-1
- Bump to upstream 546a3771589bdb356777c646c6eca24914fdd48b
  resolves: #1256978

* Sat Apr  9 2016 Peter Robinson <pbrobinson@fedoraproject.org> 0.16.0.2-4
- Package spec cleanups

* Mon Feb 22 2016 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.16.0.2-3
- https://fedoraproject.org/wiki/Changes/golang1.6

* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 0.16.0.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Sun Sep 06 2015 jchaloup <jchaloup@redhat.com> - 0.16.0.2-1
- Update to 0.16.0.2
  related: #1256978

* Thu Aug 27 2015 jchaloup <jchaloup@redhat.com> - 0.16.0.1-1
- Update to 0.16.0.1
- Update spec file to spec-2.0
  resolves: #1256978

* Thu Jul 02 2015 jchaloup <jchaloup@redhat.com> - 0.16.0-1
- Bump to upstream ec240b60c547caf76c4cd9d73154ebb421fb9da1
  resolves: #1238481

* Wed Jun 17 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.15.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Thu Jun 11 2015 jchaloup <jchaloup@redhat.com> - 0.15.1-1
- Update to 0.15.1
  related: #1219972

* Fri Jun 05 2015 jchaloup <jchaloup@redhat.com> - 0.14.0-1
- Update to 0.14.0
  related: #1219972

* Fri Jun 05 2015 jchaloup <jchaloup@redhat.com> - 0.13.0-2
- Build devel and debundled deps only for Fedora
  related: #1219972

* Fri May 08 2015 jchaloup <jchaloup@redhat.com> - 0.13.0-1
- Update to 0.13.0
- Add missing [B]Rs for devel subpackage
- Add Godeps.json to docs
  resolves: #1219972

* Thu Apr 09 2015 jchaloup <jchaloup@redhat.com> - 0.10.1-2
- Remove wrong option in cadvisor.service
  resolves: #1210336

* Mon Mar 30 2015 jchaloup <jchaloup@redhat.com> - 0.10.1-0.1.gitef7dddf
- Update to 0.10.1
- Add debug info
  related: #1141896

* Thu Mar 26 2015 jchaloup <jchaloup@redhat.com> - 0.6.2-0.3.git89088df
- Fix broken dependencies
- Convert int64 to float64 when calling HumanSize
  related: #1141896

* Fri Dec 12 2014 jchaloup <jchaloup@redhat.com> - 0.6.2-0.1.git89088df
- remove -q option from autosetup, it is not supported
  related: #1141896

* Fri Dec 05 2014 Eric Paris <eparis@redhat.com> - 0.6.2-0.0.git89088df
- Bump to upstream 89088df70eca64cf9d6b9a23a3d2bc21a30916d6

* Fri Nov 14 2014 Eric Paris <eparis@redhat.com> - 0.6.0-0.0.git1e98602
- update to 0.6.0

* Fri Nov 14 2014 Eric Paris <eparis@redhat.com> - 0.5.0-0.1.git8c4f650
- include fs/*.go

* Thu Nov 13 2014 Eric Paris <eparis@redhat.com> - 0.5.0-0.0.git8c4f650
- update to 0.5.0

* Sat Oct 18 2014 jchaloup <jchaloup@redhat.com> - 0.4.1-0.1.git6906a8c
- update to 0.4.1

* Thu Oct 09 2014 jchaloup <jchaloup@redhat.com> - 0.3.0-0.4.git9d158c3
- Move cadvisor.service and cadvisor config file from patch into repo
- Fix the build, thanks to Lokesh

* Fri Sep 19 2014 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.3.0-0.3.git9d158c3
- own parent directory of <gopath</src/<import_path>
- preserve timestamps of copied files in -devel
- use _unitdir macro for systemd install path

* Fri Sep 12 2014 Eric Paris <eparis@redhat.com - 0.3.0-0.2.git9d158c3
- Log to stderr (and thus journal) by default

* Thu Sep 11 2014 Eric Paris <eparis@redhat.com - 0.3.0-0.1.git9d158c3
- Bump to upstream 9d158c3d66e8e6d14cfeb1d73695ab18dbc744e8

* Wed Aug 20 2014 Eric Paris <eparis@redhat.com - 0.2.0-2
- Bump to upstream 17b0ec576bcbeb321c133e4378dee1e500c9850d

* Thu Aug 07 2014 Adam Miller <maxamillion@fedoraproject.org> - 0.2.0-1
- First package for Fedora