Initialize for systemd-rpm-macros
This commit is contained in:
commit
cfa06443da
5 changed files with 672 additions and 0 deletions
0
.gitignore
vendored
Normal file
0
.gitignore
vendored
Normal file
0
.systemd-rpm-macros.metadata
Normal file
0
.systemd-rpm-macros.metadata
Normal file
353
macros.systemd
Normal file
353
macros.systemd
Normal file
|
@ -0,0 +1,353 @@
|
|||
# -*- 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_with_restart 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
|
||||
%_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 /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}
|
||||
|
||||
%_restart_on_update_force() \
|
||||
%{warn: '-f' with %%service_del_postun is deprecated, use %%service_del_postun_with_restart instead} \
|
||||
(\
|
||||
test "$YAST_IS_RUNNING" = instsys && exit 0 \
|
||||
%{?*:/usr/bin/systemctl try-restart %{*}} \
|
||||
) || : \
|
||||
%{nil}
|
||||
|
||||
%_restart_on_update_never() \
|
||||
%{warn: '-n' with %%service_del_postun is deprecated, use %%service_del_postun_without_restart instead} \
|
||||
%{?*: : # Restart of %{*} skipped} \
|
||||
%{nil}
|
||||
|
||||
%_restart_on_update() (\
|
||||
test "$YAST_IS_RUNNING" = instsys && exit 0\
|
||||
test -f /etc/sysconfig/services -a \\\
|
||||
-z "$DISABLE_RESTART_ON_UPDATE" && . /etc/sysconfig/services\
|
||||
test "$DISABLE_RESTART_ON_UPDATE" = yes -o \\\
|
||||
"$DISABLE_RESTART_ON_UPDATE" = 1 && exit 0\
|
||||
%{?*:/usr/bin/systemctl try-restart %{*}}\
|
||||
) || : %{nil}
|
||||
|
||||
%_stop_on_removal_force() \
|
||||
%{warn: '-f' with %%service_del_preun is deprecated, please dont use it anymore} \
|
||||
( \
|
||||
test "$YAST_IS_RUNNING" = instsys && exit 0\
|
||||
%{?*:/usr/bin/systemctl stop %{*}}\
|
||||
) || : \
|
||||
%{nil}
|
||||
|
||||
%_stop_on_removal_never() \
|
||||
%{warn: '-n' with %%service_del_preun is unsafe, please dont use it anymore} \
|
||||
%{?*: : # Stop of %{*} skipped} \
|
||||
%{nil}
|
||||
|
||||
%_stop_on_removal() (\
|
||||
test "$YAST_IS_RUNNING" = instsys && exit 0\
|
||||
test -f /etc/sysconfig/services -a \\\
|
||||
-z "$DISABLE_STOP_ON_REMOVAL" && . /etc/sysconfig/services\
|
||||
test "$DISABLE_STOP_ON_REMOVAL" = yes -o \\\
|
||||
"$DISABLE_STOP_ON_REMOVAL" = 1 && exit 0\
|
||||
%{?*:/usr/bin/systemctl stop %{*}}\
|
||||
) || : %{nil}
|
||||
|
||||
# Figure out 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 install but also
|
||||
# during package update. On update, packages might introduce new
|
||||
# services but we need to make sure that's not happening during the
|
||||
# migration of SysV initscripts. On package install, presets might
|
||||
# have been already applied because of package renaming or split.
|
||||
#
|
||||
%service_add_pre() \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
||||
[ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \
|
||||
\
|
||||
for service in %{?*} ; do \
|
||||
sysv_service=${service%.*} \
|
||||
\
|
||||
if [ ! -e /usr/lib/systemd/system/$service ] && \
|
||||
[ ! -e /etc/init.d/$sysv_service ]; then \
|
||||
mkdir -p /run/systemd/rpm/needs-preset \
|
||||
touch /run/systemd/rpm/needs-preset/$service \
|
||||
\
|
||||
elif [ -e /etc/init.d/$sysv_service ] && \
|
||||
[ ! -e /var/lib/systemd/migrated/$sysv_service ]; then \
|
||||
/usr/sbin/systemd-sysv-convert --save $sysv_service || : \
|
||||
mkdir -p /run/systemd/rpm/needs-sysv-convert \
|
||||
touch /run/systemd/rpm/needs-sysv-convert/$service \
|
||||
fi \
|
||||
done \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
# Apply the presets if %pre told us to do so.
|
||||
#
|
||||
%service_add_post() \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
||||
[ -d /var/lib/systemd/migrated ] || mkdir -p /var/lib/systemd/migrated || : \
|
||||
\
|
||||
if [ "$YAST_IS_RUNNING" != "instsys" ]; then \
|
||||
/usr/bin/systemctl daemon-reload || : \
|
||||
fi \
|
||||
for service in %{?*} ; do \
|
||||
sysv_service=${service%.*} \
|
||||
\
|
||||
if [ -e /run/systemd/rpm/needs-preset/$service ]; then \
|
||||
/usr/bin/systemctl preset $service || : \
|
||||
rm "/run/systemd/rpm/needs-preset/$service" || : \
|
||||
\
|
||||
elif [ -e /run/systemd/rpm/needs-sysv-convert/$service ]; then \
|
||||
/usr/sbin/systemd-sysv-convert --apply $sysv_service || : \
|
||||
rm "/run/systemd/rpm/needs-sysv-convert/$service" || : \
|
||||
touch /var/lib/systemd/migrated/$sysv_service || : \
|
||||
fi \
|
||||
done \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
# On removal, tell systemd to stop service
|
||||
#
|
||||
# Deprecated options, please do not use in new code:
|
||||
# -f : force service stop on removal (deprecated, will be the default)
|
||||
# -n : do not stop service on removal (unsafe, do not use)
|
||||
#
|
||||
# The default is to check for DISABLE_STOP_ON_REMOVAL environment
|
||||
# variable if not found use the value read from /etc/sysconfig/services.
|
||||
#
|
||||
# NOTE: the default behavior is deprecated and DISABLE_STOP_ON_REMOVAL
|
||||
# support will be removed soon, please do NOT rely on it anymore.
|
||||
#
|
||||
%service_del_preun(fn) \
|
||||
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
||||
if [ "$FIRST_ARG" -eq 0 -a -x /usr/bin/systemctl ]; then \
|
||||
# Package removal, not upgrade \
|
||||
/usr/bin/systemctl --no-reload disable %{?*} || : \
|
||||
%{expand:%%_stop_on_removal%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \
|
||||
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.
|
||||
#
|
||||
%service_del_postun_without_restart() \
|
||||
if [ $1 -eq 0 ]; then \
|
||||
# Package removal \
|
||||
for service in %{?*} ; do \
|
||||
sysv_service="${service%.*}" \
|
||||
rm -f "/var/lib/systemd/migrated/$sysv_service" || : \
|
||||
done \
|
||||
fi \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
/usr/bin/systemctl daemon-reload || : \
|
||||
fi \
|
||||
%{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() \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
/usr/bin/systemctl daemon-reload || : \
|
||||
if [ $1 -ge 1 ]; then \
|
||||
# Package upgrade, not uninstall \
|
||||
/usr/bin/systemctl try-restart %{?*} || : \
|
||||
fi \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
# On uninstall, tell systemd to reload its unit files
|
||||
#
|
||||
# Deprecated options, please do not use in new code:
|
||||
# -f : force restart on update (replaced by %service_del_postun_with_restart)
|
||||
# -n : don't restart on update (replaced by %service_del_postun_without_restart)
|
||||
#
|
||||
# The default is to read DISABLE_RESTART_ON_UPDATE from /etc/sysconfig/services
|
||||
#
|
||||
%service_del_postun(fn) \
|
||||
test -n "$FIRST_ARG" || FIRST_ARG="$1" \
|
||||
%service_del_postun_without_restart %{?*} \
|
||||
if [ "$FIRST_ARG" -ge 1 ]; then \
|
||||
# Package upgrade, not uninstall \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
%{expand:%%_restart_on_update%{-f:_force}%{!-f:%{-n:_never}} %{?*}} \
|
||||
fi \
|
||||
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 %{?**}}
|
||||
|
||||
%systemd_user_pre() \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
for service in %{?*} ; do \
|
||||
if [ ! -e "/usr/lib/systemd/user/$service" ]; then \
|
||||
mkdir -p /run/systemd/rpm/needs-user-preset \
|
||||
touch "/run/systemd/rpm/needs-user-preset/$service" \
|
||||
fi \
|
||||
done \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
%systemd_user_post() \
|
||||
if [ -x /usr/bin/systemctl ]; then \
|
||||
for service in %{?*} ; do \
|
||||
if [ -e "/run/systemd/rpm/needs-user-preset/$service" ]; then \
|
||||
/usr/bin/systemctl --global preset "$service" || : \
|
||||
rm "/run/systemd/rpm/needs-user-preset/$service" || : \
|
||||
fi \
|
||||
done \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
%systemd_user_preun() \
|
||||
if [ $1 -eq 0 -a -x /usr/bin/systemctl ]; then \
|
||||
# Package removal, not upgrade \
|
||||
/usr/bin/systemctl --global disable %{?*} || : \
|
||||
fi \
|
||||
%{nil}
|
||||
|
||||
%systemd_user_postun() %{nil}
|
||||
%systemd_user_postun_with_restart() %{nil}
|
||||
|
||||
%udev_hwdb_update() \
|
||||
[ -x /usr/bin/systemd-hwdb ] && /usr/bin/systemd-hwdb update || : \
|
||||
%{nil}
|
||||
|
||||
%udev_rules_update() \
|
||||
[ -x /usr/bin/udevadm ] && /usr/bin/udevadm control --reload || : \
|
||||
%{nil}
|
||||
|
||||
%journal_catalog_update() \
|
||||
[ -x /usr/bin/journalctl ] && /usr/bin/journalctl --update-catalog || : \
|
||||
%{nil}
|
||||
|
||||
%tmpfiles_create() \
|
||||
[ -z "${TRANSACTIONAL_UPDATE}" -a -x /usr/bin/systemd-tmpfiles ] && \
|
||||
/usr/bin/systemd-tmpfiles --create %{?*} || : \
|
||||
%{nil}
|
||||
|
||||
# This should be used by package installation scripts which doesn't require
|
||||
# users or groups to be present before the files installed by the package are
|
||||
# present on disk and when the sysusers conf files are generated during the
|
||||
# build of the package hence not easily available before the build of the
|
||||
# package.
|
||||
#
|
||||
# This macro will go away when this will be moved to file triggers.
|
||||
#
|
||||
# Example:
|
||||
# %post
|
||||
# %sysusers_create %{name}.conf
|
||||
# %files
|
||||
# %{_sysusersdir}/%{name}.conf
|
||||
#
|
||||
%sysusers_create() \
|
||||
[ -x /usr/bin/systemd-sysusers ] && /usr/bin/systemd-sysusers %{?*} || : \
|
||||
%{nil}
|
||||
|
||||
%sysusers_create_inline() \
|
||||
[ -x /usr/bin/systemd-sysusers ] && /usr/bin/systemd-sysusers - <<SYSTEMD_INLINE_EOF || : \
|
||||
%{?*} \
|
||||
SYSTEMD_INLINE_EOF\
|
||||
%{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
|
||||
#
|
||||
%sysusers_create_package() \
|
||||
/usr/bin/systemd-sysusers --replace=%_sysusersdir/%1.conf - <<SYSTEMD_INLINE_EOF || : \
|
||||
%(cat %2) \
|
||||
SYSTEMD_INLINE_EOF\
|
||||
%{nil}
|
||||
|
||||
%sysctl_apply() \
|
||||
[ -d /run/systemd/system ] && [ -x /usr/lib/systemd/systemd-sysctl ] && \
|
||||
/usr/lib/systemd/systemd-sysctl %{?*} || : \
|
||||
%{nil}
|
||||
|
||||
%binfmt_apply() \
|
||||
[ -d /run/systemd/system ] && [ -x /usr/lib/systemd/systemd-binfmt ] && \
|
||||
/usr/lib/systemd/systemd-binfmt %{?*} || : \
|
||||
%{nil}
|
277
systemd-rpm-macros.changes
Normal file
277
systemd-rpm-macros.changes
Normal file
|
@ -0,0 +1,277 @@
|
|||
* Fri Sep 29 2023 fbui@suse.com
|
||||
- Bump version to 14
|
||||
* Fri Sep 29 2023 fbui@suse.com
|
||||
- Switch to `systemd-hwdb` tool when updating the HW database. It's been
|
||||
introduced in systemd v219 and replaces the deprecated command `udevadm hwdb`.
|
||||
* Wed May 10 2023 fbui@suse.com
|
||||
- Bump version to 13
|
||||
* Wed May 10 2023 fbui@suse.com
|
||||
- Fix %%sysctl_apply() and %%binfmt_apply() so they are disabled when called from
|
||||
a chroot (bsc#1211272)
|
||||
* Thu Feb 16 2023 fbui@suse.com
|
||||
- Bump version to 12
|
||||
* Thu Feb 16 2023 fbui@suse.com
|
||||
- Don't emit a warning when the flag file in /var/lib/systemd/migrated/ is not
|
||||
present as it's expected (bsc#1208079).
|
||||
* Thu Mar 3 2022 fbui@suse.com
|
||||
- Bump version to 11
|
||||
* Thu Mar 3 2022 fbui@suse.com
|
||||
- Make %%_modprobedir point to /lib/modprobe.d (bsc#1196275 bsc#1196406)
|
||||
Until SLE15-SP3:QU2, /usr/lib/modprobe.d path was not supported by kmod and
|
||||
since SLE15-SP4 /etc/modprobe.d/README has references to /lib/modprobe.d...
|
||||
* Wed Jan 19 2022 fbui@suse.com
|
||||
- Bump version to 10
|
||||
* Wed Jan 19 2022 fbui@suse.com
|
||||
- %%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 2021 fbui@suse.com
|
||||
- Bump version to 9
|
||||
* Wed Nov 17 2021 fbui@suse.com
|
||||
- Introduce %%_systemd_util_dir
|
||||
It's a backport of upstream commit 3bc66bfa0136e370a8f7b06c3b69a52f5636ef82.
|
||||
* Fri Jul 16 2021 fbui@suse.com
|
||||
- Bump to version 8
|
||||
* Fri Jul 16 2021 fbui@suse.com
|
||||
- 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).
|
||||
* Fri Jul 16 2021 fbui@suse.com
|
||||
- Introduce %%sysusers_create_package
|
||||
%%sysusers_create and %%sysusers_create_inline are now deprecated and
|
||||
the new macro should be used instead.
|
||||
Upstream commit 07a7d4a0040d221ff09e527e91c112b4ffab1dba.
|
||||
* Tue May 25 2021 fbui@suse.com
|
||||
- %%sysusers_create_inline: use here-docs instead of echo (bsc#1186282)
|
||||
Upstream commit dd2490ae12ad1e1795ecbf8f8944b950da9c8d06.
|
||||
* Fri Mar 5 2021 fbui@suse.com
|
||||
- Bump to version 7
|
||||
* Fri Mar 5 2021 fbui@suse.com
|
||||
- Remove confusing --user before --global in %%systemd_user_preun
|
||||
It's actually a backport of upstream commit
|
||||
28d36da64a7a23a55e8d0a139f2620384fd058b3
|
||||
- Update a few comments
|
||||
* Fri Mar 5 2021 fbui@suse.com
|
||||
- Don't pass -f to rm to make sure that rm failures will be logged
|
||||
But also make sure to not abort the scriptlet prematurely if rm
|
||||
fails.
|
||||
* Fri Mar 5 2021 alarrosa@suse.com
|
||||
- Add a %%systemd_user_pre macro (boo#1183051, boo#1183012)
|
||||
It 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 (even when it's introduced via a package update).
|
||||
* Fri Mar 5 2021 alarrosa@suse.com
|
||||
- Fix %%systemd_user_post (boo#1183051, boo#1182661)
|
||||
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.
|
||||
* Fri Mar 5 2021 fbui@suse.com
|
||||
- Tabify %%service_del_postun_without_restart
|
||||
To make it consistent with the other macros.
|
||||
No functional change.
|
||||
* Fri Feb 12 2021 fbui@suse.com
|
||||
- Bump to version 6
|
||||
* Fri Feb 12 2021 fbui@suse.com
|
||||
- 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 2021 fbui@suse.com
|
||||
- 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.
|
||||
* Tue Nov 24 2020 fbui@suse.com
|
||||
- Bump to version 5 (bsc#1179020)
|
||||
This milestone makes systemd rpm macros mostly identical between
|
||||
SLE12-SP2 and SLE15.
|
||||
* Tue Nov 24 2020 fbui@suse.com
|
||||
- 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.
|
||||
* Fri Nov 13 2020 fbui@suse.com
|
||||
- Bump version to 4.2
|
||||
* Fri Nov 13 2020 fbui@suse.com
|
||||
- Deprecate '-f'/'-n' options
|
||||
When used with %%service_del_preun, support for these options will be
|
||||
dropped as DISABLE_STOP_ON_REMOVAL support will be removed on the
|
||||
next version of SLE (jsc#SLE-8968)
|
||||
When used with %%service_del_postun, they should be replaced with
|
||||
their counterpart
|
||||
%%service_del_postun_with_restart/%%service_del_postun_without_restart
|
||||
* Fri Nov 13 2020 fbui@suse.com
|
||||
- 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().
|
||||
* Fri Nov 13 2020 fbui@suse.com
|
||||
- Dont apply presets when migrating from a disabled initscript (bsc#1178481)
|
||||
* Fri Nov 13 2020 fbui@suse.com
|
||||
- Test for the presence of systemctl only once in %%service_add_{post,pre}
|
||||
No functional changes.
|
||||
* Fri Nov 13 2020 fbui@suse.com
|
||||
- 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.
|
||||
* Fri Sep 25 2020 fbui@suse.com
|
||||
- Bump version to 4.1
|
||||
* Fri Sep 25 2020 fbui@suse.com
|
||||
- Backport missing macros of directory paths from upstream
|
||||
+ %%_environmentdir
|
||||
+ %%_modulesloaddir
|
||||
+ %%_modprobedir
|
||||
* Fri Sep 25 2020 fbui@suse.com
|
||||
- Make sure %%_restart_on_update_never and %%_stop_on_removal_never
|
||||
don't expand to the empty string (bsc#1176932)
|
||||
Otherwise sequences like the following code:
|
||||
if [ ... ]; then
|
||||
%%_restart_on_update_never
|
||||
fi
|
||||
would result in the following incorrect shell syntax:
|
||||
if [ ... ]; then
|
||||
fi
|
||||
* Fri Sep 11 2020 fbui@suse.com
|
||||
- Introduce %%service_del_postun_without_restart (bsc#1173034)
|
||||
This new interface is preferred over the use of %%service_del_postun
|
||||
with '-f' and '-n' options. It's been in Factory since a year and a
|
||||
half.
|
||||
* Wed Feb 14 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 2018 fbui@suse.com
|
||||
- Import more definitions from upstream (v237)
|
||||
* Mon Jan 22 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 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 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 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 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 2017 fbui@suse.com
|
||||
- Restore previous changes
|
||||
* Fri Nov 17 2017 fbui@suse.com
|
||||
- Revert previous changes
|
||||
Also added reasons why the previous changes would be needed.
|
||||
* Fri Nov 17 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 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 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 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 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 2017 jengelh@inai.de
|
||||
- RPM group fix
|
||||
* Fri Jun 3 2016 Thomas.Blume@suse.com
|
||||
- %%service_add_post() suppress daemon-reload when in installation
|
||||
system (bsc#982343)
|
||||
* Thu Mar 3 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 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 2015 werner@suse.de
|
||||
- Support of DISABLE_STOP_ON_REMOVAL and DISABLE_RESTART_ON_UPDATE
|
||||
from /etc/sysconfig/service (bsc#955996)
|
||||
* Fri Sep 18 2015 sbrabec@suse.com
|
||||
- Skip %%systemd_preset_* during the clean installation to prevent
|
||||
presetting of all services (boo#946216).
|
||||
* Tue Aug 4 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 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 2015 jengelh@inai.de
|
||||
- Update with new macros from systemd 218
|
||||
- Remove empty sections from specfile
|
||||
* Tue Nov 18 2014 werner@suse.de
|
||||
- Mark /etc/rpm/macros.systemd as configuration file
|
||||
* Tue Nov 18 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 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 2014 werner@suse.de
|
||||
- Add a %%_ntpunitsdir macro
|
||||
* Thu Mar 27 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 2014 werner@suse.de
|
||||
- Require coreutils as rm and touch are used
|
||||
* Fri Feb 7 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 2013 fcrozat@suse.com
|
||||
- Resync with systemd v205 macros
|
||||
* Mon Jun 17 2013 mhrusecky@suse.com
|
||||
- New package with systemd rpm macros to avoid unnecessary build time
|
||||
dependencies
|
42
systemd-rpm-macros.spec
Normal file
42
systemd-rpm-macros.spec
Normal file
|
@ -0,0 +1,42 @@
|
|||
#
|
||||
# spec file for package systemd-rpm-macros
|
||||
#
|
||||
# Copyright (c) 2022-2023 ZhuningOS
|
||||
#
|
||||
|
||||
|
||||
Name: systemd-rpm-macros
|
||||
Version: 14
|
||||
Release: 150000.7.36.1
|
||||
Summary: RPM macros for systemd
|
||||
License: LGPL-2.1+
|
||||
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
|
Loading…
Add table
Reference in a new issue