add_project_arguments('-DGROUPNAME="' + get_option('locategroup') + '"', language: 'cpp')
add_project_arguments('-DUPDATEDB_CONF="/etc/updatedb.conf"', language: 'cpp')
-add_project_arguments('-DDBFILE="/var/lib/plocate/plocate.db"', language: 'cpp')
+dbfile = join_paths(get_option('sharedstatedir'), 'plocate', 'plocate.db')
+add_project_arguments('-DDBFILE="' + dbfile + '"', language: 'cpp')
add_project_arguments('-DPACKAGE_NAME="plocate"', language: 'cpp')
add_project_arguments('-DPACKAGE_VERSION="' + meson.project_version() + '"', language: 'cpp')
add_project_arguments('-DPACKAGE_BUGREPORT="steinar+plocate@gunderson.no"', language: 'cpp')
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)
if [ @PROCESSED_BY_MESON@ = 1 ]; then
SBINDIR=@sbindir@
LOCATEGROUP=@locategroup@
+ DBFILE=@dbfile@
else
SBINDIR=/usr/local/sbin
LOCATEGROUP=plocate
+ DBFILE=/var/lib/plocate/plocate.db
fi
-$SBINDIR/plocate-build /var/lib/mlocate/mlocate.db /var/lib/plocate/plocate.db.new
-chgrp $LOCATEGROUP /var/lib/plocate/plocate.db.new
-mv /var/lib/plocate/plocate.db.new /var/lib/plocate/plocate.db
+$SBINDIR/plocate-build /var/lib/mlocate/mlocate.db $DBFILE.new
+chgrp $LOCATEGROUP $DBFILE.new
+mv $DBFILE.new $DBFILE