From c655bd931df42e1f27b4188d0df53ba248d0a21f7ebfd2b7269d89f7d1756611 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Sat, 24 Jun 2023 08:41:22 +0000 Subject: [PATCH 1/6] - Turn %tmpfiles_create/%sysusers_create into NOPs The 2 following macros have also been converted into NOPs since we moved to file triggers. Some packages might have assumed that their effects were effective as soon as the macros return. However such assumption on tmpfiles can't work on transactional systems anyways where changes must take place on reboot. When a system user/group needs to be created in %%pre, so proper ownership are used when package's files are installed, "sysusers_create_package()" should be used. OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=102 --- .gitattributes | 23 ++ .gitignore | 1 + macros.systemd | 264 +++++++++++++ systemd-rpm-macros.changes | 775 +++++++++++++++++++++++++++++++++++++ systemd-rpm-macros.spec | 53 +++ 5 files changed, 1116 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 macros.systemd create mode 100644 systemd-rpm-macros.changes create mode 100644 systemd-rpm-macros.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/macros.systemd b/macros.systemd new file mode 100644 index 0000000..cc9888a --- /dev/null +++ b/macros.systemd @@ -0,0 +1,264 @@ +# -*- Mode: rpm-spec; indent-tabs-mode: t -*- +# RPM macros for packages installing systemd unit files +# +### +# +# When a package install systemd unit files, it should use the +# following macros: +# +# add %systemd_requires in the specfile +# +# %pre +# %service_add_pre demo.service demo1.service +# +# %post +# %service_add_post demo.service demo1.service +# +# %preun +# %service_del_preun demo.service +# +# %postun +# %service_del_postun demo.service +# %service_del_postun_without_restart demo.service +# +# Note: the upstream variants are also available and are aliases to +# their SUSE counterparts. However for consistency the SUSE macros +# should be preferred unless the package is intended to be portable +# across multiple distributions based on RPM. + +%_systemd_util_dir /usr/lib/systemd +%_unitdir /usr/lib/systemd/system +%_userunitdir /usr/lib/systemd/user +%_presetdir /usr/lib/systemd/system-preset +%_userpresetdir /usr/lib/systemd/user-preset +%_udevhwdbdir /usr/lib/udev/hwdb.d +%_udevrulesdir /usr/lib/udev/rules.d +%_journalcatalogdir /usr/lib/systemd/catalog +%_tmpfilesdir /usr/lib/tmpfiles.d +%_user_tmpfilesdir /usr/share/user-tmpfiles.d +%_sysusersdir /usr/lib/sysusers.d +%_sysctldir /usr/lib/sysctl.d +%_ntpunitsdir /usr/lib/systemd/ntp-units.d +%_binfmtdir /usr/lib/binfmt.d +%_environmentdir /usr/lib/environment.d +%_modulesloaddir /usr/lib/modules-load.d +%_modprobedir /usr/lib/modprobe.d +%_systemdgeneratordir /usr/lib/systemd/system-generators +%_systemdusergeneratordir /usr/lib/systemd/user-generators +%_systemd_system_env_generator_dir /usr/lib/systemd/system-environment-generators +%_systemd_user_env_generator_dir /usr/lib/systemd/user-environment-generators + +%systemd_requires \ +Requires(pre): systemd \ +Requires(post): systemd \ +Requires(preun): systemd \ +Requires(postun): systemd \ +%{nil} + +# In case you're wondering why "Suggests:" is also used: libzypp +# doesn't understand "OrderWithRequires:" yet, see bsc#1187332 for +# details. +%systemd_ordering \ +OrderWithRequires(pre): systemd \ +OrderWithRequires(post): systemd \ +OrderWithRequires(preun): systemd \ +OrderWithRequires(postun): systemd \ +Suggests: systemd \ +%{nil} + +%__systemd_someargs_0(:) %{error:The %%%1 macro requires some arguments} +%__systemd_twoargs_2() %{nil} + +# Find when presets need to be applied. This information is only recorded during +# %pre and is actually applied during %post. +# +# Presets might need to be applied during package updates too as new services +# might be introduced in this case. Note that on package installations, presets +# might have been already applied. This can happen when packages have been +# renamed or splitted into sub-packages. +# +%service_add_pre() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# service_add_pre}} \ +if [ -x /usr/lib/systemd/systemd-update-helper ]; then \ + /usr/lib/systemd/systemd-update-helper mark-install-system-units %{?*} || : \ +fi \ +%{nil} + +# Apply the presets if %pre told us to do so. +# +%service_add_post() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# service_add_post}} \ +if [ -x /usr/lib/systemd/systemd-update-helper ]; then \ + /usr/lib/systemd/systemd-update-helper install-system-units %{?*} || : \ +fi \ +%{nil} + +# On uninstall, disable and stop services. +# +%service_del_preun() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# service_del_preun}} \ +if [ $1 -eq 0 ] && [ -x /usr/lib/systemd/systemd-update-helper ]; then \ + # Package removal, not upgrade \ + /usr/lib/systemd/systemd-update-helper remove-system-units %{?*} || : \ +fi \ +%{nil} + +# On uninstall, tell systemd to reload its unit files. +# On update, tell systemd to reload its unit files but don't restart service. +# +# It ignores the content of /etc/sysconfig/services +# +%service_del_postun_without_restart() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# service_del_postun_without_restart}} \ +: \ +%{nil} + +# On uninstall, tell systemd to reload its unit files. +# On update, tell systemd to reload its unit files and restart service. +# +# It ignores the content of /etc/sysconfig/services +# +%service_del_postun_with_restart() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# service_del_postun_with_restart}} \ +if [ $1 -ge 1 ] && [ -x /usr/lib/systemd/systemd-update-helper ]; then \ + # Package upgrade, not uninstall \ + /usr/lib/systemd/systemd-update-helper mark-restart-system-units %{?*} || : \ +fi \ +%{nil} + +# On uninstall, tell systemd to reload its unit files. +# On update, tell systemd to reload and restart service unless +# DISABLE_RESTART_ON_UPDATE from /etc/sysconfig/services says otherwise. +# +%service_del_postun() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# service_del_postun}} \ +if [ $1 -ge 1 ] && [ -x /usr/lib/systemd/systemd-update-helper ]; then \ + # Package upgrade, not uninstall \ + DISABLE_RESTART_ON_UPDATE=no \ + [ -e /etc/sysconfig/services ] && . /etc/sysconfig/services || : \ + \ + case "$DISABLE_RESTART_ON_UPDATE" in \ + yes|1) ;; \ + *) /usr/lib/systemd/systemd-update-helper mark-restart-system-units %{?*} || : \ + esac \ +fi \ +%{nil} + +# +# Upstream variants +# + +%systemd_pre() %{expand::%%service_add_pre %{?**}} +%systemd_post() %{expand::%%service_add_post %{?**}} +%systemd_preun() %{expand::%%service_del_preun %{?**}} +%systemd_postun() %{expand::%%service_del_postun_without_restart %{?**}} +%systemd_postun_with_restart() %{expand::%%service_del_postun_with_restart %{?**}} + +# +# Variants dealing with user units. +# + +%systemd_user_pre() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# systemd_user_pre}} \ +if [ -x /usr/lib/systemd/systemd-update-helper ]; then \ + /usr/lib/systemd/systemd-update-helper mark-install-user-units %{?*} || : \ +fi \ +%{nil} + +%systemd_user_post() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# systemd_user_post}} \ +if [ -x /usr/lib/systemd/systemd-update-helper ]; then \ + /usr/lib/systemd/systemd-update-helper install-user-units %{?*} || : \ +fi \ +%{nil} + +%systemd_user_preun() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# systemd_user_preun}} \ +if [ $1 -eq 0 ] && [ -x /usr/lib/systemd/systemd-update-helper ]; then \ + # Package removal, not upgrade \ + /usr/lib/systemd/systemd-update-helper remove-user-units %{?*} || : \ +fi \ +%{nil} + +%systemd_user_postun() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# systemd_user_postun}} \ +: \ +%{nil} + +%systemd_user_postun_with_restart() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# systemd_user_postun_with_restart}} \ +if [ $1 -ge 1 ] && [ -x /usr/lib/systemd/systemd-update-helper ]; then \ + # Package upgrade, not uninstall \ + /usr/lib/systemd/systemd-update-helper mark-restart-user-units %{?*} || : \ +fi \ +%{nil} + +# +# The following macros are empty as we have file triggers in place for hwdb, +# journal catalog, udev rules, binfmt and sysctl. They're kept for backward +# compatibility sake with SLE which hasn't been converted to file-triggers yet. +# +%udev_hwdb_update() :%{nil} + +%udev_rules_update() :%{nil} + +%journal_catalog_update() :%{nil} + +# Currently the 2 following macros don't have any interesting users. Leave them +# empty until a package needs something more specific like applying the changes +# before the macros return. + +%sysctl_apply() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# sysctl_apply}} \ +: \ +%{nil} + +%binfmt_apply() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# binfmt_apply}} \ +: \ +%{nil} + +# The 2 following macros have also been converted into NOPs since we moved to +# file triggers. Some packages might have assumed that their effects were +# effective as soon as the macros return. However such assumption on tmpfiles +# can't work on transactional systems anyways where changes must take place on +# reboot. +# +# When a system user/group needs to be created in %%pre, so proper ownership are +# used when package's files are installed, "sysusers_create_package()" should be +# used. + +%tmpfiles_create() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# tmpfiles_create}} \ +: \ +%{nil} + +%sysusers_create() \ +%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# sysusers_create}} \ +: \ +%{nil} + +# This should be used by package installation scripts which require users or +# groups to be present before the files installed by the package are present on +# disk (for example because some files are owned by those users or groups). +# +# Example: +# Source1: %{name}-sysusers.conf +# ... +# %install +# install -D %SOURCE1 %{buildroot}%{_sysusersdir}/%{name}.conf +# %pre +# %sysusers_create_package %{name} %SOURCE1 +# %files +# %{_sysusersdir}/%{name}.conf +# +# Note: writing to /etc is not recommended on transactional systems but the +# sysusers must be created now since by calling this macro the package explicitly +# requests that. +# +%sysusers_create_package() \ +%{expand:%%{?!__systemd_twoargs_%#:%%{error:The %%%%sysusers_create_package macro requires two arguments}}} \ +[ -x /usr/bin/systemd-sysusers ] && /usr/bin/systemd-sysusers --replace=%_sysusersdir/%1.conf - < + +- Turn %tmpfiles_create/%sysusers_create into NOPs + + The 2 following macros have also been converted into NOPs since we moved to + file triggers. Some packages might have assumed that their effects were + effective as soon as the macros return. However such assumption on tmpfiles + can't work on transactional systems anyways where changes must take place on + reboot. + + When a system user/group needs to be created in %%pre, so proper ownership are + used when package's files are installed, "sysusers_create_package()" should be + used. + +------------------------------------------------------------------- +Tue Jun 20 16:08:47 UTC 2023 - Franck Bui + +- 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 + +- Bump to version 23 + +------------------------------------------------------------------- +Fri Jun 16 13:00:59 UTC 2023 - Franck Bui + +- Restore the check that prevents systemd-tmpfiles to run during transactional updates + + The check has been mistakenly dropped during the switch to file-triggers. + +------------------------------------------------------------------- +Mon May 15 09:21:26 UTC 2023 - Franck Bui + +- Bump to version 22 + +------------------------------------------------------------------- +Wed May 10 12:37:05 UTC 2023 - Franck Bui + +- Make sure that (future) users of %sysctl_apply() and %binfmt_apply() will call + the macros with arguments. + +------------------------------------------------------------------- +Wed May 10 09:14:02 UTC 2023 - Franck Bui + +- Test the presence of /run/systemd/system to check whether we're operating + during transactional updates. Hence the behavior is the same when operating in + a chroot or during transactional updates. + +- Leave %sysctl_apply() and %binfmt_apply() empty (bsc#1211272) + + Only the former has very few users currently and none of them has specific + code relying on the new sysctl values to be effective between the macros and + the file triggers. + +------------------------------------------------------------------- +Tue May 9 14:09:39 UTC 2023 - Franck Bui + +- Bump to version 21 + +------------------------------------------------------------------- +Tue May 9 14:07:05 UTC 2023 - Franck Bui + +- Rely on 'systemd-update-helper' shell script to implement %service_* macros + + The helper was introduced by upstream commit 6d825ab2d42d3219e49a1. The main + advantage is that we no more need to rebuild all packages to update the macro + definitions. + + Internally the script relies on file triggers for 'daemon-reload' operations + and for restarting units (when needed). + +- Update other macros to reflect the fact that systemd package provides file + triggers for sysusers, tmpfiles, hwdb, and journal catalog. + +------------------------------------------------------------------- +Wed Mar 29 11:38:07 UTC 2023 - Franck Bui + +- Bump to version 20 + +------------------------------------------------------------------- +Wed Mar 29 11:33:44 UTC 2023 - Franck Bui + +- %service_del_postun: make sure to restart services if /etc/sysconfig/service + is not present. + +------------------------------------------------------------------- +Wed Mar 29 10:40:14 UTC 2023 - Franck Bui + +- Drop support for -n/-f options in %service_del_postun + + These options have been deprecated since a long time and the last package + relying on them (drkonqi5) in the Factory repository has been updated. + +------------------------------------------------------------------- +Thu Jan 26 14:12:28 UTC 2023 - Franck Bui + +- Bump to version 19 + +------------------------------------------------------------------- +Thu Jan 26 14:11:14 UTC 2023 - Franck Bui + +- `udevadm hwdb` is deprecated, use `systemd-hwdb` instead. + +------------------------------------------------------------------- +Wed Nov 23 17:14:04 UTC 2022 - Franck Bui + +- Bump to version 18 + +------------------------------------------------------------------- +Wed Nov 23 16:52:56 UTC 2022 - Dan Čermák + +- Add %_user_tmpfilesdir macro + +------------------------------------------------------------------- +Mon Oct 3 13:07:42 UTC 2022 - Franck Bui + +- Bump to version 17 + +------------------------------------------------------------------- +Mon Oct 3 12:57:32 UTC 2022 - Franck Bui + +- Fix syntax error in %tmpfiles_create_package() (bsc#1203945) + +------------------------------------------------------------------- +Thu Feb 17 18:54:40 UTC 2022 - Franck Bui + +- Bump to version 16 + +------------------------------------------------------------------- +Thu Feb 17 18:46:25 UTC 2022 - Franck Bui + +- Drop enablement symlink migration support of SysV init scripts + + This was announced here: + https://lists.opensuse.org/archives/list/factory@lists.opensuse.org/thread/3ERUP5ZZJ6PPA36L3HVN46BH6U6JL74O/ + +------------------------------------------------------------------- +Wed Jan 19 08:28:16 UTC 2022 - Franck Bui + +- Bump to version 15 + +------------------------------------------------------------------- +Tue Jan 18 07:57:14 UTC 2022 - Franck Bui + +- %sysusers_create_inline was wrongly marked as deprecated + +- %sysusers_create can be useful in certain cases and won't go away until we'll + move to file triggers. So don't mark it as deprecated too + +------------------------------------------------------------------- +Wed Nov 17 12:28:16 UTC 2021 - Franck Bui + +- Bump version to 14 + +------------------------------------------------------------------- +Wed Nov 17 12:25:15 UTC 2021 - Franck Bui + +- Introduce %_systemd_util_dir + + It's a backport of upstream commit 3bc66bfa0136e370a8f7b06c3b69a52f5636ef82. + +------------------------------------------------------------------- +Wed Sep 29 11:27:11 UTC 2021 - Dominique Leuenberger + +- Use %{load:} instead of %{?load:}: fix build with RPM 4.17. + +------------------------------------------------------------------- +Wed Jun 30 09:59:31 UTC 2021 - Franck Bui + +- Bump to version 13 + +------------------------------------------------------------------- +Wed Jun 30 09:52:48 UTC 2021 - Franck Bui + +- Make use of "Suggests:" in %systemd_ordering + + Until libzypp supports "OrderWithRequires:", we need to specify a + similar ordering constraint that can be understood by the dep solver + as well. Hence the use of "Suggests:" in %systemd_ordering + (workaround for bsc#1187332). + +------------------------------------------------------------------- +Thu May 20 10:18:23 UTC 2021 - Franck Bui + +- Bump to version 12 + +------------------------------------------------------------------- +Thu May 20 09:54:00 UTC 2021 - Franck Bui + +- Introduce %sysusers_create_package + + %sysusers_create and %sysusers_create_inline are now deprecated and + the new macro should be used instead. + + Upstream commit 07a7d4a0040d221ff09e527e91c112b4ffab1dba. + +- Introduce %tmpfiles_create_package + + %%tmpfiles_create is now deprecreated and the new macros should be + used instead. + + Upstream commit 0f78fee8d039000b987848a558fbaa15d916e14e. + +------------------------------------------------------------------- +Thu May 20 09:45:11 UTC 2021 - Franck Bui + +- %sysusers_create_inline: use here-docs instead of echo (bsc#1186282) + + Upstream commit dd2490ae12ad1e1795ecbf8f8944b950da9c8d06. + +------------------------------------------------------------------- +Fri Mar 5 12:27:14 UTC 2021 - Franck Bui + +- Bump to version 11 + +------------------------------------------------------------------- +Fri Mar 5 11:10:16 UTC 2021 - Antonio Larrosa + +- Don't pass -f to rm in %service_add_post nor %systemd_user_post + +------------------------------------------------------------------- +Fri Mar 5 11:03:49 UTC 2021 - Antonio Larrosa + +- Add a %systemd_user_pre macro that creates a + /run/systemd/rpm/needs-user-preset/$service file for each new + service being installed so %systemd_user_post can call + `systemctl --global preset $service` properly for newly + installed user services (boo#1183051, boo#1183012). + +------------------------------------------------------------------- +Thu Mar 4 13:11:15 UTC 2021 - Antonio Larrosa + +- Fix %systemd_user_post. The --global parameter was handled as if + it was another service name so %systemd_user_post wasn't working + properly. Replace %systemd_user_post with the code from + %service_add_post it was being expanded to but correctly passing + --global to systemctl (boo#1183051, boo#1182661). + +------------------------------------------------------------------- +Fri Feb 12 11:46:17 UTC 2021 - Franck Bui + +- Bump version to 10 + +------------------------------------------------------------------- +Fri Feb 12 11:02:57 UTC 2021 - Franck Bui + +- Make upstream %systemd_{pre,post,preun,postun} aliases to their SUSE + counterparts + + Packagers can now choose to use the upstream or the SUSE variants + indifferently. For consistency the SUSE variants should be preferred + since almost all SUSE packages already use them but the upstream + versions might be usefull in certain cases where packages need to + support multiple distros based on RPM. + +------------------------------------------------------------------- +Fri Feb 12 10:23:35 UTC 2021 - Franck Bui + +- Improve the logic used to apply the presets (bsc#1177039) + + Before presests were applied at a) package installation b) new units + introduced via a package update (but after making sure that it was + not a SysV initscript being converted). + + The problem is that a) didn't handle package a renaming or split + properly since the package with the new name is installed rather + being updated and therefore the presets were applied even if they + were already with the old name. + + We now cover this case (and the other ones) by applying presets only + if the units are new and the services are not being migrated. This + regardless of whether this happens during an install or an update. + +------------------------------------------------------------------- +Mon Nov 23 20:33:21 UTC 2020 - Franck Bui + +- Bump version to 9 + +------------------------------------------------------------------- +Mon Nov 23 16:48:05 UTC 2020 - Franck Bui + +- daemon-reload is not needed in %service_add_post + + Applying presets, ie enabling/disabling units, doesn't require to + update units loaded in PID1 memory. It's actually needed after and + it's done implicitly by `systemctl preset`. + +------------------------------------------------------------------- +Fri Nov 20 06:34:57 UTC 2020 - Franck Bui + +- Rename the tag file used to detect when presets need to be applied + + Rather than placing these tags directly under /run, let's place them + under /run/systemd/rpm. This also has the benefit to make the + workaround for bsc#1059627 no more needed. + +------------------------------------------------------------------- +Thu Nov 19 15:53:43 UTC 2020 - Franck Bui + +- %service_del_preun doesn't accept -f/-n options anymore + + The few package calling %service_del_preun with '-f' or '-n' option + have been fixed. These options are not needed anymore. + +------------------------------------------------------------------- +Tue Nov 10 11:21:44 UTC 2020 - Franck Bui + +- Bump version to 8 + +------------------------------------------------------------------- +Tue Nov 10 09:32:31 UTC 2020 - Franck Bui + +- Introduce %service_del_postun_with_restart() + + It's the counterpart of %service_del_postun_without_restart() and + replaces the '-f' option of %service_del_postun(). + +- Expand %service_del_postun_without_restart in %service_del_postun + +------------------------------------------------------------------- +Tue Nov 10 09:13:03 UTC 2020 - Franck Bui + +- Add a missing space in %_restart_on_update() + +------------------------------------------------------------------- +Mon Nov 9 11:38:23 UTC 2020 - Franck Bui + +- Bump version to 7 + +------------------------------------------------------------------- +Mon Nov 9 11:36:56 UTC 2020 - Franck Bui + +- Dont apply presets when migrating from a disabled initscript (bsc#1178481) + +------------------------------------------------------------------- +Mon Nov 9 08:47:04 UTC 2020 - Franck Bui + +- Bump version to 6 + +------------------------------------------------------------------- +Mon Nov 9 07:58:01 UTC 2020 - Franck Bui + +- Test for the presence of systemd only once in %service_add_post + +------------------------------------------------------------------- +Mon Nov 9 07:44:40 UTC 2020 - Franck Bui + +- No need to run 'systemd-sysv-convert --save' in %service_add_pre anymore + + Due to the fact that the initscripts being removed during package + updates are still available in %post, systemd-sysv-convert has been + reworked so it's only needed to call it in %post. + +------------------------------------------------------------------- +Mon Nov 9 07:35:12 UTC 2020 - Franck Bui + +- Make rpmbuild load our own macros.systemd to import %{%_unitdir} properly + + Ideally we should also own other %{_*dir} paths... + +- Stop owning /usr/lib/systemd directory as no package other than + systemd is supposed to put files there. + +------------------------------------------------------------------- +Mon Nov 2 14:36:43 UTC 2020 - Franck Bui + +- DISABLE_RESTART_ON_UDPATE is no more read from the (build) environment + + %service_del_postun_without_restart is the interface that should be + used by packages that need to prevent theirs services from being + restarted. + +------------------------------------------------------------------- +Fri Oct 30 17:39:01 UTC 2020 - Franck Bui + +- Bump version to 5 + +------------------------------------------------------------------- +Fri Oct 30 17:37:54 UTC 2020 - Franck Bui + +- Drop DISABLE_STOP_ON_REMOVAL support (jsc#SLE-8968) + + %service_del_preun still accepts '-n' and '-f' options to keep + backward compatibility with SLE (as some packages share the same + devel project between SLE and openSUSE) but these options are now + ignored on Factory. + +------------------------------------------------------------------- +Fri Sep 25 09:25:44 UTC 2020 - Franck Bui + +- Bump version to 4.1 + +------------------------------------------------------------------- +Tue Aug 25 00:48:04 UTC 2020 - Neal Gompa + +- Sync missing macros of directory paths from upstream systemd macros + + %_environmentdir + + %_modulesloaddir + + %_modprobedir + +------------------------------------------------------------------- +Tue Mar 12 08:17:25 UTC 2019 - Franck Bui + +- $1 can never be empty or it's an rpm bug + +------------------------------------------------------------------- +Tue Mar 12 08:03:45 UTC 2019 - Franck Bui + +- Get rid of $FIRST_ARG + + $FIRST_ARG was probably introduced because the %service_* macros + were playing tricks on the shell positional parameters. This is bad + practice and error prone so let's assume that no macros should do + that anymore and hence it's safe to assume that positional + parameters remains unchanged after any rpm macro call. + + All users of $FIRST_ARG should have been fixed by now and in most + cases the use of the variable was unneeded (since the macros don't + change the shell parameters) and thus confusing. + + 'net-snmp' has a different use of FIRST_ARG though as it tried to + fake an update during a package installation. Fortunately this could + have been fixed too. + +------------------------------------------------------------------- +Fri Mar 1 08:18:07 UTC 2019 - Franck Bui + +- Fix %_restart_on_update_force: drop one extra trailing '}' + + Thanks Werner for spotting. + +------------------------------------------------------------------- +Wed Feb 27 17:43:13 UTC 2019 - Franck Bui + +- Simplify %_restart_on_update and %_stop_on_removal + + There's no need to spawn sub shells when these macros are used. + +------------------------------------------------------------------- +Wed Feb 27 16:57:04 UTC 2019 - Franck Bui + +- Macros arguments are mandatory + + Especially in %_restart_on_update_never and %_stop_on_removal_never, + let's assume that they always receive unit names as arguments. This + allows to make them slightly simpler (less rpm macro black magic). + + Callers will fail earlier if no arguments are passed anyway. + +------------------------------------------------------------------- +Wed Feb 27 14:13:28 UTC 2019 - Franck Bui + +- Make sure %_restart_on_update_never and %_stop_on_removal_never + don't expand to the empty string + + Otherwise sequences like the following would result in incorrect + shell syntax: + + if [ ]; then + %_restart_on_update_never + fi + +------------------------------------------------------------------- +Wed Feb 27 12:17:18 UTC 2019 - Franck Bui + +- Restore one daemon-reload command + + It was erroneously removed during the drop of $YAST_IS_RUNNING. + +------------------------------------------------------------------- +Mon Feb 25 09:55:28 UTC 2019 - Franck Bui + +- Bump version to 4 + +------------------------------------------------------------------- +Thu Feb 22 13:00:18 UTC 2019 - Franck Bui + +- Introduce %service_del_postun_without_restart + + This is another step to make the SUSE rpm macros closer to their + upstream counterparts. + + Introduce %service_del_postun_without_restart which should help in + getting rid of '-f' and '-n' switches of %service_del_postun. + +------------------------------------------------------------------- +Thu Feb 21 17:53:18 UTC 2019 - Franck Bui + +- Drop $YAST_IS_RUNNING in favor of $SYSTEMD_OFFLINE (bsc#1117489) + + libzypp now kindly defines SYSTEMD_OFFLINE when appropriate (see + bsc#1118758). Therefore we don't need to rely on YAST_IS_RUNNING + anymore. It's a tiny step to make the SUSE macros closer to their + upstream counterparts. + +------------------------------------------------------------------- +Fri Nov 23 12:08:30 UTC 2018 - Franck Bui + +- systemd-sysv-convert has been moved from /usr/sbin to /usr/lib/systemd + +------------------------------------------------------------------- +Tue May 22 12:54:45 UTC 2018 - fbui@suse.com + +- remove confusing --user before --global + + Backport from + https://github.com/systemd/systemd/commit/28d36da64a7a23a55e8d0a139f2620384fd058b3. + + This was spotted in bsc#1090785. + +------------------------------------------------------------------- +Wed Feb 14 14:04:19 UTC 2018 - fbui@suse.com + +- Fix %systemd_post(): it's never called during package removal + + Also make it useful by restoring its original implementation. + +------------------------------------------------------------------- +Mon Feb 12 16:56:37 UTC 2018 - fbui@suse.com + +- Import more definitions from upstream (v237) + +------------------------------------------------------------------- +Mon Jan 22 11:33:28 UTC 2018 - dimstar@opensuse.org + +- Fix system_user_post macro for usage with RPM 4.14, backport from + https://github.com/systemd/systemd/commit/e67ba783. + +------------------------------------------------------------------- +Thu Dec 14 08:39:15 UTC 2017 - fbui@suse.com + +- Move macros.systemd in /usr/lib/rpm + + The file is not supposed to be customized by the user. + +------------------------------------------------------------------- +Wed Dec 13 17:14:25 UTC 2017 - fbui@suse.com + +- Make %systemd_add_pre() more similar to %systemd_add_post() + + The main advantage is that we pass only one argument to + systemd-sysv-convert script. The later can now be improved/rewritten + to handle only one argument and return a useful exit status. + +------------------------------------------------------------------- +Wed Dec 13 16:42:56 UTC 2017 - fbui@suse.com + +- Make sure to apply presets if packages start shipping units during upgrades (bsc#1071543) + + If a package started shipping units during upgrade only sysv + migration was done. However if the package didn't ship any sysv + scripts before no presets were applied. + + Now during upgrades, preset are always applied (still only during + the first time the units are installed) then followed by the sysv + migration machinery. + + The downside of this is that migrated services can have symlinks in + both runlevel.target.wants/ (created by the sysv migration) and in + the directory specified by the [Install] sections (created by + "systemctl preset")... + + The whole thing should be rewritten. + +------------------------------------------------------------------- +Fri Dec 1 10:47:29 UTC 2017 - fbui@suse.com + +- Make sure to clean up "new-in-upgrade" tag file (bsc#1059627) + + The tag file might have been incorrectly left by a preceding update. + +------------------------------------------------------------------- +Wed Nov 22 14:41:00 UTC 2017 - fbui@suse.com + +- Restore previous changes + +------------------------------------------------------------------- +Fri Nov 17 09:23:14 UTC 2017 - fbui@suse.com + +- Revert previous changes + + Also added reasons why the previous changes would be needed. + +------------------------------------------------------------------- +Fri Nov 17 07:44:55 CET 2017 - kukuk@suse.de + +- Don't execute systemd-tmpfiles if we run in transactional update + mode + + If you do transactional updates, it doesn't make any sense to + execute the tmpfiles. They will only create a lot of directories, + files or symlinks in empty directories without any use and later + hidden under the real mount points. With transactional updates, you + should do such things always during the boot phase, as designed by + systemd (and like Fedora and RHEL doing, but in their use case it's + in my opinion a bug). + +------------------------------------------------------------------- +Thu Nov 2 16:09:29 UTC 2017 - fbui@suse.com + +- Remove a useless test in %service_add_pre() + + The test was placed where the condition '[ "$FIRST_ARG" -gt 1 ]' was + always true. + +------------------------------------------------------------------- +Fri Jun 2 09:59:37 UTC 2017 - dimstar@opensuse.org + +- BuildIgnore systemd-rpm-macros: a small cycle that can be + avoided. system-rpm-macros is being pulled in by rpm-build as + conveniance to the packagers. + +------------------------------------------------------------------- +Fri Jun 2 09:31:50 UTC 2017 - fbui@suse.com + +- Reference bsc#956849 to please the new OBS 'sanity' check (bsc#1041386) + + %tmpfiles_create is already part of the version shipped by Factory + so there's nothing to do here execpt mentioning (bsc#956849). + +------------------------------------------------------------------- +Fri Mar 10 11:54:11 UTC 2017 - fbui@suse.com + +- Kill preset macros + + The last users have been fixed so these macros are no more used by + any package. + + The introduction of them was a bad idea and only the branding preset + package is still using a similar mechanism but at least it's now + self contained in this package. Also the package calls now a shell + script instead of rpm macros. + + Upstream is working on making this completely obsolete so the preset + branding package could be cleaned up for good. + +------------------------------------------------------------------- +Wed Jan 11 11:16:11 UTC 2017 - jengelh@inai.de + +- RPM group fix + +------------------------------------------------------------------- +Fri Jun 3 14:47:01 UTC 2016 - Thomas.Blume@suse.com + +- %service_add_post() suppress daemon-reload when in installation + system (bsc#982343) + +------------------------------------------------------------------- +Thu Mar 3 10:01:52 UTC 2016 - werner@suse.de + +- Allow the packagers to specify the options -f and -n on the + macros %service_del_preun(), %service_del_postun(), %systemd_post(), + and %systemd_preun() (boo#968405) + +------------------------------------------------------------------- +Sat Feb 27 10:18:55 UTC 2016 - dimstar@opensuse.org + +- Also honor DISABLE_STOP_ON_REMOVAL and DISABLE_RESTART_ON_UPDATE + when specified by a package directly in the .spec file. Some + package know that a restart of their service is fatal + (boo#968405). + +------------------------------------------------------------------- +Fri Nov 20 16:53:23 UTC 2015 - werner@suse.de + +- Support of DISABLE_STOP_ON_REMOVAL and DISABLE_RESTART_ON_UPDATE + from /etc/sysconfig/service (bsc#955996) + +------------------------------------------------------------------- +Fri Sep 18 15:27:04 CEST 2015 - sbrabec@suse.com + +- Skip %systemd_preset_* during the clean installation to prevent + presetting of all services (boo#946216). + +------------------------------------------------------------------- +Tue Aug 4 17:59:54 CEST 2015 - sbrabec@suse.com + +- Add %systemd_preset_pre and %systemd_preset_posttrans that will + do one shot presetting of all services with changed system + preset. It makes possible to to fix bad default service state + (bnc#900935#c46, FATE#318949, FATE#317727, bnc#921075). +- Increment version to 3. + +------------------------------------------------------------------- +Mon Jun 15 11:33:28 UTC 2015 - jengelh@inai.de + +- Check for presence/executability of systemd programs before + executing them, and do not suppress warnings/errors resulting + from them. + +------------------------------------------------------------------- +Fri Jan 9 13:38:16 UTC 2015 - jengelh@inai.de + +- Update with new macros from systemd 218 +- Remove empty sections from specfile + +------------------------------------------------------------------- +Tue Nov 18 15:16:13 UTC 2014 - werner@suse.de + +- Mark /etc/rpm/macros.systemd as configuration file + +------------------------------------------------------------------- +Tue Nov 18 13:30:37 UTC 2014 - werner@suse.de + +- Apply then delete patch systemd-daemon-reload-before-service-restart.patch +- Add orignal systemd macros as well (boo#807164) + +------------------------------------------------------------------- +Wed Oct 15 09:28:36 UTC 2014 - thomas.blume@suse.com + +- make systemd aware of changed unit file content after update + add systemd-daemon-reload-before-service-restart.patch + +------------------------------------------------------------------- +Thu Mar 27 14:44:53 UTC 2014 - werner@suse.de + +- Add a %_ntpunitsdir macro + +------------------------------------------------------------------- +Thu Mar 27 12:22:11 UTC 2014 - fcrozat@suse.com + +- Add support to not restart services if running in YaST2 or + if DISABLE_RESTART_ON_UPDATE is set to yes [bnc#858429] + +------------------------------------------------------------------- +Fri Feb 28 10:10:24 UTC 2014 - werner@suse.de + +- Require coreutils as rm and touch are used + +------------------------------------------------------------------- +Fri Feb 7 12:43:13 UTC 2014 - werner@suse.de + +- Make systemd rpm macros package a separate to avoid rebuild of + the full package tree if systemd package change + +------------------------------------------------------------------- +Thu Jul 4 13:59:43 CEST 2013 - fcrozat@suse.com + +- Resync with systemd v205 macros + +------------------------------------------------------------------- +Mon Jun 17 10:49:50 UTC 2013 - mhrusecky@suse.com + +- New package with systemd rpm macros to avoid unnecessary build time + dependencies + diff --git a/systemd-rpm-macros.spec b/systemd-rpm-macros.spec new file mode 100644 index 0000000..62abdae --- /dev/null +++ b/systemd-rpm-macros.spec @@ -0,0 +1,53 @@ +# +# spec file for package systemd-rpm-macros +# +# Copyright (c) 2023 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +Name: systemd-rpm-macros +Version: 24 +Release: 0 +Summary: RPM macros for systemd +License: LGPL-2.1-or-later +Group: Development/Tools/Building +URL: http://en.opensuse.org/openSUSE:Systemd_packaging_guidelines +Source0: macros.systemd +Requires: coreutils +BuildRoot: %{_tmppath}/%{name}-%{version}-build +BuildArch: noarch +#!BuildIgnore: util-linux +#!BuildIgnore: %{name} + +# We need our own definition of %{_unitdir}. +%{load:%{S:0}} + +%description +Starting with openSUSE 12.1, several RPM macros must be used to package systemd +services files. This package provides these macros. + +%prep + +%build + +%install +install -Dm644 %{S:0} %{buildroot}%{_rpmconfigdir}/macros.d/macros.systemd +mkdir -p %{buildroot}%{_unitdir} + +%files +%defattr(-,root,root) +%{_rpmconfigdir}/macros.d/macros.systemd +%dir %{_unitdir} + +%changelog -- 2.51.1 From 94d4e7021970d73c77293850503d489963f91572b2d94bfc9b73f2e5bf96d388 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Sat, 24 Jun 2023 08:42:05 +0000 Subject: [PATCH 2/6] - Bump to version 25 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=103 --- systemd-rpm-macros.changes | 5 +++++ systemd-rpm-macros.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/systemd-rpm-macros.changes b/systemd-rpm-macros.changes index 8522b4a..25615ac 100644 --- a/systemd-rpm-macros.changes +++ b/systemd-rpm-macros.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sat Jun 24 08:41:48 UTC 2023 - Franck Bui + +- Bump to version 25 + ------------------------------------------------------------------- Sat Jun 24 08:40:00 UTC 2023 - Franck Bui diff --git a/systemd-rpm-macros.spec b/systemd-rpm-macros.spec index 62abdae..26f4236 100644 --- a/systemd-rpm-macros.spec +++ b/systemd-rpm-macros.spec @@ -17,7 +17,7 @@ Name: systemd-rpm-macros -Version: 24 +Version: 25 Release: 0 Summary: RPM macros for systemd License: LGPL-2.1-or-later -- 2.51.1 From 6035ade6d23cd23bc7665e84eb7c88dab314062c0fdfffd0417dddcb09841c12 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 24 Oct 2023 13:40:15 +0000 Subject: [PATCH 3/6] Update comments, fix indentation OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=104 --- macros.systemd | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/macros.systemd b/macros.systemd index cc9888a..b475c0d 100644 --- a/macros.systemd +++ b/macros.systemd @@ -1,10 +1,9 @@ -# -*- Mode: rpm-spec; indent-tabs-mode: t -*- +# -*- mode: shell-script; indent-tabs-mode: t -*- # RPM macros for packages installing systemd unit files # ### # -# When a package install systemd unit files, it should use the -# following macros: +# When a package install systemd unit files, it should use the following macros: # # add %systemd_requires in the specfile # @@ -21,10 +20,10 @@ # %service_del_postun demo.service # %service_del_postun_without_restart demo.service # -# Note: the upstream variants are also available and are aliases to -# their SUSE counterparts. However for consistency the SUSE macros -# should be preferred unless the package is intended to be portable -# across multiple distributions based on RPM. +# Note: the upstream variants are also available and are aliases to their SUSE +# counterparts. However for consistency the SUSE macros should be preferred +# unless the package is intended to be portable across multiple distributions +# based on RPM. %_systemd_util_dir /usr/lib/systemd %_unitdir /usr/lib/systemd/system @@ -175,7 +174,7 @@ fi \ %systemd_user_preun() \ %{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# systemd_user_preun}} \ if [ $1 -eq 0 ] && [ -x /usr/lib/systemd/systemd-update-helper ]; then \ - # Package removal, not upgrade \ + # Package removal, not upgrade \ /usr/lib/systemd/systemd-update-helper remove-user-units %{?*} || : \ fi \ %{nil} @@ -188,15 +187,17 @@ fi \ %systemd_user_postun_with_restart() \ %{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# systemd_user_postun_with_restart}} \ if [ $1 -ge 1 ] && [ -x /usr/lib/systemd/systemd-update-helper ]; then \ - # Package upgrade, not uninstall \ - /usr/lib/systemd/systemd-update-helper mark-restart-user-units %{?*} || : \ + # Package upgrade, not uninstall \ + /usr/lib/systemd/systemd-update-helper mark-restart-user-units %{?*} || : \ fi \ %{nil} # -# The following macros are empty as we have file triggers in place for hwdb, -# journal catalog, udev rules, binfmt and sysctl. They're kept for backward -# compatibility sake with SLE which hasn't been converted to file-triggers yet. +# The following macros are empty as systemd trans-file-triggers are in place for +# hwdb, journal catalog, udev rules, binfmt and sysctl. +# +# Note: 'sysctl_apply' and 'binfmt_apply' don't have any users that rely on +# their immediate effect. # %udev_hwdb_update() :%{nil} @@ -204,10 +205,6 @@ fi \ %journal_catalog_update() :%{nil} -# Currently the 2 following macros don't have any interesting users. Leave them -# empty until a package needs something more specific like applying the changes -# before the macros return. - %sysctl_apply() \ %{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# sysctl_apply}} \ : \ -- 2.51.1 From c29caf25aae8b5cc501a2706220c8b559f0e4cfd8f4b76376c98696e17b633be Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Mon, 7 Jul 2025 16:05:30 +0000 Subject: [PATCH 4/6] - Introduce %udevadm_reload_and_trigger() for packages that need to trigger event in theirs scriplets. The new macro automatically triggers a reload of the udev rule files as this step is often overlooked by packages (bsc#1237143). OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=105 --- macros.systemd | 18 ++++++++++++++++++ systemd-rpm-macros.changes | 8 ++++++++ systemd-rpm-macros.spec | 2 +- 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/macros.systemd b/macros.systemd index b475c0d..deac75e 100644 --- a/macros.systemd +++ b/macros.systemd @@ -215,6 +215,24 @@ fi \ : \ %{nil} +# +# This should be used when a package needs to execute the shipped udev rules +# during its installation. It automatically triggers a reload of the rule files, +# as this step is often overlooked by packages. +# +# Note1: The version of this macro shipped with SLE < 16 only supports a limited +# subset of options, due to the older RPM versions (< 4.17), which lacks support +# for disabling option processing. +# +# Note2: This is suboptimal when multiple events need to be triggered, as it +# results in multiple reloads of the rule files. +# +%udevadm_reload_and_trigger(-) \ +if [ -e /run/udev/control ]; then \ + /usr/bin/udevadm control --reload && /usr/bin/udevadm trigger %{?*} || : \ +fi \ +%{nil} + # The 2 following macros have also been converted into NOPs since we moved to # file triggers. Some packages might have assumed that their effects were # effective as soon as the macros return. However such assumption on tmpfiles diff --git a/systemd-rpm-macros.changes b/systemd-rpm-macros.changes index 25615ac..10f7cc3 100644 --- a/systemd-rpm-macros.changes +++ b/systemd-rpm-macros.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Jul 7 15:56:08 UTC 2025 - Franck Bui + +- Introduce %udevadm_reload_and_trigger() for packages that need to trigger + event in theirs scriplets. The new macro automatically triggers a reload of + the udev rule files as this step is often overlooked by packages + (bsc#1237143). + ------------------------------------------------------------------- Sat Jun 24 08:41:48 UTC 2023 - Franck Bui diff --git a/systemd-rpm-macros.spec b/systemd-rpm-macros.spec index 26f4236..d2fd12e 100644 --- a/systemd-rpm-macros.spec +++ b/systemd-rpm-macros.spec @@ -1,7 +1,7 @@ # # spec file for package systemd-rpm-macros # -# Copyright (c) 2023 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed -- 2.51.1 From 8ae5168edec26144bc3c32764219f0e6365ef748288fbaf814121e0a596bd3b3 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 8 Jul 2025 12:45:35 +0000 Subject: [PATCH 5/6] Rename %udevadm_reload_and_trigger into %udev_trigger_with_reload OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=106 --- macros.systemd | 2 +- systemd-rpm-macros.changes | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/macros.systemd b/macros.systemd index deac75e..d2225e5 100644 --- a/macros.systemd +++ b/macros.systemd @@ -227,7 +227,7 @@ fi \ # Note2: This is suboptimal when multiple events need to be triggered, as it # results in multiple reloads of the rule files. # -%udevadm_reload_and_trigger(-) \ +%udev_trigger_with_reload(-) \ if [ -e /run/udev/control ]; then \ /usr/bin/udevadm control --reload && /usr/bin/udevadm trigger %{?*} || : \ fi \ diff --git a/systemd-rpm-macros.changes b/systemd-rpm-macros.changes index 10f7cc3..483d128 100644 --- a/systemd-rpm-macros.changes +++ b/systemd-rpm-macros.changes @@ -1,10 +1,9 @@ ------------------------------------------------------------------- Mon Jul 7 15:56:08 UTC 2025 - Franck Bui -- Introduce %udevadm_reload_and_trigger() for packages that need to trigger - event in theirs scriplets. The new macro automatically triggers a reload of - the udev rule files as this step is often overlooked by packages - (bsc#1237143). +- Introduce %udev_trigger_with_reload() for packages that need to trigger events + in theirs scriplets. The new macro automatically triggers a reload of the udev + rule files as this step is often overlooked by packages (bsc#1237143). ------------------------------------------------------------------- Sat Jun 24 08:41:48 UTC 2023 - Franck Bui -- 2.51.1 From b11fa333416539cc93981328b3378453eec36507854466f56a7ddbb810b25e47 Mon Sep 17 00:00:00 2001 From: Franck Bui Date: Tue, 8 Jul 2025 12:59:51 +0000 Subject: [PATCH 6/6] - Bump version to 26 OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=107 --- systemd-rpm-macros.changes | 5 +++++ systemd-rpm-macros.spec | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/systemd-rpm-macros.changes b/systemd-rpm-macros.changes index 483d128..1b265f6 100644 --- a/systemd-rpm-macros.changes +++ b/systemd-rpm-macros.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Jul 8 12:58:05 UTC 2025 - Franck Bui + +- Bump version to 26 + ------------------------------------------------------------------- Mon Jul 7 15:56:08 UTC 2025 - Franck Bui diff --git a/systemd-rpm-macros.spec b/systemd-rpm-macros.spec index d2fd12e..2021f11 100644 --- a/systemd-rpm-macros.spec +++ b/systemd-rpm-macros.spec @@ -17,7 +17,7 @@ Name: systemd-rpm-macros -Version: 25 +Version: 26 Release: 0 Summary: RPM macros for systemd License: LGPL-2.1-or-later -- 2.51.1