Accepting request 965855 from devel:kubic

OBS-URL: https://build.opensuse.org/request/show/965855
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/cni?expand=0&rev=13
This commit is contained in:
Dominique Leuenberger 2022-04-02 16:19:50 +00:00 committed by Git OBS Bridge
parent 01f7dd2dc3
commit 95ba093e2e
8 changed files with 55 additions and 63 deletions

View File

@ -4,15 +4,17 @@
<param name="scm">git</param>
<param name="filename">cni</param>
<param name="exclude">.git</param>
<param name="versionformat">0.8.1</param>
<param name="revision">v0.8.1</param>
<param name="versionformat">@PARENT_TAG@</param>
<param name="revision">v1.0.1</param>
<param name="versionrewrite-pattern">v(.*)</param>
<param name="changesgenerate">enable</param>
</service>
<service name="recompress" mode="disabled">
<param name="file">cni-*.tar</param>
<param name="compression">xz</param>
<param name="compression">gz</param>
</service>
<service name="set_version" mode="disabled">
<param name="basename">cni</param>
</service>
<service name="go_modules" mode="disabled"/>
</services>

4
_servicedata Normal file
View File

@ -0,0 +1,4 @@
<servicedata>
<service name="tar_scm">
<param name="url">https://github.com/containernetworking/cni.git</param>
<param name="changesrevision">c7f5f70554d026e7a3bc5a0ab52280576a2379d1</param></service></servicedata>

View File

@ -1,29 +0,0 @@
#!/usr/bin/env bash
set -e
ORG_PATH="github.com/containernetworking"
REPO_PATH="${ORG_PATH}/cni"
if [ ! -h gopath/src/${REPO_PATH} ]; then
mkdir -p gopath/src/${ORG_PATH}
ln -s ../../../.. gopath/src/${REPO_PATH} || exit 255
fi
export GO15VENDOREXPERIMENT=1
export GOPATH=${PWD}/gopath
echo "Building API"
go build -buildmode=pie "$@" ${REPO_PATH}/libcni
echo "Building reference CLI"
go build -buildmode=pie -o ${PWD}/bin/cnitool "$@" ${REPO_PATH}/cnitool
echo "Building plugins"
PLUGINS="plugins/test/*"
for d in $PLUGINS; do
if [ -d $d ]; then
plugin=$(basename $d)
echo " " $plugin
go build -buildmode=pie -o ${PWD}/bin/$plugin "$@" ${REPO_PATH}/$d
fi
done

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e3620c5cdce9e3cefa1fccda1d0dcac4d7dd9cae0badc1a9d9ffcc44811871d2
size 82668

3
cni-1.0.1.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:fbda894d465e4a5584ab4934ab8098d083d49d7c4f506fef169ba8f8bf198900
size 115128

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Fri Mar 26 11:05:40 UTC 2022 - Enrico Belleri <idesmi@protonmail.com>
- Update to version v1.0.1:
* Rewritten spec
+ non-List configurations are removed
+ the version field in the interfaces array was redundant and
is removed
* libcni improvements
- Employ RPM macros.go where feasible
- Use vendor tarball
- Remove ./build.sh
-------------------------------------------------------------------
Mon May 31 10:38:40 UTC 2021 - John Paul Adrian Glaubitz <adrian.glaubitz@suse.com>

View File

@ -1,7 +1,7 @@
#
# spec file for package cni
#
# Copyright (c) 2021 SUSE LLC
# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -16,30 +16,28 @@
#
%global provider_prefix github.com/containernetworking/cni
%global import_path %{provider_prefix}
%define cni_etc_dir %{_sysconfdir}/cni
%define cni_bin_dir %{_libexecdir}/cni
%define cni_doc_dir %{_docdir}/cni
Name: cni
Version: 0.8.1
Version: 1.0.1
Release: 0
Summary: Container Network Interface - networking for Linux containers
License: Apache-2.0
Group: System/Management
URL: https://github.com/containernetworking/cni
Source: %{name}-%{version}.tar.xz
Source0: %{name}-%{version}.tar.gz
Source1: 99-loopback.conf
Source2: build.sh
Source2: vendor.tar.gz
BuildRequires: golang(API) >= 1.14
BuildRequires: golang-packaging
BuildRequires: shadow
BuildRequires: systemd-rpm-macros
BuildRequires: xz
BuildRequires: golang(API) >= 1.13
Recommends: cni-plugins
Requires(post): %fillup_prereq
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Recommends: cni-plugins
%{?systemd_requires}
# Remove stripping of Go binaries.
%define __arch_install_post export NO_BRP_STRIP_DEBUG=true
%description
The CNI (Container Network Interface) project consists of a
@ -51,29 +49,32 @@ the container is deleted. Because of this focus, CNI has a wide
range of support and the specification is simple to implement.
%prep
%setup -q
cp %{SOURCE2} build.sh
%autosetup -a2
%build
# go1.16+ default is GO111MODULE=on set to auto temporarily
# until using upstream release with go.mod
export GO111MODULE=auto
sh ./build.sh
export GOFLAGS=-mod=vendor
%goprep %{import_path}
%gobuild libcni
%gobuild cnitool
for d in plugins/test/*; do
if [ -d $d ]; then
%gobuild $d
fi
done
%install
# install the plugins
install -m 755 -d "%{buildroot}%{cni_bin_dir}"
cp bin/noop "%{buildroot}%{cni_bin_dir}/"
cp bin/sleep "%{buildroot}%{cni_bin_dir}/"
install -m 755 -d %{buildroot}%{cni_bin_dir}
install -D %{_builddir}/go/bin/noop %{buildroot}%{cni_bin_dir}/
install -D %{_builddir}/go/bin/sleep %{buildroot}%{cni_bin_dir}/
# undo a copy: cnitool must go to sbin/
install -m 755 -d "%{buildroot}%{_sbindir}"
cp bin/cnitool "%{buildroot}%{_sbindir}/"
install -m 755 -d %{buildroot}%{_sbindir}
install -D %{_builddir}/go/bin/cnitool %{buildroot}%{_sbindir}/
# config
install -m 755 -d "%{buildroot}%{cni_etc_dir}"
install -m 755 -d "%{buildroot}%{cni_etc_dir}/net.d"
install -m 755 -d %{buildroot}%{cni_etc_dir}
install -m 755 -d %{buildroot}%{cni_etc_dir}/net.d
install -D -p -m 0644 %{SOURCE1} %{buildroot}%{cni_etc_dir}/net.d/99-loopback.conf.sample
# documentation
@ -83,7 +84,6 @@ install -m 755 -d "%{buildroot}%{cni_doc_dir}"
%{fillup_only -n %{name}}
%files
%defattr(-,root,root)
%doc CONTRIBUTING.md README.md DCO
%license LICENSE
%dir %{cni_etc_dir}
@ -91,8 +91,7 @@ install -m 755 -d "%{buildroot}%{cni_doc_dir}"
%config %{cni_etc_dir}/net.d/*
%dir %{cni_bin_dir}
%dir %{cni_doc_dir}
%{cni_bin_dir}/*
%{cni_etc_dir}/net.d/*
%{cni_bin_dir}/{noop,sleep}
%{_sbindir}/cnitool
%changelog

3
vendor.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ecfe7089c1fac5e203609e57f9f800438694da2535647c1050fddea1a718b601
size 1907777