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