+conf_data = configuration_data()
+conf_data.set('PROCESSED_BY_MESON', '1')
+conf_data.set('sbindir', join_paths(get_option('prefix'), get_option('sbindir')))
+conf_data.set('locategroup', get_option('locategroup'))
+conf_data.set('dbfile', dbfile)
+update_script = configure_file(input: 'update-plocate.sh',
+ output: 'update-plocate.sh',
+ configuration: conf_data)
+
+meson.add_install_script('mkdir', '-p', dbdir)
+
+if get_option('install_cron')
+ install_data(update_script,
+ install_dir: '/etc/cron.daily',
+ rename: 'plocate')
+endif
+install_man('plocate.1')
+install_man('plocate-build.8')
+
+if get_option('install_systemd')
+ systemd = dependency('systemd', required: false)
+ if systemd.found()
+ unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
+ updatedb_service = configure_file(input: 'plocate-updatedb.service.in',
+ output: 'plocate-updatedb.service',
+ configuration: conf_data)
+ install_data(updatedb_service, install_dir: unitdir)
+ install_data('plocate-updatedb.timer', install_dir: unitdir)
+ endif
+endif