112 Commits

Author SHA256 Message Date
Dominique Leuenberger
af577426eb Accepting request 947356 from Base:System
- Bump to version 15

- %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

OBS-URL: https://build.opensuse.org/request/show/947356
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=39
2022-01-22 07:17:46 +00:00
Franck Bui
ccdcf965ab - Bump to version 15
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=75
2022-01-19 08:27:38 +00:00
Franck Bui
ccdbdfce8d - %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

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=74
2022-01-18 21:06:57 +00:00
Dominique Leuenberger
c89bed18ac Accepting request 931955 from Base:System
- Bump version to 14

- Introduce %_systemd_util_dir
  It's a backport of upstream commit 3bc66bfa0136e370a8f7b06c3b69a52f5636ef82.

OBS-URL: https://build.opensuse.org/request/show/931955
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=38
2021-11-21 22:51:15 +00:00
Franck Bui
6f9fe0af97 - Bump version to 14
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=73
2021-11-17 12:31:01 +00:00
Franck Bui
bbea6a0733 - Introduce %_systemd_util_dir
It's a backport of upstream commit 3bc66bfa0136e370a8f7b06c3b69a52f5636ef82.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=72
2021-11-17 12:27:43 +00:00
Dominique Leuenberger
e39be33398 Accepting request 922188 from Base:System
OBS-URL: https://build.opensuse.org/request/show/922188
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=37
2021-10-25 13:16:41 +00:00
Franck Bui
818d21e58d Accepting request 922165 from home:dimstar:Factory
- Use %{load:} instead of %{?load:}: fix build with RPM 4.17.

OBS-URL: https://build.opensuse.org/request/show/922165
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=71
2021-09-29 13:21:24 +00:00
Dominique Leuenberger
efa0f81b4c Accepting request 903200 from Base:System
- Bump to version 13

- 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).

OBS-URL: https://build.opensuse.org/request/show/903200
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=36
2021-07-03 18:50:32 +00:00
Franck Bui
4a8a20b75d - Bump to version 13
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=70
2021-06-30 09:59:52 +00:00
Franck Bui
ad43e5ad9f - 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).

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=69
2021-06-30 09:59:17 +00:00
Dominique Leuenberger
a42dcffc95 Accepting request 894598 from Base:System
- Bump to version 12

- 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.

- %sysusers_create_inline: use here-docs instead of echo (bsc#1186282)
  Upstream commit dd2490ae12ad1e1795ecbf8f8944b950da9c8d06.

OBS-URL: https://build.opensuse.org/request/show/894598
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=35
2021-05-23 21:30:19 +00:00
Franck Bui
bbc4a5b794 - Bump to version 12
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=68
2021-05-20 10:18:45 +00:00
Franck Bui
37d00203df - 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.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=67
2021-05-20 10:17:34 +00:00
Franck Bui
f0c8ea9afc - %sysusers_create_inline: use here-docs instead of echo (bsc#1186282)
Upstream commit dd2490ae12ad1e1795ecbf8f8944b950da9c8d06.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=66
2021-05-20 09:47:35 +00:00
Dominique Leuenberger
35bb9dbe84 Accepting request 877267 from Base:System
- Bump to version 11

- Don't pass -f to rm in %service_add_post nor %systemd_user_post

- 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).

- 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).

OBS-URL: https://build.opensuse.org/request/show/877267
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=34
2021-03-11 19:06:48 +00:00
Franck Bui
6fc47e8204 - Bump to version 11
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=65
2021-03-05 15:09:00 +00:00
Franck Bui
4463ee13e3 Accepting request 876976 from home:alarrosa:branches:Base:System
- Don't pass -f to rm in %service_add_post nor %systemd_user_post

OBS-URL: https://build.opensuse.org/request/show/876976
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=64
2021-03-05 11:19:59 +00:00
Franck Bui
a079230c8d Accepting request 876971 from home:alarrosa:branches:Base:System
- 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).

OBS-URL: https://build.opensuse.org/request/show/876971
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=63
2021-03-05 11:09:08 +00:00
Franck Bui
9f0979dfb3 Accepting request 876963 from home:alarrosa:branches:Base:System
- 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).

OBS-URL: https://build.opensuse.org/request/show/876963
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=62
2021-03-05 10:58:52 +00:00
Dominique Leuenberger
7dc94d55a2 Accepting request 871420 from Base:System
- Bump version to 10

- 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.

- 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.

