0631e3
%global with_debug 1
0631e3
%global with_check 0
0631e3
0631e3
%if 0%{?with_debug}
0631e3
%global _find_debuginfo_dwz_opts %{nil}
0631e3
%global _dwz_low_mem_die_limit 0
0631e3
%else
0631e3
%global debug_package   %{nil}
0631e3
%endif
0631e3
0631e3
%if ! 0%{?gobuild:1}
0631e3
%define gobuild(o:) \
0631e3
go build -buildmode pie -compiler gc -tags="rpm_crashtraceback no_openssl ${BUILDTAGS:-}" -ldflags "${LDFLAGS:-} -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};
0631e3
%define gotest(o:) go test
0631e3
%endif
0631e3
0631e3
%global provider github
0631e3
%global provider_tld com
0631e3
%global project containernetworking
0631e3
%global repo plugins
0631e3
# https://github.com/containernetworking/plugins
0631e3
%global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}
0631e3
%global import_path %{provider_prefix}
0631e3
%global commit d5efdfe1f6d6e8e9e9494e3f43be54f76c0f8fd6
0631e3
%global shortcommit %(c=%{commit}; echo ${c:0:7})
0631e3
0631e3
Name: containernetworking-plugins
0631e3
Version: 0.8.3
0631e3
Release: 4%{?dist}
0631e3
Summary: CNI network plugins
0631e3
License: ASL 2.0
0631e3
URL: https://%{provider_prefix}
0631e3
Source0: https://%{provider_prefix}/archive/%{commit}/%{repo}-%{shortcommit}.tar.gz
0631e3
ExcludeArch: ppc64 i686
0631e3
BuildRequires: golang >= 1.12.12-4
0631e3
BuildRequires: git
0631e3
BuildRequires: go-md2man
0631e3
Provides: containernetworking-cni = %{version}-%{release}
0631e3
0631e3
%description
0631e3
The CNI (Container Network Interface) project consists of a specification
0631e3
and libraries for writing plugins to configure network interfaces in Linux
0631e3
containers, along with a number of supported plugins. CNI concerns itself
0631e3
only with network connectivity of containers and removing allocated resources
0631e3
when the container is deleted.
0631e3
0631e3
%prep
0631e3
%autosetup -n %{repo}-%{commit} -p1
0631e3
rm -rf plugins/main/windows
0631e3
0631e3
%build
0631e3
export ORG_PATH="%{provider}.%{provider_tld}/%{project}"
0631e3
export REPO_PATH="$ORG_PATH/%{repo}"
0631e3
0631e3
if [ ! -h gopath/src/${REPO_PATH} ]; then
0631e3
	mkdir -p gopath/src/${ORG_PATH}
0631e3
	ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
0631e3
fi
0631e3
0631e3
export GOPATH=$(pwd)/gopath
0631e3
export GO111MODULE=off
0631e3
mkdir -p $(pwd)/bin
0631e3
0631e3
echo "Building plugins"
0631e3
export PLUGINS="plugins/meta/* plugins/main/* plugins/ipam/* plugins/sample"
0631e3
for d in $PLUGINS; do
0631e3
	if [ -d "$d" ]; then
0631e3
		plugin="$(basename "$d")"
0631e3
		echo "  $plugin"
0631e3
		%gobuild -o "${PWD}/bin/$plugin" "$@" "$REPO_PATH"/$d
0631e3
	fi
