Timedate Daemon

Timedate daemon to control org.freedesktop.timedate1 D-Bus interface

18 Commits   0 Branches   3 Tags
938dce1e (kx 2023-12-21 21:15:15 +0300  1) project('timedated', 'c',
1110f594 (kx 2023-12-23 14:15:55 +0300  2)     version: '1.0.2',
938dce1e (kx 2023-12-21 21:15:15 +0300  3)     license: 'GPLv2+',
938dce1e (kx 2023-12-21 21:15:15 +0300  4)     default_options: [
938dce1e (kx 2023-12-21 21:15:15 +0300  5)         'buildtype=debugoptimized',
938dce1e (kx 2023-12-21 21:15:15 +0300  6)         'warning_level=1',
938dce1e (kx 2023-12-21 21:15:15 +0300  7)         'c_std=gnu99',
938dce1e (kx 2023-12-21 21:15:15 +0300  8)     ],
938dce1e (kx 2023-12-21 21:15:15 +0300  9)     meson_version: '>= 0.56.0')
938dce1e (kx 2023-12-21 21:15:15 +0300 10) 
938dce1e (kx 2023-12-21 21:15:15 +0300 11) soversion = 3
938dce1e (kx 2023-12-21 21:15:15 +0300 12) current = 1
938dce1e (kx 2023-12-21 21:15:15 +0300 13) revision = 0
938dce1e (kx 2023-12-21 21:15:15 +0300 14) libversion = '@0@.@1@.@2@'.format(soversion, current, revision)
938dce1e (kx 2023-12-21 21:15:15 +0300 15) 
938dce1e (kx 2023-12-21 21:15:15 +0300 16) gnome = import('gnome')
938dce1e (kx 2023-12-21 21:15:15 +0300 17) i18n = import('i18n')
938dce1e (kx 2023-12-21 21:15:15 +0300 18) 
938dce1e (kx 2023-12-21 21:15:15 +0300 19) cc = meson.get_compiler('c')
938dce1e (kx 2023-12-21 21:15:15 +0300 20) 
938dce1e (kx 2023-12-21 21:15:15 +0300 21) # directories
938dce1e (kx 2023-12-21 21:15:15 +0300 22) prefix = get_option('prefix')
938dce1e (kx 2023-12-21 21:15:15 +0300 23) bindir = get_option('bindir')
938dce1e (kx 2023-12-21 21:15:15 +0300 24) datadir = get_option('datadir')
938dce1e (kx 2023-12-21 21:15:15 +0300 25) libexecdir = get_option('libexecdir')
938dce1e (kx 2023-12-21 21:15:15 +0300 26) 
938dce1e (kx 2023-12-21 21:15:15 +0300 27) # TODO: Get rid of these by including config.h where needed
938dce1e (kx 2023-12-21 21:15:15 +0300 28) add_project_arguments([
938dce1e (kx 2023-12-21 21:15:15 +0300 29)     '-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()),
938dce1e (kx 2023-12-21 21:15:15 +0300 30)     '-DPACKAGE_VERSION="@0@"'.format(meson.project_version()),
938dce1e (kx 2023-12-21 21:15:15 +0300 31) ], language: 'c')
938dce1e (kx 2023-12-21 21:15:15 +0300 32) 
938dce1e (kx 2023-12-21 21:15:15 +0300 33) cdata = configuration_data()
938dce1e (kx 2023-12-21 21:15:15 +0300 34) cdata.set_quoted('GETTEXT_PACKAGE', meson.project_name())
938dce1e (kx 2023-12-21 21:15:15 +0300 35) cdata.set_quoted('PACKAGE_VERSION', meson.project_version())
938dce1e (kx 2023-12-21 21:15:15 +0300 36) cdata.set_quoted('VERSION', meson.project_version())
938dce1e (kx 2023-12-21 21:15:15 +0300 37) cdata.set_quoted('PACKAGE_SYSCONF_DIR', get_option('sysconfdir'))
938dce1e (kx 2023-12-21 21:15:15 +0300 38) cdata.set_quoted('HWCLOCK_CONF', get_option('hwclock_conf'))
938dce1e (kx 2023-12-21 21:15:15 +0300 39) cdata.set_quoted('ADJTIME_CONF', get_option('adjtime_conf'))
938dce1e (kx 2023-12-21 21:15:15 +0300 40) cdata.set_quoted('NTPD_CONF', get_option('ntpd_conf'))
938dce1e (kx 2023-12-21 21:15:15 +0300 41) cdata.set_quoted('NTPD_RC', get_option('ntpd_rc'))
938dce1e (kx 2023-12-21 21:15:15 +0300 42) 
57dc33aa (kx 2023-12-22 00:54:25 +0300 43) glib_min_version    = '2.76'
938dce1e (kx 2023-12-21 21:15:15 +0300 44) polkit_min_version  = '123'
938dce1e (kx 2023-12-21 21:15:15 +0300 45) pcre_min_version    = '10.36'
938dce1e (kx 2023-12-21 21:15:15 +0300 46) 
938dce1e (kx 2023-12-21 21:15:15 +0300 47) glib_version_def = 'GLIB_VERSION_@0@_@1@'.format(
938dce1e (kx 2023-12-21 21:15:15 +0300 48)     glib_min_version.split('.')[0], glib_min_version.split('.')[1])
938dce1e (kx 2023-12-21 21:15:15 +0300 49) common_cflags = cc.get_supported_arguments([
938dce1e (kx 2023-12-21 21:15:15 +0300 50)     '-DGLIB_VERSION_MIN_REQUIRED=' + glib_version_def,
938dce1e (kx 2023-12-21 21:15:15 +0300 51)     '-DGLIB_VERSION_MAX_ALLOWED=' + glib_version_def,
938dce1e (kx 2023-12-21 21:15:15 +0300 52) ])
938dce1e (kx 2023-12-21 21:15:15 +0300 53) add_project_arguments(common_cflags, language: 'c')
938dce1e (kx 2023-12-21 21:15:15 +0300 54) 
938dce1e (kx 2023-12-21 21:15:15 +0300 55) 
938dce1e (kx 2023-12-21 21:15:15 +0300 56) glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
938dce1e (kx 2023-12-21 21:15:15 +0300 57) gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version)
938dce1e (kx 2023-12-21 21:15:15 +0300 58) gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version)
938dce1e (kx 2023-12-21 21:15:15 +0300 59) gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version)
938dce1e (kx 2023-12-21 21:15:15 +0300 60) pcre_dep = dependency('libpcre2-8', version: '>=' + pcre_min_version)
938dce1e (kx 2023-12-21 21:15:15 +0300 61) polkit_dep = dependency('polkit-gobject-1', version: '>=' + polkit_min_version)
938dce1e (kx 2023-12-21 21:15:15 +0300 62) m_dep = cc.find_library('m', required: true)
938dce1e (kx 2023-12-21 21:15:15 +0300 63) 
938dce1e (kx 2023-12-21 21:15:15 +0300 64) dbusdir = join_paths(datadir, 'dbus-1')
938dce1e (kx 2023-12-21 21:15:15 +0300 65) polkitactionsdir = join_paths(datadir, 'polkit-1', 'actions')
938dce1e (kx 2023-12-21 21:15:15 +0300 66) polkitrulesdir = join_paths(datadir, 'polkit-1', 'rules.d')
938dce1e (kx 2023-12-21 21:15:15 +0300 67) 
938dce1e (kx 2023-12-21 21:15:15 +0300 68) # Generate configuration file
938dce1e (kx 2023-12-21 21:15:15 +0300 69) config_h = configure_file(output: 'config.h', configuration: cdata)
938dce1e (kx 2023-12-21 21:15:15 +0300 70) 
938dce1e (kx 2023-12-21 21:15:15 +0300 71) subdir('po')
938dce1e (kx 2023-12-21 21:15:15 +0300 72) subdir('dbus')
938dce1e (kx 2023-12-21 21:15:15 +0300 73) subdir('src')
938dce1e (kx 2023-12-21 21:15:15 +0300 74) 
938dce1e (kx 2023-12-21 21:15:15 +0300 75) output = []
938dce1e (kx 2023-12-21 21:15:15 +0300 76) output += 'timedated ' + meson.project_version()
938dce1e (kx 2023-12-21 21:15:15 +0300 77) output += 'System Paths'
938dce1e (kx 2023-12-21 21:15:15 +0300 78) output += '  prefix:         ' + get_option('prefix')
938dce1e (kx 2023-12-21 21:15:15 +0300 79) output += '  libdir:         ' + get_option('libdir')
938dce1e (kx 2023-12-21 21:15:15 +0300 80) output += '  libexecdir:     ' + get_option('prefix') / get_option('libexecdir')
938dce1e (kx 2023-12-21 21:15:15 +0300 81) output += '  bindir:         ' + get_option('prefix') / get_option('bindir')
938dce1e (kx 2023-12-21 21:15:15 +0300 82) output += '  sbindir:        ' + get_option('prefix') / get_option('sbindir')
938dce1e (kx 2023-12-21 21:15:15 +0300 83) output += '  datadir:        ' + get_option('prefix') / get_option('datadir')
938dce1e (kx 2023-12-21 21:15:15 +0300 84) output += '  sysconfdir:     ' + get_option('sysconfdir')
938dce1e (kx 2023-12-21 21:15:15 +0300 85) output += '  localstatedir:  ' + get_option('prefix') / get_option('localstatedir')
938dce1e (kx 2023-12-21 21:15:15 +0300 86) 
938dce1e (kx 2023-12-21 21:15:15 +0300 87) output += '\nFeatures'
938dce1e (kx 2023-12-21 21:15:15 +0300 88) output += '  Priviledged group:      ' + get_option('privileged-group')
938dce1e (kx 2023-12-21 21:15:15 +0300 89) output += '  Hardware clock config:  ' + get_option('hwclock_conf')
938dce1e (kx 2023-12-21 21:15:15 +0300 90) output += '  Adjtime config:         ' + get_option('adjtime_conf')
938dce1e (kx 2023-12-21 21:15:15 +0300 91) output += '  NTP  daemon config:     ' + get_option('ntpd_conf')
938dce1e (kx 2023-12-21 21:15:15 +0300 92) output += '  NTPd start/stop script: ' + get_option('ntpd_rc')
938dce1e (kx 2023-12-21 21:15:15 +0300 93) 
938dce1e (kx 2023-12-21 21:15:15 +0300 94) message('\n'+'\n'.join(output)+'\n')