OBS-URL: https://build.opensuse.org/request/show/871420
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=33
2021-02-17 17:09:42 +00:00
Franck Bui
b9ed9090dc - Bump version to 10
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=61
2021-02-12 11:46:53 +00:00
Franck Bui
a4d73fe809 - 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.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=60
2021-02-12 11:45:54 +00:00
Franck Bui
988d319a8f - 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.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=59
2021-02-12 11:01:43 +00:00
Dominique Leuenberger
9a8aa1a4fc Accepting request 850414 from Base:System
- Bump version to 9

- 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`.

- 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.

- %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.

OBS-URL: https://build.opensuse.org/request/show/850414
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=32
2020-11-29 11:18:35 +00:00
Franck Bui
e45618db9a update comment in changelogs to reflect that systemctl preset does a daemon-reload
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=58
2020-11-24 11:02:18 +00:00
Franck Bui
e531b48b7a - Bump version to 9
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=57
2020-11-23 20:33:49 +00:00
Franck Bui
f90fb4cf4f - 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 but
  it's done only once by %service_del_postun.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=56
2020-11-23 20:19:37 +00:00
Franck Bui
f65be0ea90 - 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.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=55
2020-11-23 18:03:40 +00:00
Franck Bui
991b3b62db - %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.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=54
2020-11-23 17:29:55 +00:00
Dominique Leuenberger
b24f8bd8f8 Accepting request 847458 from Base:System
- Bump version to 8

- 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

- Add a missing space in %_restart_on_update()

- Bump version to 7

- Dont apply presets when migrating from a disabled initscript (bsc#1178481)

- Bump version to 6

- Test for the presence of systemd only once in %service_add_post

- 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.

- 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.

- 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

OBS-URL: https://build.opensuse.org/request/show/847458
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=31
2020-11-23 14:36:32 +00:00
Franck Bui
221719424c - Bump version to 8
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=53
2020-11-10 11:22:09 +00:00
Franck Bui
163b073fa1 - 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

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=52
2020-11-10 11:04:59 +00:00
Franck Bui
198ba4caa7 - Add a missing space in %_restart_on_update()
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=51
2020-11-10 09:13:24 +00:00
Franck Bui
e3e0721640 - Bump version to 7
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=50
2020-11-09 11:40:24 +00:00
Franck Bui
4097fa89ce - Dont apply presets when migrating from a disabled initscript (bsc#1178481)
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=49
2020-11-09 11:38:05 +00:00
Franck Bui
179aa8a211 Fix typo
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=48
2020-11-09 09:26:07 +00:00
Franck Bui
aba6870f75 - Bump version to 6
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=47
2020-11-09 08:48:05 +00:00
Franck Bui
d3585cac9c Update one comment
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=46
2020-11-09 08:46:43 +00:00
Franck Bui
664f945153 - Test for the presence of systemd only once in %service_add_post
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=45
2020-11-09 08:43:46 +00:00
Franck Bui
b8ac3768b4 - 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.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=44
2020-11-09 07:45:47 +00:00
Franck Bui
fe75626308 - Make rpmbuild load our own macros.systemd to import %{%_unitdir} properly
Ideally we should also own other %{_*dir} paths...
- Bump version to 5

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=43
2020-11-09 07:15:43 +00:00
Franck Bui
6873a04f30 - 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.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=42
2020-11-02 14:40:43 +00:00
Franck Bui
4dd7db0039 document the previous change
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=41
2020-11-02 08:55:25 +00:00
Franck Bui
c6f0727a32 - Drop DISABLE_STOP_ON_REMOVAL support (jsc#SLE-8968)
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=40
2020-10-30 17:40:53 +00:00
Dominique Leuenberger
bb2e625770 Accepting request 839132 from Base:System
Automatic submission by obs-autosubmit

OBS-URL: https://build.opensuse.org/request/show/839132
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=30
2020-10-08 11:07:31 +00:00
Franck Bui
622c3bb210 - Bump version to 4.1
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=39
2020-09-25 09:26:01 +00:00
Dominique Leuenberger
d149e5b431 Accepting request 829086 from Base:System
OBS-URL: https://build.opensuse.org/request/show/829086
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=29
2020-08-31 15:14:46 +00:00
Franck Bui
d81d9c2469 Accepting request 829057 from home:Pharaoh_Atem:branches:Base:System
- Sync missing macros of directory paths from upstream systemd macros
  + %_environmentdir
  + %_modulesloaddir
  + %_modprobedir

OBS-URL: https://build.opensuse.org/request/show/829057
OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd-rpm-macros?expand=0&rev=38
2020-08-25 06:25:03 +00:00
Dominique Leuenberger
d1fdb9ed76 Accepting request 684199 from Base:System
OBS-URL: https://build.opensuse.org/request/show/684199
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/systemd-rpm-macros?expand=0&rev=28
2019-03-14 21:42:15 +00:00