0e246a
%global with_debug 1
eae678
%global with_check 0
eae678
eae678
%if 0%{?with_debug}
eae678
%global _dwz_low_mem_die_limit 0
eae678
%else
eae678
%global debug_package   %{nil}
eae678
%endif
eae678
eae678
%if ! 0%{?gobuild:1}
0e246a
%define gobuild(o:) go build -buildmode pie -compiler gc -tags="rpm_crashtraceback ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '-Wl,-z,relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld '" -a -v -x %{?**};
eae678
%endif
eae678
eae678
%global provider        github
eae678
%global provider_tld    com
eae678
%global project         containernetworking
eae678
%global repo            plugins
eae678
# https://github.com/containernetworking/plugins
eae678
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
eae678
%global import_path     %{provider_prefix}
f854e9
%global commit          a62711a5da7a2dc2eb93eac47e103738ad923fd6
eae678
%global shortcommit     %(c=%{commit}; echo ${c:0:7})
eae678
eae678
Name:           containernetworking-plugins
f854e9
Version:        0.7.5
f854e9
Release:        2%{?dist}
eae678
Summary:        Some CNI network plugins, maintained by the containernetworking team.
eae678
License:        ASL 2.0
eae678
URL:            https://%{provider_prefix}
eae678
Source0:        https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
ce06af
ExclusiveArch:  aarch64 %{arm} ppc64le s390x x86_64 %{ix86}
0e246a
ce06af
%if 0%{?fedora} 
0e246a
BuildRequires: %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang}
0e246a
%else
0e246a
BuildRequires: go-toolset-1.10
0e246a
BuildRequires: openssl-devel
0e246a
%endif #fedora
eae678
0e246a
Provides: containernetworking-cni = %{version}-%{release}
eae678
eae678
%description
eae678
The CNI (Container Network Interface) project consists of a specification
eae678
and libraries for writing plugins to configure network interfaces in Linux
eae678
containers, along with a number of supported plugins. CNI concerns itself
eae678
only with network connectivity of containers and removing allocated resources
eae678
when the container is deleted.
eae678
0e246a
%{?enable_gotoolset110}
eae678
eae678
%prep
0e246a
%autosetup -Sgit -n %{repo}-%{commit}
eae678
eae678
%build
0e246a
export ORG_PATH="%{provider}.%{provider_tld}/%{project}"
0e246a
export REPO_PATH="$ORG_PATH/%{repo}"
0e246a
0e246a
if [ ! -h gopath/src/${REPO_PATH} ]; then
0e246a
   mkdir -p gopath/src/${ORG_PATH}
0e246a
   ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
0e246a
fi
0e246a
0e246a
export GOPATH=$(pwd)/gopath
0e246a
mkdir -p $(pwd)/bin
0e246a
0e246a
echo "Building plugins"
0e246a
export PLUGINS="plugins/meta/* plugins/main/* plugins/ipam/* plugins/sample"
0e246a
for d in $PLUGINS; do
0e246a
   if [ -d "$d" ]; then
0e246a
      plugin="$(basename "$d")"
0e246a
      echo "  $plugin"
0e246a
      %gobuild -o "${PWD}/bin/$plugin" "$@" "$REPO_PATH"/$d
0e246a
   fi
