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