meson.build 2.16 KB
Newer Older
Zeeshan Ali's avatar
Zeeshan Ali committed
1 2 3
if get_option('enable-backend')
    conf = configuration_data()

4
    if get_option('demo-agent')
Zeeshan Ali's avatar
Zeeshan Ali committed
5 6 7 8 9
        conf.set('demo_agent', 'geoclue-demo-agent;')
    else
        conf.set('demo_agent', '')
    endif

10
    conf_dir = join_paths(sysconfdir, 'geoclue')
Zeeshan Ali's avatar
Zeeshan Ali committed
11 12 13 14 15 16
    configure_file(output: 'geoclue.conf',
                   input: 'geoclue.conf.in',
                   configuration: conf,
                   install_dir: conf_dir)

    conf = configuration_data()
17
    conf.set('libexecdir', libexecdir)
Zeeshan Ali's avatar
Zeeshan Ali committed
18
    conf.set('dbus_srv_user', get_option('dbus-srv-user'))
19
    conf.set('sysconfdir', sysconfdir)
Zeeshan Ali's avatar
Zeeshan Ali committed
20

21
    service_dir = join_paths(datadir, 'dbus-1', 'system-services')
Zeeshan Ali's avatar
Zeeshan Ali committed
22 23 24 25 26
    configure_file(output: 'org.freedesktop.GeoClue2.service',
                   input: 'org.freedesktop.GeoClue2.service.in',
                   configuration: conf,
                   install_dir: service_dir)

27 28 29 30 31 32
    man_file = configure_file(output: 'geoclue.5',
                              input: 'geoclue.5.in',
                              configuration: conf)

    install_man(man_file)

Zeeshan Ali's avatar
Zeeshan Ali committed
33 34
    # DBus Service policy file
    dbus_service_dir = get_option('dbus-sys-dir')
35
    if dbus_service_dir == ''
36
        dbus_service_dir = join_paths(sysconfdir, 'dbus-1', 'system.d')
Zeeshan Ali's avatar
Zeeshan Ali committed
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
    endif
    configure_file(output: 'org.freedesktop.GeoClue2.conf',
                   input: 'org.freedesktop.GeoClue2.conf.in',
                   configuration: conf,
                   install_dir: dbus_service_dir)
    configure_file(output: 'org.freedesktop.GeoClue2.Agent.conf',
                   input: 'org.freedesktop.GeoClue2.Agent.conf.in',
                   configuration: conf,
                   install_dir: dbus_service_dir)

    systemd_unit_dir = get_option('systemd-system-unit-dir')
    if systemd_unit_dir == ''
        dep = dependency('systemd', required: false)
        if dep.found()
            systemd_unit_dir = dep.get_pkgconfig_variable('systemdsystemunitdir')
        endif
    endif

    if systemd_unit_dir != ''
        configure_file(output: 'geoclue.service',
                       input: 'geoclue.service.in',
                       configuration: conf,
                       install_dir: systemd_unit_dir)
    endif
endif