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