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