From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH 2/2] dbus: Refactor package. Date: Sat, 07 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> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8282093961522704810==" List-Id: --===============8282093961522704810== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable * 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 @@ ############################################################################= ### =20 name =3D dbus -version =3D 1.15.2 +ver_major =3D 1 +ver_minor =3D 15 +ver_plevel =3D 2 release =3D 1 =20 +version =3D %{ver_major}.%{ver_minor}.%{ver_plevel} +dbus_ver =3D %{ver_major}.%{ver_minor}.%{ver_plevel} + maintainer =3D Stefan Schantl groups =3D System/Daemons url =3D 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 =20 packages - package %{name} - prerequires +=3D 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 =3D D-BUS message bus configuration. + version =3D %{dbus_ver} + arch =3D 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 =20 - # 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 =3D D-BUS Tools and Utilities. + version =3D %{dbus_ver} =20 - # Disable the service that is to be removed and stop it if it is still run= ning. - 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, provide= d by + the reference implementation. end =20 - # Just tell systemd that unitfiles have been removed. - script postun - systemctl daemon-reload >/dev/null 2>&1 || : + requires + dbus-libs =3D %{thisver} + dbus-common =3D %{dbus_ver} end =20 - # 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 =20 --=20 2.30.2 --===============8282093961522704810==--