#27 Create a separate systemd-standalone package
Closed 10 months ago by zbyszek. Opened a year ago by filbranden.
rpms/ filbranden/systemd standalone1  into  master

file modified
+9
@@ -23,6 +23,8 @@ 

  o_container = open('.file-list-container', 'w')

  o_remote = open('.file-list-remote', 'w')

  o_tests = open('.file-list-tests', 'w')

+ o_standalone_tmpfiles = open('.file-list-standalone-tmpfiles', 'w')

+ o_standalone_sysusers = open('.file-list-standalone-sysusers', 'w')

  o_rest = open('.file-list-rest', 'w')

  for file in files(buildroot):

      n = file.path[1:]
@@ -109,6 +111,13 @@ 

                         /modprobe.d

      ''', n, re.X):

          o = o_udev

+     elif n.endswith('.standalone'):

+         if 'tmpfiles' in n:

+             o = o_standalone_tmpfiles

+         elif 'sysusers' in n:

+             o = o_standalone_sysusers

+         else:

+             assert False, 'Found .standalone not belonging to known packages'

      else:

          o = o_rest

  

file modified
+28 -1
@@ -20,7 +20,7 @@ 

  Name:           systemd

  Url:            https://www.freedesktop.org/wiki/Software/systemd

  Version:        246.5

- Release:        1%{?dist}

+ Release:        2%{?dist}

  # For a breakdown of the licensing, see README

  License:        LGPLv2+ and MIT and GPLv2+

  Summary:        System and Service Manager
@@ -318,6 +318,24 @@ 

  "Installed tests" that are usually run as part of the build system.

  They can be useful to test systemd internals.

  

+ %package standalone-tmpfiles

+ Summary:       Standalone tmpfiles binary for use in non-systemd systems

+ RemovePathPostfixes: .standalone

+ 

+ %description standalone-tmpfiles

+ Standalone tmpfiles binary with no dependencies on the systemd-shared library

+ or other libraries from systemd-libs. This package conflicts with the main

+ systemd package and is meant for use in non-systemd systems.

+ 

+ %package standalone-sysusers

+ Summary:       Standalone sysusers binary for use in non-systemd systems

+ RemovePathPostfixes: .standalone

+ 

+ %description standalone-sysusers

+ Standalone sysusers binary with no dependencies on the systemd-shared library

+ or other libraries from systemd-libs. This package conflicts with the main

+ systemd package and is meant for use in non-systemd systems.

+ 

  %prep

  %autosetup -n %{?commit:%{name}%{?stable:-stable}-%{commit}}%{!?commit:%{name}%{?stable:-stable}-%{github_version}} -p1

  
@@ -372,6 +390,7 @@ 

          -Dtpm=true

          -Dhwdb=true

          -Dsysusers=true

+         -Dstandalone-binaries=true

          -Ddefault-kill-user-processes=false

          -Dtests=unsafe

          -Dinstall-tests=true
@@ -805,7 +824,15 @@ 

  

  %files tests -f .file-list-tests

  

+ %files standalone-tmpfiles -f .file-list-standalone-tmpfiles

+ 

+ %files standalone-sysusers -f .file-list-standalone-sysusers

+ 

  %changelog

+ * Wed Sep 16 2020 Filipe Brandenburger <filbranden@gmail.com> - 246.5-2

+ - Build a package with standalone binaries for non-systemd systems.

+   For now, only systemd-sysusers is included.

+ 

  * Sun Sep 13 2020 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 246.5-1

  - Update to latest stable release (a bunch of small network-related

    fixes in systemd-networkd and socket handling, documentation updates,

This package includes binaries that link to a static version of libsystemd-shared, so they don't depend on the systemd-libs package at runtime.

This is intended to expose binaries such as systemd-sysusers (and soon also systemd-tmpfiles) to non-systemd systems.

This requires upstream PR #16061 to be merged and released first, in order for this specfile change to work.

Metadata Update from @filbranden:
- Request assigned

a year ago

Please add Conflicts: systemd to this so that the conflict is correctly expressed.

rebased onto b0a7db7

10 months ago

I just updated this PR and it's now in a state I believe is ready to merge.

I split the standalone binaries into two separate packages: systemd-standalone-sysusers and systemd-standalone-tmpfiles.

I tested building, confirmed it worked, also installed them into a fresh chroot with dnf --installroot ~/tmp/root --releasever 32 install x86_64/systemd-standalone-*.rpm and confirmed that this didn't pull any other systemd packages such as systemd-libs.

@ngompa I didn't really add a Conflicts: systemd since the packages shipping two different binaries on the same path should be enough to create a conflict between the packages... But I'd be happy to include additional directives such as this one (and maybe a couple of Obsoletes: of the systemd-standalone-* packages from the main one?) if you think it would help to have those explicit.

Also make sure you see the commit description for more details and a more thorough explanation on how this works. (The upstream PR is also possibly relevant.)

Cheers!
Filipe

I'm fine with this change

@ngompa I didn't really add a Conflicts: systemd since the packages shipping two different binaries on the same path should be enough to create a conflict between the packages... But I'd be happy to include additional directives such as this one (and maybe a couple of Obsoletes: of the systemd-standalone-* packages from the main one?) if you think it would help to have those explicit.

File conflicts without a Conflicts dependency are evil. They break dnf transactions: dnf first determines the transaction using declared deps. If there are Conflicts declared, it will try to figure out a solution that satisfies them. It then downloads packages and performs the transaction check in which file conflicts are surfaced. This is too late and leads to a bad UX.

I added a commit that adds Conflicts+Obsoletes and will push this momentarilly.

Pull-Request has been closed by zbyszek

10 months ago