0631e3
done
0631e3
0631e3
%install
0631e3
install -d -p %{buildroot}%{_libexecdir}/cni/
0631e3
install -p -m 0755 bin/* %{buildroot}/%{_libexecdir}/cni
0631e3
0631e3
%check
0631e3
%if 0%{?with_check}
0631e3
# Since we aren't packaging up the vendor directory we need to link
0631e3
# back to it somehow. Hack it up so that we can add the vendor
0631e3
# directory from BUILD dir as a gopath to be searched when executing
0631e3
# tests from the BUILDROOT dir.
0631e3
ln -s ./ ./vendor/src # ./vendor/src -> ./vendor
0631e3
0631e3
export GOPATH=%{buildroot}/%{gopath}:$(pwd)/vendor:%{gopath}
0631e3
0631e3
%gotest %{import_path}/libcni
0631e3
%gotest %{import_path}/pkg/invoke
0631e3
%gotest %{import_path}/pkg/ip
0631e3
%gotest %{import_path}/pkg/ipam
0631e3
%gotest %{import_path}/pkg/ns
0631e3
%gotest %{import_path}/pkg/skel
0631e3
%gotest %{import_path}/pkg/types
0631e3
%gotest %{import_path}/pkg/types/020
0631e3
%gotest %{import_path}/pkg/types/current
0631e3
%gotest %{import_path}/pkg/utils
0631e3
%gotest %{import_path}/pkg/utils/hwaddr
0631e3
%gotest %{import_path}/pkg/version
0631e3
%gotest %{import_path}/pkg/version/legacy_examples
0631e3
%gotest %{import_path}/pkg/version/testhelpers
0631e3
%gotest %{import_path}/plugins/ipam/dhcp
0631e3
%gotest %{import_path}/plugins/ipam/host-local
0631e3
%gotest %{import_path}/plugins/ipam/host-local/backend/allocator
0631e3
%gotest %{import_path}/plugins/main/bridge
0631e3
%gotest %{import_path}/plugins/main/ipvlan
0631e3
%gotest %{import_path}/plugins/main/loopback
0631e3
%gotest %{import_path}/plugins/main/macvlan
0631e3
%gotest %{import_path}/plugins/main/ptp
0631e3
%gotest %{import_path}/plugins/meta/flannel
0631e3
%gotest %{import_path}/plugins/test/noop
0631e3
%endif
0631e3
0631e3
#define license tag if not already defined
0631e3
%{!?_licensedir:%global license %doc}
0631e3
0631e3
%files
0631e3
%license LICENSE
0631e3
%doc *.md
0631e3
%dir %{_libexecdir}/cni
0631e3
%{_libexecdir}/cni/*
0631e3
0631e3
%changelog
0631e3
* Thu Dec 12 2019 Jindrich Novy <jnovy@redhat.com> - 0.8.3-4
0631e3
- compile with no_openssl
0631e3
- Related: RHELPLAN-25139
0631e3
0631e3
* Wed Dec 11 2019 Jindrich Novy <jnovy@redhat.com> - 0.8.3-3
0631e3
- compile in FIPS mode
0631e3
- Related: RHELPLAN-25139
0631e3
0631e3
* Mon Dec 09 2019 Jindrich Novy <jnovy@redhat.com> - 0.8.3-2
0631e3
- be sure to use golang >= 1.12.12-4
0631e3
- Related: RHELPLAN-25139
0631e3
0631e3
* Thu Dec 05 2019 Jindrich Novy <jnovy@redhat.com> - 0.8.3-1
0631e3
- update to 0.8.3
0631e3
- Related: RHELPLAN-25139
0631e3
0631e3
* Thu Aug 01 2019 Jindrich Novy <jnovy@redhat.com> - 0.8.1-2
0631e3
- backport https://github.com/coreos/go-iptables/pull/62
0631e3
  from Michael Cambria
0631e3
- Resolves: #1627561
0631e3
0631e3
* Thu Jun 13 2019 Lokesh Mandvekar <lsm5@redhat.com> - 0.8.1-1
0631e3
- Resolves: #1720319 - bump to v0.8.1
0631e3
0631e3
* Sat Jun 01 2019 Lokesh Mandvekar <lsm5@redhat.com> - 0.7.5-1
0631e3
- Resolves: #1616063
0631e3
- bump to v0.7.5
0631e3
0631e3
* Tue Dec 18 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.4-3.git9ebe139
0631e3
- re-enable debuginfo
0631e3
0631e3
* Mon Dec 17 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.4-2.git9ebe139
0631e3
- rebase, removed patch that is already upstream
0631e3
0631e3
* Mon Dec 17 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.3-7.git19f2f28
0631e3
- go tools not in scl anymore
0631e3
0631e3
* Mon Aug 27 2018 Lokesh Mandvekar <lsm5@redhat.com> - 0.7.3-6.git19f2f28
0631e3
- correct tag specification format in %%gobuild macro
0631e3
0631e3
* Fri Aug 24 2018 Lokesh Mandvekar <lsm5@redhat.com> - 0.7.3-5.git19f2f28
0631e3
- Resolves: #1616062 - patch to revert coreos/go-iptables bump
0631e3
0631e3
* Wed Aug 08 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.3-4.git19f2f28
0631e3
- Resolves:#1603012
0631e3
- fix versioning, upstream got it wrong at 7.2
0631e3
0631e3
* Tue Aug 07 2018 Lokesh Mandvekar <lsm5@redhat.com> - 0.7.2-3.git19f2f28
0631e3
- disable i686 temporarily for appstream builds
0631e3
- update golang deps and gobuild definition
0631e3
0631e3
* Mon Aug 06 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.2-2.git19f2f28
0631e3
- rebase
0631e3
0631e3
* Thu Jul 12 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.0-103.gitdd8ff8a
0631e3
- enable scl with the toolset
0631e3
0631e3
* Tue Jul 03 2018 Lokesh Mandvekar <lsm5@redhat.com> - 0.7.0-102.gitdd8ff8a
0631e3
- remove devel and unittest subpackages
0631e3
- use new go-toolset deps
0631e3
 
0631e3
* Thu May 10 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.7.0-101
0631e3
- rebase
0631e3
- patches already upstream, removed
0631e3
0631e3
* Thu Apr 26 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.6.0-6
0631e3
- Imported from Fedora
0631e3
- Renamed CNI -> plugins
0631e3
0631e3
* Mon Apr  2 2018 Peter Robinson <pbrobinson@fedoraproject.org> 0.6.0-4
0631e3
- Own the libexec cni directory
0631e3
0631e3
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.6.0-3
0631e3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
0631e3
0631e3
* Tue Jan 23 2018 Dan Williams <dcbw@redhat.com> - 0.6.0-2
0631e3
- skip settling IPv4 addresses
0631e3
0631e3
* Mon Jan 08 2018 Frantisek Kluknavsky <fkluknav@redhat.com> - 0.6.0-1
0631e3
- rebased to 7480240de9749f9a0a5c8614b17f1f03e0c06ab9
0631e3
0631e3
* Fri Oct 13 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.5.2-7
0631e3
- do not install to /opt (against Fedora Guidelines)
0631e3
0631e3
* Thu Aug 24 2017 Jan Chaloupka <jchaloup@redhat.com> - 0.5.2-6
0631e3
- Enable devel subpackage
0631e3
0631e3
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-5
0631e3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
0631e3
0631e3
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.5.2-4
0631e3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
0631e3
0631e3
* Thu Jul 13 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.5.2-3
0631e3
- excludearch: ppc64 as it's not in goarches anymore
0631e3
- re-enable s390x
0631e3
0631e3
* Fri Jun 30 2017 Lokesh Mandvekar <lsm5@fedoraproject.org> - 0.5.2-2
0631e3
- upstream moved to github.com/containernetworking/plugins
0631e3
- built commit dcf7368
0631e3
- provides: containernetworking-plugins
0631e3
- use vendored deps because they're a lot less of a PITA
0631e3
- excludearch: s390x for now (rhbz#1466865)
0631e3
0631e3
* Mon Jun 12 2017 Timothy St. Clair <tstclair@heptio.com> - 0.5.2-1
0631e3
- Update to 0.5.2 
0631e3
- Softlink to default /opt/cni/bin directories
0631e3
0631e3
* Sun May 07 2017 Timothy St. Clair <tstclair@heptio.com> - 0.5.1-1
0631e3
- Initial package
0631e3