1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-01 09:21:26 +03:00

meson: use jinja2 for various files in src/core/

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-05-16 17:52:42 +02:00 committed by Yu Watanabe
parent ba29ee4cc0
commit e11a25cadb
6 changed files with 31 additions and 33 deletions

View File

@ -21,7 +21,8 @@ libudev_version = '1.7.1'
# names, sometimes. Not all variables are included in every
# set. Ugh, ugh, ugh!
conf = configuration_data()
conf.set('PROJECT_VERSION', meson.project_version(),
conf.set_quoted('PROJECT_URL', 'https://www.freedesktop.org/wiki/Software/systemd')
conf.set('PROJECT_VERSION', meson.project_version(),
description : 'Numerical project version (used where a simple number is expected)')
substs = configuration_data()
@ -219,6 +220,7 @@ endif
memory_accounting_default = get_option('memory-accounting-default')
status_unit_format_default = get_option('status-unit-format-default')
conf.set_quoted('SYSCONF_DIR', sysconfdir)
conf.set_quoted('PKGSYSCONFDIR', pkgsysconfdir)
conf.set_quoted('SYSTEM_CONFIG_UNIT_DIR', join_paths(pkgsysconfdir, 'system'))
conf.set_quoted('SYSTEM_DATA_UNIT_DIR', systemunitdir)
@ -290,6 +292,7 @@ conf.set_quoted('SYSTEMD_USERWORK_PATH', join_paths(rootlib
conf.set10('MEMORY_ACCOUNTING_DEFAULT', memory_accounting_default)
conf.set_quoted('MEMORY_ACCOUNTING_DEFAULT_YES_NO', memory_accounting_default ? 'yes' : 'no')
conf.set('STATUS_UNIT_FORMAT_DEFAULT', 'STATUS_UNIT_FORMAT_' + status_unit_format_default.to_upper())
conf.set_quoted('STATUS_UNIT_FORMAT_DEFAULT_STR', status_unit_format_default)
substs.set('prefix', prefixdir)
substs.set('rootprefix', rootprefixdir)

View File

@ -174,21 +174,23 @@ core_includes = [includes, include_directories('.')]
systemd_sources = files('main.c')
in_files = [['system.conf', pkgsysconfdir],
['user.conf', pkgsysconfdir],
['systemd.pc', pkgconfigdatadir]]
in_files = [['system.conf', pkgsysconfdir],
['user.conf', pkgsysconfdir],
['systemd.pc', pkgconfigdatadir],
['org.freedesktop.systemd1.policy', polkitpolicydir]]
foreach item : in_files
file = item[0]
dir = item[1]
if install_sysconfdir_samples or dir != pkgsysconfdir
configure_file(
input : file + '.in',
output : file,
configuration : substs,
install_dir : dir == 'no' ? '' : dir)
endif
custom_target(
file,
input : file + '.in',
output: file,
command : [meson_render_jinja2, config_h, '@INPUT@'],
capture : true,
install : dir != 'no',
install_dir : dir)
endforeach
install_data('org.freedesktop.systemd1.conf',
@ -196,13 +198,6 @@ install_data('org.freedesktop.systemd1.conf',
install_data('org.freedesktop.systemd1.service',
install_dir : dbussystemservicedir)
policy = configure_file(
input : 'org.freedesktop.systemd1.policy.in',
output : 'org.freedesktop.systemd1.policy',
configuration : substs)
install_data(policy,
install_dir : polkitpolicydir)
meson.add_install_script('sh', '-c', mkdir_p.format(systemshutdowndir))
meson.add_install_script('sh', '-c', mkdir_p.format(systemsleepdir))
meson.add_install_script('sh', '-c', mkdir_p.format(systemgeneratordir))

View File

@ -26,7 +26,7 @@
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">@rootlibexecdir@/systemd-reply-password</annotate>
<annotate key="org.freedesktop.policykit.exec.path">{{ROOTLIBEXECDIR}}/systemd-reply-password</annotate>
</action>
<action id="org.freedesktop.systemd1.manage-units">

View File

@ -37,7 +37,7 @@
#NoNewPrivileges=no
#SystemCallArchitectures=
#TimerSlackNSec=
#StatusUnitFormat=@STATUS_UNIT_FORMAT_DEFAULT@
#StatusUnitFormat={{STATUS_UNIT_FORMAT_DEFAULT_STR}}
#DefaultTimerAccuracySec=1min
#DefaultStandardOutput=journal
#DefaultStandardError=inherit
@ -52,7 +52,7 @@
#DefaultIOAccounting=no
#DefaultIPAccounting=no
#DefaultBlockIOAccounting=no
#DefaultMemoryAccounting=@MEMORY_ACCOUNTING_DEFAULT@
#DefaultMemoryAccounting={{ 'yes' if MEMORY_ACCOUNTING_DEFAULT else 'no' }}
#DefaultTasksAccounting=yes
#DefaultTasksMax=15%
#DefaultLimitCPU=
@ -61,7 +61,7 @@
#DefaultLimitSTACK=
#DefaultLimitCORE=
#DefaultLimitRSS=
#DefaultLimitNOFILE=1024:@HIGH_RLIMIT_NOFILE@
#DefaultLimitNOFILE=1024:{{HIGH_RLIMIT_NOFILE}}
#DefaultLimitAS=
#DefaultLimitNPROC=
#DefaultLimitMEMLOCK=

View File

@ -12,9 +12,9 @@
# shall have underscores.
prefix=/usr
root_prefix=@rootprefix_noslash@
root_prefix={{ROOTPREFIX_NOSLASH}}
rootprefix=${root_prefix}
sysconf_dir=@sysconfdir@
sysconf_dir={{SYSCONF_DIR}}
sysconfdir=${sysconf_dir}
systemd_util_dir=${root_prefix}/lib/systemd
@ -80,22 +80,22 @@ modulesloaddir=${modules_load_dir}
catalog_dir=${prefix}/lib/systemd/catalog
catalogdir=${catalog_dir}
system_uid_max=@SYSTEM_UID_MAX@
system_uid_max={{SYSTEM_UID_MAX}}
systemuidmax=${system_uid_max}
system_gid_max=@SYSTEM_GID_MAX@
system_gid_max={{SYSTEM_GID_MAX}}
systemgidmax=${system_gid_max}
dynamic_uid_min=@dynamicuidmin@
dynamic_uid_min={{DYNAMIC_UID_MIN}}
dynamicuidmin=${dynamic_uid_min}
dynamic_uid_max=@dynamicuidmax@
dynamic_uid_max={{DYNAMIC_UID_MAX}}
dynamicuidmax=${dynamic_uid_max}
container_uid_base_min=@containeruidbasemin@
container_uid_base_min={{CONTAINER_UID_BASE_MIN}}
containeruidbasemin=${container_uid_base_min}
container_uid_base_max=@containeruidbasemax@
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@
URL: {{PROJECT_URL}}
Version: {{PROJECT_VERSION}}

View File

@ -20,7 +20,7 @@
#LogTime=no
#SystemCallArchitectures=
#TimerSlackNSec=
#StatusUnitFormat=@STATUS_UNIT_FORMAT_DEFAULT@
#StatusUnitFormat={{STATUS_UNIT_FORMAT_DEFAULT_STR}}
#DefaultTimerAccuracySec=1min
#DefaultStandardOutput=inherit
#DefaultStandardError=inherit