Merge pull request #863 from flatcar/krnowak/move-tini

Move sys-process/tini from overlay to portage-stable
This commit is contained in:
Krzesimir Nowak 2023-06-02 14:03:50 +02:00 committed by GitHub
commit f1c2d9802d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 70 additions and 68 deletions

View File

@ -403,6 +403,8 @@ sys-libs/libseccomp
sys-libs/readline
sys-libs/zlib
sys-process/tini
virtual/libcrypt
virtual/libelf
virtual/perl-Carp

View File

@ -47,7 +47,6 @@ DEPEND+="
# for appropriate branchch/version of course
# Flatcar:
# containerd ebuild doesn't support apparmor, device-mapper and seccomp use flags
# tini ebuild doesn't support static use flag
# use the old category app-emulation instead of app-containers for containerd, docker-proxy and docker-cli
RDEPEND="
${DEPEND}
@ -59,7 +58,7 @@ RDEPEND="
>=app-emulation/containerd-1.6.16[btrfs?]
~app-emulation/docker-proxy-0.8.0_p20230118
cli? ( ~app-emulation/docker-cli-${PV} )
container-init? ( >=sys-process/tini-0.19.0 )
container-init? ( >=sys-process/tini-0.19.0[static] )
selinux? ( sec-policy/selinux-docker )
"

View File

@ -36,7 +36,6 @@
=sys-libs/libselinux-3.1-r2 ~arm64
=sys-libs/libsemanage-3.1-r1 ~arm64
=sys-libs/libsepol-3.1 ~arm64
=sys-process/tini-0.18.0 ~arm64
# Overwrite portage-stable mask - enable ding-libs for ARM64
=dev-libs/ding-libs-0.6.1-r1 ~arm64

View File

@ -1,5 +0,0 @@
This is a fork of gentoo's sys-process/tini package. The sole reason
that this package is in coreos-overlay and not in portage-stable is to
get rid of the build dependency on cmake, which we do not provide. The
build system is replaced with a small autotools setup (see
[files/automake](files/automake)).

View File

@ -1,12 +0,0 @@
AC_INIT([tini], [0.1])
AC_PROG_CC
AM_INIT_AUTOMAKE([])
AC_SUBST(tini_VERSION_MAJOR)
AC_SUBST(tini_VERSION_MINOR)
AC_SUBST(tini_VERSION_PATCH)
AC_SUBST(tini_VERSION_GIT)
AC_CONFIG_FILES([Makefile src/Makefile src/tiniConfig.h tpl/VERSION])
AC_OUTPUT

View File

@ -1,4 +0,0 @@
bin_PROGRAMS = tini
tini_SOURCES = tini.c
tini_CFLAGS = -static

View File

@ -1,42 +0,0 @@
# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Flatcar: Based on tini-0.18.0.ebuild from commit
# d6c89a5caedbe5cae98142ebb99974b41177aedd in gentoo repo (see
# https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-process/tini/tini-0.18.0.ebuild?id=d6c89a5caedbe5cae98142ebb99974b41177aedd).
EAPI=7
# Flatcar: We provide our autotools-based build system to avoid build
# dependency on cmake. So the settings are hardcoded in the build
# system - we want static binary and a non-minimal build.
inherit autotools
GIT_COMMIT=de40ad007797e0dcd8b7126f27bb87401d224240
DESCRIPTION="A tiny but valid init for containers"
HOMEPAGE="https://github.com/krallin/tini"
SRC_URI="https://github.com/krallin/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
# Flatcar: We don't mark arm64 as "testing".
KEYWORDS="amd64 arm64"
# Flatcar: No IUSE on args or on static - it's hardcoded in the build
# system replacement.
src_prepare() {
# Flatcar: We don't use cmake, so all the code handling cmake
# stuff is dropped. Autotools provide the standard configure
# && make && make install build protocol, which Gentoo handles
# out of the box.
for file in configure.ac Makefile.am src/Makefile.am; do
cp "${FILESDIR}/automake/${file}" "${S}/${file}"
done
eapply_user
export tini_VERSION_MAJOR=$(ver_cut 1)
export tini_VERSION_MINOR=$(ver_cut 2)
export tini_VERSION_PATCH=$(ver_cut 3)
export tini_VERSION_GIT=${GIT_COMMIT}
eautoreconf
}

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<upstream>
<remote-id type="github">krallin/tini</remote-id>

View File

@ -0,0 +1,66 @@
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit cmake flag-o-matic
# guard against forgetfulness, https://bugs.gentoo.org/795936
GIT_COMMIT_0190="de40ad007797e0dcd8b7126f27bb87401d224240"
GIT_COMMIT="GIT_COMMIT_${PV//./}"
GIT_COMMIT="${!GIT_COMMIT}"
DESCRIPTION="A tiny but valid init for containers"
HOMEPAGE="https://github.com/krallin/tini"
SRC_URI="https://github.com/krallin/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="amd64 arm arm64 hppa ppc64 ~riscv ~x86"
IUSE="+args +static"
src_prepare() {
[[ -z ${GIT_COMMIT} ]] && die "forgetful maintainer! please define GIT_COMMIT_${PV//./} on bump"
cmake_src_prepare
local sed_args=(
# Do not strip binary
-e 's/-Wl,-s")$/")/'
# Remove -Werror and -pedantic-errors in order to allow macro
# redefinition, so that CFLAGS="-U_FORTIFY_SOURCE" does not
# trigger an error due to add_definitions(-D_FORTIFY_SOURCE=2)
# in CMakeLists.txt (bug 626438).
-e "s/ -Werror / /"
-e "s/ -pedantic-errors / /"
)
sed -i "${sed_args[@]}" \
-e "s/git.*status --porcelain.*/true/" \
-e "s/git.*log -n 1.*/true/" \
-e "s/git.\${tini_VERSION_GIT}/git.${GIT_COMMIT}/" \
CMakeLists.txt || die
}
src_configure() {
local mycmakeargs=()
use args || mycmakeargs+=(-DMINIMAL=ON)
cmake_src_configure
}
src_compile() {
append-cflags -DPR_SET_CHILD_SUBREAPER=36 -DPR_GET_CHILD_SUBREAPER=37
cmake_src_compile
}
src_install() {
cmake_src_install
if use static; then
mv "${ED}"/usr/bin/{${PN}-static,${PN}} || die
else
rm "${ED}"/usr/bin/${PN}-static || die
fi
}