forked from pool/systemd-rpm-macros
Compare commits
49 Commits
Author | SHA256 | Date | |
---|---|---|---|
7e2e057b8a | |||
b11fa33341 | |||
8ae5168ede | |||
c29caf25aa | |||
6035ade6d2 | |||
94d4e70219 | |||
c655bd931d | |||
e505f87a5f | |||
3f53730fbd | |||
5c9fe37785 | |||
65e4499aad | |||
ee0e9c503a | |||
5e6ce41a2e | |||
4d32552d81 | |||
4179f1a8d5 | |||
af577426eb | |||
c89bed18ac | |||
e39be33398 | |||
efa0f81b4c | |||
a42dcffc95 | |||
35bb9dbe84 | |||
7dc94d55a2 | |||
9a8aa1a4fc | |||
b24f8bd8f8 | |||
bb2e625770 | |||
d149e5b431 | |||
d1fdb9ed76 | |||
4a1ed673cc | |||
c79891677b | |||
89a0103cb2 | |||
03ebeca141 | |||
633172ab0f | |||
d7bf56383d | |||
cf13919858 | |||
d010d67735 | |||
036073adb7 | |||
30c7c5735e | |||
39da991d6b | |||
d578345058 | |||
007e3d4617 | |||
8547095cde | |||
43d284c882 | |||
|
da0eff5875 | ||
|
779e2cbd00 | ||
7fc41dd518 | |||
71c439266f | |||
|
cb52adcdfc | ||
|
bc6fa70f5a | ||
|
81a5da2128 |
@@ -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
|
# RPM macros for packages installing systemd unit files
|
||||||
#
|
#
|
||||||
###
|
###
|
||||||
#
|
#
|
||||||
# When a package install systemd unit files, it should use the
|
# When a package install systemd unit files, it should use the following macros:
|
||||||
# following macros:
|
|
||||||
#
|
#
|
||||||
# add %systemd_requires in the specfile
|
# add %systemd_requires in the specfile
|
||||||
#
|
#
|
||||||
@@ -21,10 +20,10 @@
|
|||||||
# %service_del_postun demo.service
|
# %service_del_postun demo.service
|
||||||
# %service_del_postun_without_restart demo.service
|
# %service_del_postun_without_restart demo.service
|
||||||
#
|
#
|
||||||
# Note: the upstream variants are also available and are aliases to
|
# Note: the upstream variants are also available and are aliases to their SUSE
|
||||||
# their SUSE counterparts. However for consistency the SUSE macros
|
# counterparts. However for consistency the SUSE macros should be preferred
|
||||||
# should be preferred unless the package is intended to be portable
|
# unless the package is intended to be portable across multiple distributions
|
||||||
# across multiple distributions based on RPM.
|
# based on RPM.
|
||||||
|
|
||||||
%_systemd_util_dir /usr/lib/systemd
|
%_systemd_util_dir /usr/lib/systemd
|
||||||
%_unitdir /usr/lib/systemd/system
|
%_unitdir /usr/lib/systemd/system
|
||||||
@@ -175,7 +174,7 @@ fi \
|
|||||||
%systemd_user_preun() \
|
%systemd_user_preun() \
|
||||||
%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# systemd_user_preun}} \
|
%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# systemd_user_preun}} \
|
||||||
if [ $1 -eq 0 ] && [ -x /usr/lib/systemd/systemd-update-helper ]; then \
|
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 %{?*} || : \
|
/usr/lib/systemd/systemd-update-helper remove-user-units %{?*} || : \
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
@@ -188,25 +187,24 @@ fi \
|
|||||||
%systemd_user_postun_with_restart() \
|
%systemd_user_postun_with_restart() \
|
||||||
%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# 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 \
|
if [ $1 -ge 1 ] && [ -x /usr/lib/systemd/systemd-update-helper ]; then \
|
||||||
# Package upgrade, not uninstall \
|
# Package upgrade, not uninstall \
|
||||||
/usr/lib/systemd/systemd-update-helper mark-restart-user-units %{?*} || : \
|
/usr/lib/systemd/systemd-update-helper mark-restart-user-units %{?*} || : \
|
||||||
fi \
|
fi \
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
#
|
#
|
||||||
# The following macros are empty as we have file triggers in place for hwdb,
|
# The following macros are empty as systemd trans-file-triggers are in place for
|
||||||
# journal catalog, udev rules, binfmt and sysctl.
|
# 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}
|
%udev_hwdb_update() :%{nil}
|
||||||
|
|
||||||
%udev_rules_update() :%{nil}
|
%udev_rules_update() :%{nil}
|
||||||
|
|
||||||
%journal_catalog_update() :%{nil}
|
%journal_catalog_update() :%{nil}
|
||||||
|
|
||||||
# Currently the 2 following macros don't have any interesting users. Leave them
|
|
||||||
# empty until a specific need appears.
|
|
||||||
|
|
||||||
%sysctl_apply() \
|
%sysctl_apply() \
|
||||||
%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# sysctl_apply}} \
|
%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# sysctl_apply}} \
|
||||||
: \
|
: \
|
||||||
@@ -217,26 +215,42 @@ fi \
|
|||||||
: \
|
: \
|
||||||
%{nil}
|
%{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.
|
|
||||||
#
|
#
|
||||||
# FIXME: these macros could be converted to NOPs since we moved to file
|
# This should be used when a package needs to execute the shipped udev rules
|
||||||
# triggers. However some packages might assume that the macros effects are
|
# during its installation. It automatically triggers a reload of the rule files,
|
||||||
# effective as soon as the macros return. This reason is actually moot since
|
# as this step is often overlooked by packages.
|
||||||
# this can't work on transactional systems anyway.
|
|
||||||
#
|
#
|
||||||
|
# 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.
|
||||||
|
#
|
||||||
|
%udev_trigger_with_reload(-) \
|
||||||
|
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
|
||||||
|
# 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() \
|
%tmpfiles_create() \
|
||||||
%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# tmpfiles_create}} \
|
%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# tmpfiles_create}} \
|
||||||
[ -z "${TRANSACTIONAL_UPDATE}" ] && [ -x /usr/bin/systemd-tmpfiles ] && \
|
: \
|
||||||
/usr/bin/systemd-tmpfiles --create %{?*} || : \
|
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
%sysusers_create() \
|
%sysusers_create() \
|
||||||
%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# sysusers_create}} \
|
%{expand:%%{?__systemd_someargs_%#:%%__systemd_someargs_%# sysusers_create}} \
|
||||||
[ -z "${TRANSACTIONAL_UPDATE}" ] && [ -x /usr/bin/systemd-sysusers ] && \
|
: \
|
||||||
/usr/bin/systemd-sysusers %{?*} || : \
|
|
||||||
%{nil}
|
%{nil}
|
||||||
|
|
||||||
# This should be used by package installation scripts which require users or
|
# This should be used by package installation scripts which require users or
|
||||||
|
@@ -1,3 +1,35 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jul 8 12:58:05 UTC 2025 - Franck Bui <fbui@suse.com>
|
||||||
|
|
||||||
|
- Bump version to 26
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Mon Jul 7 15:56:08 UTC 2025 - Franck Bui <fbui@suse.com>
|
||||||
|
|
||||||
|
- 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 <fbui@suse.com>
|
||||||
|
|
||||||
|
- Bump to version 25
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Sat Jun 24 08:40:00 UTC 2023 - Franck Bui <fbui@suse.com>
|
||||||
|
|
||||||
|
- 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 <fbui@suse.com>
|
Tue Jun 20 16:08:47 UTC 2023 - Franck Bui <fbui@suse.com>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package systemd-rpm-macros
|
# 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
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
Name: systemd-rpm-macros
|
Name: systemd-rpm-macros
|
||||||
Version: 24
|
Version: 26
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: RPM macros for systemd
|
Summary: RPM macros for systemd
|
||||||
License: LGPL-2.1-or-later
|
License: LGPL-2.1-or-later
|
||||||
|
Reference in New Issue
Block a user