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