From patchwork Thu Mar 30 12:52:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6752 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 4PnNcW0985z3x2l for ; Thu, 30 Mar 2023 12:52:43 +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 4PnNcV1mHVzc6; Thu, 30 Mar 2023 12:52:42 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PnNcV0rFZz2xSf; Thu, 30 Mar 2023 12:52:42 +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 4PnNcS1YRMz2xnV for ; Thu, 30 Mar 2023 12:52:40 +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 4PnNcR3bqvzc6; Thu, 30 Mar 2023 12:52:39 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1680180759; 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; bh=9cVxIebG6aOHur1lgkohzBMmw1Q6kJ57p2GU0rIGQmk=; b=M1/7EmuVk/xJJOJ+3Skqm1AmN6F6swveFLxKQM0K8a+f2bAsgQgmVTozY7SXLAiZptXRi9 9An6I1ky83mCNgAw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1680180759; 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; bh=9cVxIebG6aOHur1lgkohzBMmw1Q6kJ57p2GU0rIGQmk=; b=U1y7afdoDPpXT7LnQFURjbe5nKRzGBHzulW2Nfu1tr+6dzkG791eyozXD78zLc6wV3cKq4 SkHp1yLgCewyYIT6JtpItrXop9yqK/ggWzOQ9D820KdZUpWIELmmhGSvC7Szgl1hPfPpRo WthRDh/s4q4NCxtmceiwCzWgY1R1UoRVRpmmge98g8yPWmZAZP4QpP89rnTcibGna5L2HD n7xmvsrlW3cmCpJ5jbo9Du3vjDg2peIetYn33AUB/sDsI4OxSjj2zDnfO4Lb4QC5qM0u1y xnm4aXDIRSz7KA18ADvwlHD+kFMlfCNC/ndCGjmwVXlJv6gXYySCWZWOIqFOXg== From: Stefan Schantl To: pakfire@lists.ipfire.org Subject: [PATCH 1/2] macros: Add macro to automatically install all systemd sysusers files Date: Thu, 30 Mar 2023 14:52:29 +0200 Message-Id: <20230330125230.11184-1-stefan.schantl@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/systemd.macro | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/macros/systemd.macro b/macros/systemd.macro index 9dc74ff0..1453db95 100644 --- a/macros/systemd.macro +++ b/macros/systemd.macro @@ -1,5 +1,6 @@ SYSTEMD_TMPFILES_DIR = /usr/lib/tmpfiles.d +SYSTEMD_SYSUSERS_DIR = /usr/lib/sysusers.d MACRO_INSTALL_SYSTEMD_FILES for file in %{DIR_SOURCE}/systemd/*; do @@ -19,3 +20,12 @@ MACRO_INSTALL_SYSTEMD_TMPFILES done unset file end + +MACRO_INSTALL_SYSTEMD_SYSUSERS + for file in %{DIR_SOURCE}/*.sysusers; do + [ -e "${file}" ] || continue + mkdir -p %{BUILDROOT}/%{SYSTEMD_SYSUSERS_DIR} + cp -vf ${file} %{BUILDROOT}/%{SYSTEMD_SYSUSERS_DIR}/$(basename ${file%*.sysusers}).conf + done + unset file +end