mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-22 07:44:25 +01:00
packaging: merge packaging repository
git-subtree-dir: tools/packaging git-subtree-mainline:f818b46a41git-subtree-split:1f22d72d5dSigned-off-by: Peng Tao <bergwolf@hyper.sh>
This commit is contained in:
24
tools/packaging/obs-packaging/proxy/_service-template
Normal file
24
tools/packaging/obs-packaging/proxy/_service-template
Normal file
@@ -0,0 +1,24 @@
|
||||
<!--- XML Structure defined here: https://en.opensuse.org/openSUSE:Build_Service_Concept_SourceService -->
|
||||
<services>
|
||||
<service name="tar_scm">
|
||||
<param name="scm">git</param>
|
||||
<param name="url">https://github.com/kata-containers/proxy.git</param>
|
||||
<param name="filename">kata-proxy</param>
|
||||
<param name="versionformat">@VERSION@</param>
|
||||
<param name="revision">@HASH@</param>
|
||||
</service>
|
||||
<service name="recompress">
|
||||
<param name="file">*.tar*</param>
|
||||
<param name="compression">gz</param>
|
||||
</service>
|
||||
<service name="download_url">
|
||||
<param name="protocol">https</param>
|
||||
<param name="host">storage.googleapis.com</param>
|
||||
<param name="path">golang/go@GO_VERSION@.linux-@GO_ARCH@.tar.gz</param>
|
||||
</service>
|
||||
<service name="verify_file">
|
||||
<param name="file">_service:download_url:go@GO_VERSION@.linux-@GO_ARCH@.tar.gz</param>
|
||||
<param name="verifier">sha256</param>
|
||||
<param name="checksum">@GO_CHECKSUM@</param>
|
||||
</service>
|
||||
</services>
|
||||
1
tools/packaging/obs-packaging/proxy/debian.compat
Normal file
1
tools/packaging/obs-packaging/proxy/debian.compat
Normal file
@@ -0,0 +1 @@
|
||||
9
|
||||
13
tools/packaging/obs-packaging/proxy/debian.control-template
Normal file
13
tools/packaging/obs-packaging/proxy/debian.control-template
Normal file
@@ -0,0 +1,13 @@
|
||||
Source: kata-proxy
|
||||
Section: devel
|
||||
Priority: optional
|
||||
Maintainer: Kata containers team <https://github.com/kata-containers/>
|
||||
Standards-Version: 3.9.6
|
||||
Homepage: https://katacontainers.io
|
||||
Build-Depends: dh-make, git, ca-certificates, execstack, devscripts, debhelper, build-essential, dh-autoreconf, make
|
||||
|
||||
Package: kata-proxy
|
||||
Architecture: @deb_arch@
|
||||
Description:
|
||||
kata-proxy works alongside the Kata Containers runtime and shim to provide a VM-based OCI runtime solution.
|
||||
kata-proxy is a daemon offering access to the hyperstart VM agent to both the runtime and shim processes.
|
||||
23
tools/packaging/obs-packaging/proxy/debian.rules-template
Normal file
23
tools/packaging/obs-packaging/proxy/debian.rules-template
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/usr/bin/make -f
|
||||
export DH_OPTIONS
|
||||
export DH_GOPKG:=github.com/kata-containers/proxy
|
||||
export DEB_BUILD_OPTIONS=nocheck
|
||||
export PATH:=/usr/src/packages/BUILD/local/go/bin:$(PATH)
|
||||
export GOROOT:=/usr/src/packages/BUILD/local/go
|
||||
export GOPATH=/usr/src/packages/BUILD/go
|
||||
|
||||
GO_VERSION=@GO_VERSION@
|
||||
|
||||
%:
|
||||
dh $@
|
||||
|
||||
override_dh_auto_build:
|
||||
mkdir -p /usr/src/packages/BUILD/local/
|
||||
mkdir -p /usr/src/packages/BUILD/go/src/github.com/kata-containers/
|
||||
tar xzf /usr/src/packages/SOURCES/go$(GO_VERSION).linux-@GO_ARCH@.tar.gz -C /usr/src/packages/BUILD/local/
|
||||
ln -s /usr/src/packages/BUILD/ /usr/src/packages/BUILD/go/src/github.com/kata-containers/proxy
|
||||
cd $(GOPATH)/src/github.com/kata-containers/proxy && make COMMIT=@HASH@
|
||||
|
||||
override_dh_auto_install:
|
||||
mkdir debian/kata-proxy
|
||||
make install DESTDIR=$(shell pwd)/debian/kata-proxy COMMIT=@HASH@
|
||||
16
tools/packaging/obs-packaging/proxy/kata-proxy.dsc-template
Normal file
16
tools/packaging/obs-packaging/proxy/kata-proxy.dsc-template
Normal file
@@ -0,0 +1,16 @@
|
||||
format: 3.0 (quilt)
|
||||
Source: kata-proxy
|
||||
Version: @VERSION@-@RELEASE@
|
||||
Section: devel
|
||||
Priority: optional
|
||||
Maintainer: Kata containers team <https://github.com/kata-containers/>
|
||||
Standards-Version: 3.9.6
|
||||
Build-Depends: dh-make, git, ca-certificates, execstack, fakeroot, devscripts, debhelper, build-essential, dh-autoreconf, make
|
||||
Homepage: https://katacontainers.io
|
||||
Debtransform-Tar: kata-proxy-@VERSION@.tar.gz
|
||||
|
||||
Package: kata-proxy
|
||||
Architecture: @deb_arch@
|
||||
Description:
|
||||
kata-proxy works alongside the Kata Containers runtime and shim to provide a VM-based OCI runtime solution.
|
||||
kata-proxy is a daemon offering access to the hyperstart VM agent to both the runtime and shim processes.
|
||||
80
tools/packaging/obs-packaging/proxy/kata-proxy.spec-template
Normal file
80
tools/packaging/obs-packaging/proxy/kata-proxy.spec-template
Normal file
@@ -0,0 +1,80 @@
|
||||
%global PREFIX /usr/
|
||||
%global BINDIR %{PREFIX}/bin
|
||||
%global DOMAIN github.com
|
||||
%global ORG kata-containers
|
||||
%global PROJECT proxy
|
||||
%global IMPORTNAME %{DOMAIN}/%{ORG}/%{PROJECT}
|
||||
%global GO_VERSION @GO_VERSION@
|
||||
|
||||
%define LIBEXECDIR /usr/libexec
|
||||
|
||||
%undefine _missing_build_ids_terminate_build
|
||||
Name: kata-proxy
|
||||
Version: @VERSION@
|
||||
Release: @RELEASE@
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRequires: pkgconfig(systemd)
|
||||
BuildRequires: git
|
||||
Summary : No detailed summary available
|
||||
Group : Development/Tools
|
||||
License : Apache-2.0
|
||||
|
||||
Requires: kata-proxy-bin
|
||||
|
||||
#!BuildIgnore: post-build-checks
|
||||
|
||||
# Patches
|
||||
@RPM_PATCH_LIST@
|
||||
|
||||
%description
|
||||
.. contents::
|
||||
.. sectnum::
|
||||
``kata-proxy``
|
||||
===================
|
||||
Overview
|
||||
--------
|
||||
|
||||
%global debug_package %{nil}
|
||||
%define _unpackaged_files_terminate_build 0
|
||||
|
||||
%package bin
|
||||
Summary: bin components for the kata-proxy package.
|
||||
Group: Binaries
|
||||
|
||||
%description bin
|
||||
bin components for the kata-proxy package.
|
||||
|
||||
%prep
|
||||
mkdir local
|
||||
tar -C local -xzf ../SOURCES/go%{GO_VERSION}.linux-@GO_ARCH@.tar.gz
|
||||
|
||||
%setup -q
|
||||
|
||||
# Patches
|
||||
@RPM_APPLY_PATCHES@
|
||||
|
||||
%build
|
||||
export GOROOT=$HOME/rpmbuild/BUILD/local/go
|
||||
export PATH=$PATH:$HOME/rpmbuild/BUILD/local/go/bin
|
||||
export GOPATH=$HOME/rpmbuild/BUILD/go/
|
||||
|
||||
mkdir -p $HOME/rpmbuild/BUILD/go/src/%{DOMAIN}/%{ORG}
|
||||
ln -s %{_builddir}/%{name}-%{version} $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME}
|
||||
cd $HOME/rpmbuild/BUILD/go/src/%{IMPORTNAME}
|
||||
make COMMIT=@HASH@
|
||||
|
||||
%clean
|
||||
echo "Clean build root"
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%install
|
||||
make install DESTDIR=%{buildroot} COMMIT=@HASH@
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
|
||||
%files bin
|
||||
%defattr(-,root,root,-)
|
||||
%{LIBEXECDIR}/kata-containers
|
||||
%{LIBEXECDIR}/kata-containers/kata-proxy
|
||||
52
tools/packaging/obs-packaging/proxy/update.sh
Executable file
52
tools/packaging/obs-packaging/proxy/update.sh
Executable file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# Copyright (c) 2018 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
#
|
||||
# -*- mode: shell-script; indent-tabs-mode: nil; sh-basic-offset: 4; -*-
|
||||
# ex: ts=8 sw=4 sts=4 et filetype=sh
|
||||
#
|
||||
# Automation script to create specs to build kata-proxy
|
||||
[ -z "${DEBUG}" ] || set -o xtrace
|
||||
|
||||
set -o errexit
|
||||
set -o nounset
|
||||
set -o pipefail
|
||||
|
||||
source ../versions.txt
|
||||
source ../scripts/pkglib.sh
|
||||
|
||||
SCRIPT_NAME=$0
|
||||
SCRIPT_DIR=$(dirname "$0")
|
||||
PKG_NAME="kata-proxy"
|
||||
VERSION=$kata_proxy_version
|
||||
|
||||
GENERATED_FILES=(kata-proxy.spec kata-proxy.dsc debian.control debian.rules _service)
|
||||
STATIC_FILES=(debian.compat)
|
||||
|
||||
# Parse arguments
|
||||
cli "$@"
|
||||
|
||||
[ "$VERBOSE" == "true" ] && set -x
|
||||
PROJECT_REPO=${PROJECT_REPO:-home:${OBS_PROJECT}:${OBS_SUBPROJECT}/proxy}
|
||||
RELEASE=$(get_obs_pkg_release "${PROJECT_REPO}")
|
||||
((RELEASE++))
|
||||
|
||||
set_versions $kata_proxy_hash
|
||||
|
||||
replace_list=(
|
||||
"GO_CHECKSUM=$go_checksum"
|
||||
"GO_VERSION=$go_version"
|
||||
"GO_ARCH=$GO_ARCH"
|
||||
"HASH=$short_hashtag"
|
||||
"RELEASE=$RELEASE"
|
||||
"VERSION=$VERSION"
|
||||
)
|
||||
|
||||
verify
|
||||
echo "Verify succeed."
|
||||
get_git_info
|
||||
changelog_update $VERSION
|
||||
generate_files "$SCRIPT_DIR" "${replace_list[@]}"
|
||||
build_pkg "${PROJECT_REPO}"
|
||||
Reference in New Issue
Block a user