install: true,
install_dir: get_option('sbindir'))
+conf_data = configuration_data()
+conf_data.set('sbindir', get_option('prefix') + '/' + get_option('sbindir'))
+configure_file(input: 'update-plocate.sh',
+ output: 'update-plocate.sh',
+ configuration: conf_data)
+
install_data('update-plocate.sh',
install_dir: '/etc/cron.daily',
rename: 'plocate')
set -e
-/usr/local/sbin/plocate-build /var/lib/mlocate/mlocate.db /var/lib/mlocate/plocate.db.new
+SBINDIR=@sbindir@
+[ -d $SBINDIR ] || SBINDIR=/usr/local/sbin # Default if not processed by Meson.
+
+$SBINDIR/plocate-build /var/lib/mlocate/mlocate.db /var/lib/mlocate/plocate.db.new
chgrp mlocate /var/lib/mlocate/plocate.db.new
mv /var/lib/mlocate/plocate.db.new /var/lib/mlocate/plocate.db