From 95ba093e2eacf05ca199940733e7cc30d88f2b9ae55383730c0388fbf8b3bcf6 Mon Sep 17 00:00:00 2001 From: Dominique Leuenberger Date: Sat, 2 Apr 2022 16:19:50 +0000 Subject: [PATCH] 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 --- _service | 8 ++++--- _servicedata | 4 ++++ build.sh | 29 ------------------------- cni-0.8.1.tar.xz | 3 --- cni-1.0.1.tar.gz | 3 +++ cni.changes | 13 ++++++++++++ cni.spec | 55 ++++++++++++++++++++++++------------------------ vendor.tar.gz | 3 +++ 8 files changed, 55 insertions(+), 63 deletions(-) create mode 100644 _servicedata delete mode 100644 build.sh delete mode 100644 cni-0.8.1.tar.xz create mode 100644 cni-1.0.1.tar.gz create mode 100644 vendor.tar.gz diff --git a/_service b/_service index d378ed9..47b6103 100644 --- a/_service +++ b/_service @@ -4,15 +4,17 @@ git cni .git - 0.8.1 - v0.8.1 + @PARENT_TAG@ + v1.0.1 + v(.*) enable cni-*.tar - xz + gz cni + diff --git a/_servicedata b/_servicedata new file mode 100644 index 0000000..278b779 --- /dev/null +++ b/_servicedata @@ -0,0 +1,4 @@ + + + https://github.com/containernetworking/cni.git + c7f5f70554d026e7a3bc5a0ab52280576a2379d1 \ No newline at end of file diff --git a/build.sh b/build.sh deleted file mode 100644 index c1b83d6..0000000 --- a/build.sh +++ /dev/null @@ -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 diff --git a/cni-0.8.1.tar.xz b/cni-0.8.1.tar.xz deleted file mode 100644 index 824e564..0000000 --- a/cni-0.8.1.tar.xz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e3620c5cdce9e3cefa1fccda1d0dcac4d7dd9cae0badc1a9d9ffcc44811871d2 -size 82668 diff --git a/cni-1.0.1.tar.gz b/cni-1.0.1.tar.gz new file mode 100644 index 0000000..0d6bfe5 --- /dev/null +++ b/cni-1.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fbda894d465e4a5584ab4934ab8098d083d49d7c4f506fef169ba8f8bf198900 +size 115128 diff --git a/cni.changes b/cni.changes index 156aa57..4878c28 100644 --- a/cni.changes +++ b/cni.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Fri Mar 26 11:05:40 UTC 2022 - Enrico Belleri + +- 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 diff --git a/cni.spec b/cni.spec index ccf3076..ab6063a 100644 --- a/cni.spec +++ b/cni.spec @@ -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 diff --git a/vendor.tar.gz b/vendor.tar.gz new file mode 100644 index 0000000..0052741 --- /dev/null +++ b/vendor.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ecfe7089c1fac5e203609e57f9f800438694da2535647c1050fddea1a718b601 +size 1907777