install_dir: get_option('sbindir'))
conf_data = configuration_data()
+conf_data.set('PROCESSED_BY_MESON', '1')
conf_data.set('sbindir', get_option('prefix') + '/' + get_option('sbindir'))
+conf_data.set('locategroup', get_option('locategroup'))
update_script = configure_file(input: 'update-plocate.sh',
output: 'update-plocate.sh',
configuration: conf_data)
-install_data(update_script,
- install_dir: '/etc/cron.daily',
- rename: 'plocate')
+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')
--- /dev/null
+option('install_cron', type: 'boolean', value: true, description: 'Install update script into /etc/cron.daily')
+option('locategroup', type: 'string', value: 'mlocate', description: 'Group that the install script will use for the .db file')
set -e
-SBINDIR=@sbindir@
-[ -d $SBINDIR ] || SBINDIR=/usr/local/sbin # Default if not processed by Meson.
+if [ @PROCESSED_BY_MESON@ = 1 ]; then
+ SBINDIR=@sbindir@
+ LOCATEGROUP=@locategroup@
+else
+ SBINDIR=/usr/local/sbin
+ LOCATEGROUP=mlocate
+fi
$SBINDIR/plocate-build /var/lib/mlocate/mlocate.db /var/lib/mlocate/plocate.db.new
-chgrp mlocate /var/lib/mlocate/plocate.db.new
+chgrp $LOCATEGROUP /var/lib/mlocate/plocate.db.new
mv /var/lib/mlocate/plocate.db.new /var/lib/mlocate/plocate.db