]> git.ipfire.org Git - thirdparty/systemd.git/commit
rpm macros: add %sysusers_create_package
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 31 Jan 2018 15:07:59 +0000 (16:07 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 2 Feb 2018 09:40:24 +0000 (10:40 +0100)
commit07a7d4a0040d221ff09e527e91c112b4ffab1dba
treead8ff6abe7001cd1c6e13a64221dd943f0cb8437
parent4e9fe38dc0d6f71f87bce5d4e1b384e0f178192b
rpm macros: add %sysusers_create_package

This is close to %sysusers_create_inline and %sysusers_create that we had
already, but expects a file name and uses --replace= to implement proper
priority.

This is used like:
  %sysusers_create_package %{name} %SOURCE1
where %SOURCE1 is a file with called %{name}.conf that will be installed
into /usr/lib/sysusers.d/.

The tough part is that the file needs to be available before %prep,
i.e. outside of the source tarball. This is because the spec file is
parsed (and any macros expanded), before the sources are unpackaged.

v2:
- disallow the case case when --config-name= is given but there are no
  positional args. Most likely this would be a user error, so at least for now
  forbid it.
v3:
- replace --config-name= with --target=
- drop quotes around %1 and %2 — if necessary, the caller should add
  those.
v4:
- replace --target with --replace
- add a big comment
src/core/macros.systemd.in