Files
systemd/src/core/systemd.pc.in
T
Arian van Putten b0c11b5a0f systemd.pc: Keep support for rootprefix and root_prefix (#30115)
* systemd.pc: Keep support for rootprefix and root_prefix

We dropped support for split-usr in https://github.com/systemd/systemd/commit/b0d3095fd6cc1791a38f57a1982116b4475244ba
but kept the `rootprefix` variable in meson but ignore it to make sure we do
not break downstream builds that depend on systemd.

This is fine because we had logic in our meson.build that rootprefix and prefix need to be the
same when split-usr=false.

However we never had this logic in our systemd.pc.in file. This leads to a nasty breaking problem
downstream. Many packages [0,1,2]  (there might be more!) rely on overriding rootprefix or root_prefix when calling pkg-config to configure where
to install systemd units. This is because before split-usr we installed units in rootprefix. Setting prefix
on the pkg-config file didn't work. Even when split-usr=false people had to set rootprefix to install units
in the right position.

E.g. they have a line like:

    systemdunitdir = systemd.get_variable(pkgconfig: 'systemdsystemunitdir', pkgconfig_define: ['rootprefix', systemd_root_prefix])

With https://github.com/systemd/systemd/commit/b0d3095fd6cc1791a38f57a1982116b4475244ba landing
This would mean all these downstream packages need to be patched to use `prefix` next to `rootprefix`.
(Both need to be kept to keep backwards compat with using older versions of systemd).

This puts a big burden on downstream packages.
Instead we should not break the existing behaviour and keep the old behaviour of systemd.pc.in around.
I've changed systemd.pc.in such that either setting prefix, rootprefix or root_prefix will all have
the same effect. This way we do not break any downstream packages.

- [0](https://github.com/fwupd/fwupd/blob/caa788b37ff34334d83debb047335fd12f3a7836/meson.build#L464)
- [1](https://gitlab.freedesktop.org/mobile-broadband/ModemManager/-/blame/main/meson.build#L204)
- [2](https://github.com/PipeWire/pipewire/blob/49cdb468c28ba366dbd08eef9cb6dbf2dea2a2e5/src/daemon/systemd/system/meson.build#L1)
2023-11-21 12:51:08 +00:00

109 lines
4.0 KiB
Plaintext

# SPDX-License-Identifier: LGPL-2.1-or-later
#
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# Names with prefixes are preferred, and the run-together names should be
# considered deprecated (though there is no plan to remove them). New names
# shall have underscores.
# root_prefix and rootprefix are deprecated since we dropped support for split-usr
# however we used to install units in root_prefix and a lot of downstream software
# overrode this variable in their build system to support installing units elsewhere.
# To stop those builds from silently breaking we keep root_prefix around but have
# it as an alias for prefix
root_prefix={{PREFIX_NOSLASH}}
rootprefix=${root_prefix}
prefix=${rootprefix}
sysconf_dir={{SYSCONF_DIR}}
sysconfdir=${sysconf_dir}
systemd_util_dir=${prefix}/lib/systemd
systemdutildir=${systemd_util_dir}
systemd_system_unit_dir=${prefix}/lib/systemd/system
systemdsystemunitdir=${systemd_system_unit_dir}
systemd_system_preset_dir=${prefix}/lib/systemd/system-preset
systemdsystempresetdir=${systemd_system_preset_dir}
systemd_user_unit_dir=${prefix}/lib/systemd/user
systemduserunitdir=${systemd_user_unit_dir}
systemd_user_preset_dir=${prefix}/lib/systemd/user-preset
systemduserpresetdir=${systemd_user_preset_dir}
systemd_system_conf_dir=${sysconfdir}/systemd/system
systemdsystemconfdir=${systemd_system_conf_dir}
systemd_user_conf_dir=${sysconfdir}/systemd/user
systemduserconfdir=${systemd_user_conf_dir}
systemd_system_unit_path=${systemd_system_conf_dir}:/etc/systemd/system:/run/systemd/system:/usr/local/lib/systemd/system:${systemd_system_unit_dir}:/usr/lib/systemd/system:/lib/systemd/system
systemdsystemunitpath=${systemd_system_unit_path}
systemd_user_unit_path=${systemd_user_conf_dir}:/etc/systemd/user:/run/systemd/user:/usr/local/lib/systemd/user:/usr/local/share/systemd/user:${systemd_user_unit_dir}:/usr/lib/systemd/user:/usr/share/systemd/user
systemduserunitpath=${systemd_user_unit_path}
systemd_system_generator_dir=${prefix}/lib/systemd/system-generators
systemdsystemgeneratordir=${systemd_system_generator_dir}
systemd_user_generator_dir=${prefix}/lib/systemd/user-generators
systemdusergeneratordir=${systemd_user_generator_dir}
systemd_system_generator_path=/run/systemd/system-generators:/etc/systemd/system-generators:/usr/local/lib/systemd/system-generators:${systemd_system_generator_dir}
systemdsystemgeneratorpath=${systemd_system_generator_path}
systemd_user_generator_path=/run/systemd/user-generators:/etc/systemd/user-generators:/usr/local/lib/systemd/user-generators:${systemd_user_generator_dir}
systemdusergeneratorpath=${systemd_user_generator_path}
systemd_sleep_dir=${prefix}/lib/systemd/system-sleep
systemdsleepdir=${systemd_sleep_dir}
systemd_shutdown_dir=${prefix}/lib/systemd/system-shutdown
systemdshutdowndir=${systemd_shutdown_dir}
tmpfiles_dir=${prefix}/lib/tmpfiles.d
tmpfilesdir=${tmpfiles_dir}
user_tmpfiles_dir=${prefix}/share/user-tmpfiles.d
sysusers_dir=${prefix}/lib/sysusers.d
sysusersdir=${sysusers_dir}
sysctl_dir=${prefix}/lib/sysctl.d
sysctldir=${sysctl_dir}
binfmt_dir=${prefix}/lib/binfmt.d
binfmtdir=${binfmt_dir}
modules_load_dir=${prefix}/lib/modules-load.d
modulesloaddir=${modules_load_dir}
catalog_dir=${prefix}/lib/systemd/catalog
catalogdir=${catalog_dir}
system_uid_max={{SYSTEM_UID_MAX}}
systemuidmax=${system_uid_max}
system_gid_max={{SYSTEM_GID_MAX}}
systemgidmax=${system_gid_max}
dynamic_uid_min={{DYNAMIC_UID_MIN}}
dynamicuidmin=${dynamic_uid_min}
dynamic_uid_max={{DYNAMIC_UID_MAX}}
dynamicuidmax=${dynamic_uid_max}
container_uid_base_min={{CONTAINER_UID_BASE_MIN}}
containeruidbasemin=${container_uid_base_min}
container_uid_base_max={{CONTAINER_UID_BASE_MAX}}
containeruidbasemax=${container_uid_base_max}
Name: systemd
Description: systemd System and Service Manager
URL: {{PROJECT_URL}}
Version: {{PROJECT_VERSION}}