diff --git a/macros.systemd b/macros.systemd index cac47b4..0b90a34 100644 --- a/macros.systemd +++ b/macros.systemd @@ -217,13 +217,16 @@ fi \ : \ %{nil} +# For cases where the sysusers or tmpfiles data need to be created in advance +# (when a system user needs to be installed in %%pre so proper ownership are +# used when package's files are installed for example) then use the +# '*_create_package()' variants. # -# Since we moved to file triggers the 2 following macros are deprecated. If the -# sysusers or tmpfiles data need to be created in advance (when a system user -# needs to be installed in %%pre so proper ownership are used when package's -# files are installed for example) then use the '*_create_package()' variants. +# FIXME: these macros could be converted to NOPs since we moved to file +# triggers. However some packages might assume that the macros effects are +# effective as soon as the macros return. This reason is actually moot since +# this can't work on transactional systems anyway. # - %tmpfiles_create() \ %{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# tmpfiles_create}} \ [ -z "${TRANSACTIONAL_UPDATE}" ] && [ -x /usr/bin/systemd-tmpfiles ] && \ @@ -232,29 +235,8 @@ fi \ %sysusers_create() \ %{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# sysusers_create}} \ -[ -x /usr/bin/systemd-sysusers ] && /usr/bin/systemd-sysusers %{?*} || : \ -%{nil} - -# This may be used by package installation scripts to create files according to -# their tmpfiles configuration from a package installation script, even before -# the files of that package are installed on disk. -# -# Example: -# Source1: %{name}-tmpfiles.conf -# ... -# %install -# install -D %SOURCE1 %{buildroot}%{_tmpfilesdir}/%{name}.conf -# %pre -# %tmpfiles_create_package %{name} %SOURCE1 -# %files -# %{_tmpfilesdir}/%{name}.conf -# -%tmpfiles_create_package() \ -%{expand:%%{?!__systemd_twoargs_%#:%%{error:The %%%%tmpfiles_create_package macro requires two arguments}}} \ -[ -d /run/systemd/system ] && \ - /usr/bin/systemd-tmpfiles --replace=%_tmpfilesdir/%1.conf --create - < + +- Bump to version 24 + +------------------------------------------------------------------- +Tue Jun 20 16:01:33 UTC 2023 - Franck Bui + +- Drop %tmpfiles_create_package + + It can't work during transactional updates because the paths that + systemd-tmpfiles usually operates on (such as /var) can't be changed. It + appears that the only user of this macro doesn't really need this macro so + let's drop it. + +------------------------------------------------------------------- +Tue Jun 20 15:57:37 UTC 2023 - Franck Bui + +- Drop %sysusers_create_inline + + It's deprecated and the only user of this macro is being converted to + %sysusers_create_package. So drop it now before the deprecated macro attracts + more users. + +------------------------------------------------------------------- +Tue Jun 20 14:58:35 UTC 2023 - Franck Bui + +- Unlike systemd-tmpfiles call in %tmpfiles_create_package(), systemd-sysusers + must always be called by %sysusers_create_package() even on transactional + systems since it's part of the macro contract. Writing to /etc is not + recommended on such systems but it has to work anyways. + ------------------------------------------------------------------- Fri Jun 16 13:11:34 UTC 2023 - Franck Bui diff --git a/systemd-rpm-macros.spec b/systemd-rpm-macros.spec index 2b68590..62abdae 100644 --- a/systemd-rpm-macros.spec +++ b/systemd-rpm-macros.spec @@ -17,7 +17,7 @@ Name: systemd-rpm-macros -Version: 23 +Version: 24 Release: 0 Summary: RPM macros for systemd License: LGPL-2.1-or-later