+fs = import('fs')
+meson.add_install_script('mkdir.sh', fs.parent(dbfile))
+
+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')
+
+updatedb_man = configure_file(input: 'updatedb.8.in',
+ output: updatedb_progname + '.8',
+ configuration: conf_data)
+install_man(updatedb_man)
+
+updatedb_conf_man = configure_file(input: 'updatedb.conf.5.in',
+ output: 'updatedb.conf.5',
+ configuration: conf_data)
+install_man(updatedb_conf_man)
+
+if get_option('install_systemd')
+ unitdir = get_option('systemunitdir')
+ if unitdir == ''
+ systemd = dependency('systemd', required: false)
+ if systemd.found()
+ unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
+ endif
+ endif
+ if unitdir != ''
+ 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