File dumb-init.spec of Package dumb-init
#
# spec file for package dumb-init
#
# Copyright (c) 2024 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: dumb-init
Version: 1.2.5
Release: 0
Summary: A minimal init system for Linux containers
License: MIT
URL: https://github.com/Yelp/dumb-init
Source: https://github.com/Yelp/dumb-init/archive/v%{version}/%{name}-%{version}.tar.gz
BuildRequires: gcc
BuildRequires: help2man
BuildRequires: make
BuildRequires: python3
BuildRequires: python3-pytest
# pytest 7.2.0+ no longer installs the "py" library,
# which is used by dumb-init's test suite.
# Backported from upstream commit: https://github.com/Yelp/dumb-init/commit/b1a2551ad3c909384d97bca914f7c42cfdcdbf05
Patch0: 0000-update-for-pytest-7.2.0.patch
%description
dumb-init is a simple process supervisor and init system designed to run as PID
1 inside minimal container environments (such as Docker). It is deployed as a
small, statically-linked binary written in C.
Lightweight containers have popularized the idea of running a single process or
service without normal init systems like systemd or sysvinit. However, omitting
an init system often leads to incorrect handling of processes and signals, and
can result in problems such as containers which can't be gracefully stopped, or
leaking containers which should have been destroyed.
dumb-init enables you to simply prefix your command with dumb-init. It acts as
PID 1 and immediately spawns your command as a child process, taking care to
properly handle and forward signals as they are received.
%prep
%autosetup -p1
%build
gcc -std=gnu99 %{optflags} -o %{name} dumb-init.c
help2man --no-discard-stderr --include debian/help2man --no-info --name '%{summary}' ./%{name} > %{name}.1
%install
install -Dpm0755 %{name} %{buildroot}%{_bindir}/%{name}
install -Dpm0644 %{name}.1 %{buildroot}%{_mandir}/man1/%{name}.1
%check
PATH=.:$PATH timeout --signal=KILL 60 pytest -vv tests/
%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}
%{_mandir}/man1/%{name}.1*
%changelog