0e246a
done
eae678
eae678
%install
eae678
install -d -p %{buildroot}%{_libexecdir}/cni/
eae678
install -p -m 0755 bin/* %{buildroot}/%{_libexecdir}/cni
eae678
eae678
%check
0e246a
%if 0%{?with_check}
eae678
eae678
%if ! 0%{?gotest:1}
eae678
%global gotest go test
eae678
%endif
eae678
eae678
%gotest %{import_path}/libcni
eae678
%gotest %{import_path}/pkg/invoke
eae678
%gotest %{import_path}/pkg/ip
eae678
%gotest %{import_path}/pkg/ipam
eae678
%gotest %{import_path}/pkg/ns
eae678
%gotest %{import_path}/pkg/skel
eae678
%gotest %{import_path}/pkg/types
eae678
%gotest %{import_path}/pkg/types/020
eae678
%gotest %{import_path}/pkg/types/current
eae678
%gotest %{import_path}/pkg/utils
eae678
%gotest %{import_path}/pkg/utils/hwaddr
eae678
%gotest %{import_path}/pkg/version
eae678
%gotest %{import_path}/pkg/version/legacy_examples
eae678
%gotest %{import_path}/pkg/version/testhelpers
eae678
%gotest %{import_path}/plugins/ipam/dhcp
eae678
%gotest %{import_path}/plugins/ipam/host-local
eae678
%gotest %{import_path}/plugins/ipam/host-local/backend/allocator
eae678
%gotest %{import_path}/plugins/main/bridge
eae678
%gotest %{import_path}/plugins/main/ipvlan
eae678
%gotest %{import_path}/plugins/main/loopback
eae678
%gotest %{import_path}/plugins/main/macvlan
eae678
%gotest %{import_path}/plugins/main/ptp
eae678
%gotest %{import_path}/plugins/meta/flannel
eae678
%gotest %{import_path}/plugins/test/noop
eae678
%endif
eae678
eae678
#define license tag if not already defined
eae678
%{!?_licensedir:%global license %doc}
eae678
eae678
%files
eae678
%license LICENSE
eae678
%doc *.md
eae678
%dir %{_libexecdir}/cni
eae678
%{_libexecdir}/cni/*
eae678
0e246a
%changelog
ce06af
* Wed May 01 2019 Johnny Hughes <johnny@centos.org>
ce06af
- Build with go-toolset, build on i386
ce06af
f854e9
* Wed Mar 27 2019 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.5-2
f854e9
- rebase
f854e9
0e246a
* Mon Jan 07 2019 Lokesh Mandvekar <lsm5@redhat.com> - 0.7.4-1
0e246a
- Resolves: #1664009 - bump to v0.7.4
0e246a
- remove unused devel and unit-test* packages
0e246a
- update go build env
eae678
0e246a
* Wed Nov 21 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.3-3
0e246a
- buildrequires for centos
0e246a
0e246a
* Wed Oct 03 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.3-2
0e246a
- rebase
0e246a
0e246a
* Wed Oct 03 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.1-2
0e246a
- scl go toolset
eae678
36e11c
* Mon Jul 23 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.1-1
36e11c
- rebase
36e11c
eae678
* Thu May 10 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.0-101
eae678
- rebase
eae678
- patches already upstream, removed
eae678
eae678
* Thu Apr 26 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.6.0-6
eae678
- Imported from Fedora
eae678
- Renamed CNI -> plugins
eae678
eae678
* Mon Apr  2 2018 Peter Robinson <pbrobinson@fedoraproject.org> 0.6.0-4
eae678
- Own the libexec cni directory
eae678
eae678
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-3
eae678
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
eae678
eae678
* Tue Jan 23 2018 Dan Williams <dcbw@redhat.com> - 0.6.0-2
eae678
- skip settling IPv4 addresses
eae678
eae678
* Mon Jan 08 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.6.0-1
eae678
- rebased to 7480240de9749f9a0a5c8614b17f1f03e0c06ab9
eae678
eae678
* Fri Oct 13 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.5.2-7
eae678
- do not install to /opt (against Fedora Guidelines)
eae678
eae678
* Thu Aug 24 2017 Jan Chaloupka <jchaloup@redhat.com> - 0.5.2-6
eae678
- Enable devel subpackage
eae678
eae678
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-5
eae678
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
eae678
eae678
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-4
eae678
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
eae678
eae678
* Thu Jul 13 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.5.2-3
eae678
- excludearch: ppc64 as it's not in goarches anymore
eae678
- re-enable s390x
eae678
eae678
* Fri Jun 30 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.5.2-2
eae678
- upstream moved to github.com/containernetworking/plugins
eae678
- built commit dcf7368
eae678
- provides: containernetworking-plugins
eae678
- use vendored deps because they're a lot less of a PITA
eae678
- excludearch: s390x for now (rhbz#1466865)
eae678
eae678
* Mon Jun 12 2017 Timothy St. Clair <tstclair@heptio.com> - 0.5.2-1
eae678
- Update to 0.5.2 
eae678
- Softlink to default /opt/cni/bin directories
eae678
eae678
* Sun May 07 2017 Timothy St. Clair <tstclair@heptio.com> - 0.5.1-1
eae678
- Initial package
eae678