From patchwork Sat Jan 7 21:05:05 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Schantl X-Patchwork-Id: 6420 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 4NqCQk1CkCz40V9 for ; Sat, 7 Jan 2023 21:05:18 +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 4NqCQh4YQkz16s; Sat, 7 Jan 2023 21:05:16 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4NqCQh3csHz2xc7; Sat, 7 Jan 2023 21:05:16 +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 4NqCQf6KJyz2xc7 for ; Sat, 7 Jan 2023 21:05:14 +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 4NqCQf2yTvzlb; Sat, 7 Jan 2023 21:05:14 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1673125514; 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=/2uS7+IW0Hyqdgo9PuAcpxye+cQo96VIIxlkaXwL2+4=; b=snr8rZ+39DkdNWb/UR0cwjQzzHPPLC4MCbTbzhuC45YWJ0qMC1akKiLh8RE2q12PO+7pOI YwomTeFg67GVmsCQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1673125514; 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=/2uS7+IW0Hyqdgo9PuAcpxye+cQo96VIIxlkaXwL2+4=; b=ASxQZ+TN1O1kjZs+c6gVj/uuLiFhOddbWO9pLLPYvLZGm2OoCCDXkQx9uA2ALQbY+KRtyd pQfdLGMGGOQGBcZaGmPgXhFumq8+SzlvHZPO9BIO/rRODo6dHoFlwwIVgUndA2EZJDtAj6 B5UImIeB9pquiTBGDvksgjMQ+0RrMfhF976CY9jX8nl6fH3nPMMuJUIQh5fb25jB3+cADr +Y0wClSx9OQdpsIuqHo4xniBJhN3LjWuojFiHJM6NskBN+1ZJcqDnEWzPYExRnpwegZ6yw WqtArzKbjE7EGTWLOQY4ofd4wo1h9rewBTf/8rj83vaZqP6UTBBw2AKVqldjfg== From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 2/2] dbus: Refactor package. Date: Sat, 7 Jan 2023 22:05:05 +0100 Message-Id: <20230107210505.131637-2-stefan.schantl@ipfire.org> In-Reply-To: <20230107210505.131637-1-stefan.schantl@ipfire.org> References: <20230107210505.131637-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" * Do not ship dbus-daemon and related files anymore. * Create a package for common files. * Ship dbus related tools in an own package. Signed-off-by: Stefan Schantl --- dbus/dbus.nm | 105 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 78 insertions(+), 27 deletions(-) diff --git a/dbus/dbus.nm b/dbus/dbus.nm index e25427bee..d6daa5270 100644 --- a/dbus/dbus.nm +++ b/dbus/dbus.nm @@ -4,9 +4,14 @@ ############################################################################### name = dbus -version = 1.15.2 +ver_major = 1 +ver_minor = 15 +ver_plevel = 2 release = 1 +version = %{ver_major}.%{ver_minor}.%{ver_plevel} +dbus_ver = %{ver_major}.%{ver_minor}.%{ver_plevel} + maintainer = Stefan Schantl groups = System/Daemons url = https://www.freedesktop.org/software/dbus/ @@ -40,43 +45,89 @@ build test make check end + + install_cmds + # Remove unneeded documentation. + rm -rvf %{BUILDROOT}/%{datadir}/doc + rm -rvf %{BUILDROOT}/%{datadir}/xml + + # Drop cmake related stuff + rm -rvf %{BUILDROOT}/%{libdir}/cmake + + # Remove daemon related binaries and manpages. + for bin in daemon launch run-session test-tool cleanup-sockets; do + rm -rvf %{BUILDROOT}/%{bindir}/dbus-$bin + rm -rvf %{BUILDROOT}/%{mandir}/man1/dbus-$bin* + done + + # Remove daemon-lauch-helper + rm -rvf %{BUILDROOT}/usr/lib/dbus-daemon-launch-helper + + # Remove daemon related systemd files. + rm -rvf %{BUILDROOT}/%{unitdir}/dbus.service + rm -rvf %{BUILDROOT}/%{unitdir}/multi-user.target.wants + rm -rvf %{BUILDROOT}/usr/lib/tmpfiles.d + + # Remove daemon related folders in /var + rm -rvf %{BUILDROOT}/%{localstatedir} + end end packages - package %{name} - prerequires += shadow-utils - - script prein - getent group dbus >/dev/null || groupadd -r dbus - getent passwd dbus >/dev/null || \ - useradd -r -g dbus -d / -s /sbin/nologin \ - -c "User for dbus service" dbus - exit 0 + package %{name}-common + summary = D-BUS message bus configuration. + version = %{dbus_ver} + arch = noarch + + description + The dbus-common package provides the configuration and setup files for D-Bus + implementations to provide a System and User Message Bus. end - # Just search for new unit files that were just installed. - script postin - systemctl daemon-reload >/dev/null 2>&1 || : - - # The dbus service should be started on default. - systemctl enable dbus.service > /dev/null 2>&1 || : + files + /usr/lib/sysusers.d/ + /usr/lib/sysusers.d/* + %{sysconfdir}/dbus-1 + %{sysconfdir}/dbus-1/session.d + %{sysconfdir}/dbus-1/system.d + %{sysconfdir}/dbus-1/session.conf + %{sysconfdir}/dbus-1/system.conf + %{datadir}/dbus-1 + %{datadir}/dbus-1/session.d + %{datadir}/dbus-1/system.d + %{datadir}/dbus-1/session.conf + %{datadir}/dbus-1/system.conf + %{datadir}/dbus-1/services + %{datadir}/dbus-1/system-services + %{datadir}/dbus-1/interfaces + %{unitdir}/dbus.socket + %{unitdir}/sockets.target.wants/dbus.socket end + end + + package %{name}-tools + summary = D-BUS Tools and Utilities. + version = %{dbus_ver} - # Disable the service that is to be removed and stop it if it is still running. - script preun - systemctl --no-reload disable dbus.service >/dev/null 2>&1 || : - systemctl stop dbus.service >/dev/null 2>&1 || : + description + Tools and utilities to interact with a running D-Bus Message Bus, provided by + the reference implementation. end - # Just tell systemd that unitfiles have been removed. - script postun - systemctl daemon-reload >/dev/null 2>&1 || : + requires + dbus-libs = %{thisver} + dbus-common = %{dbus_ver} end - # Try to restart the service if it is running. - script postup - systemctl daemon-reload >/dev/null 2>&1 || : - systemctl try-restart dbus.service >/dev/null 2>&1 || : + files + %{bindir}/dbus-send + %{bindir}/dbus-monitor + %{bindir}/dbus-update-activation-environment + %{bindir}/dbus-uuidgen + %{mandir}/man1/dbus-monitor.1* + %{mandir}/man1/dbus-send.1* + %{mandir}/man1/dbus-update-activation-environment.1* + %{mandir}/man1/dbus-uuidgen.1* end end