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