Blame SPECS/containernetworking-plugins.spec

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