From patchwork Sun Apr 2 16:55:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6762 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4PqKsK0l8gz3wvh for ; Sun, 2 Apr 2023 16:55:33 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4PqKsJ38Skz4b; Sun, 2 Apr 2023 16:55:32 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PqKsJ2JKzz2xLr; Sun, 2 Apr 2023 16:55:32 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4PqKsH14cbz2x9j for ; Sun, 2 Apr 2023 16:55:31 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4PqKsG1Z5Tz4b; Sun, 2 Apr 2023 16:55:30 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1680454530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rkILr10ttI9dfYmt66KeWOZydj8oohFotNsgv5Bnorg=; b=U4X1OPxCOqhiQWN1Q5w/9Ag+Lydougm3GDjvbd5ZgoNCj1kUKAQnZMB3cJMuaHVHpXR2SS OrXtKH4Z6hy3bsDg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1680454530; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rkILr10ttI9dfYmt66KeWOZydj8oohFotNsgv5Bnorg=; b=gKKfn15PIDnIyk2zYDf8XXclKCIb+WuOavm54BR5e5f7hMz44Ly2zVYCjurhw1D+KbQyk4 eOTxjVkGJj9xLPvoy4FPkiPuS5sWuHiSP74c65kNeuIS8d21rYOiT8iaGEyv4gg53tXK1s 6ylxstC5l+PITdL38CelwI6OUfWR8LAJvyJjdR5KgnSLwid0beMh+JWllWlZVL4+Y4iJwp lQXJpp/vJnbSvpYDepRuOVZ2yn4gtvJki0l5WaN1/R53Qsd+Y9PbxP3TlfiDYavN01yj2b Imw2hE0lIZK9vVdoaKvepsnOPv2w6ZjmYDEvnrgKqWHNaZb9/qVtZU91Jh+L9Q== From: Stefan Schantl To: pakfire@lists.ipfire.org Subject: [PATCHv2] macros: Add macro to automatically install any systemd sysusers files Date: Sun, 2 Apr 2023 18:55:24 +0200 Message-Id: <20230402165524.3814-1-stefan.schantl@ipfire.org> In-Reply-To: <5ECA5EBF-D0B0-46E8-9206-BD40CF229D3C@ipfire.org> References: <5ECA5EBF-D0B0-46E8-9206-BD40CF229D3C@ipfire.org> MIME-Version: 1.0 X-BeenThere: pakfire@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Mailinglist for the Pakfire Build System." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: pakfire-bounces@lists.ipfire.org Sender: "Pakfire" This macros works very similar than the tmpfiles one but handles sysusers files. Signed-off-by: Stefan Schantl --- macros/build.macro | 1 + macros/systemd.macro | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/macros/build.macro b/macros/build.macro index 4eedd6a9..c19430a4 100644 --- a/macros/build.macro +++ b/macros/build.macro @@ -12,6 +12,7 @@ end def MACRO_INSTALL_FILES %{MACRO_INSTALL_DEFAULT_FILES} %{MACRO_INSTALL_SYSTEMD_FILES} + %{MACRO_INSTALL_SYSTEMD_SYSUSERS} %{MACRO_INSTALL_SYSTEMD_TMPFILES} %{MACRO_INSTALL_PAM_FILES} end diff --git a/macros/systemd.macro b/macros/systemd.macro index 085fabbd..7a40cff6 100644 --- a/macros/systemd.macro +++ b/macros/systemd.macro @@ -16,3 +16,12 @@ MACRO_INSTALL_SYSTEMD_TMPFILES done unset file end + +MACRO_INSTALL_SYSTEMD_SYSUSERS + for file in %{DIR_SOURCE}/*.sysusers; do + [ -e "${file}" ] || continue + mkdir -pv %{BUILDROOT}/%{sysusersdir} + install -v -m 0644 ${file} %{BUILDROOT}/%{sysusersdir}/$(basename ${file%*.sysusers}).conf + done + unset file +end