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