build: un-hardcode prefix
/usr/share/pldm, /var/lib/pldm, and /etc are hardcoded in many places.
Workflows such as:
meson -Dprefix=$HOME/workspace -Dsysconfdir=$HOME/workspace builddir \
&& ninja -C buildir install
result in pldmd looking for its data in the wrong place. Fix by
properly incorporating the user specified prefix into filesystem paths.
A number of paths remain hardcoded because they (presumably?) are owned
and provided by other packages (phosphor-software-manager) and those
packages do not provide any pkg-config from which we can extract their
installation prefixes.
Change-Id: I140d7a65e85342fd108af41f33010b422a0f77a5
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/configurations/meson.build b/configurations/meson.build
index ccb9b62..5c6c605 100644
--- a/configurations/meson.build
+++ b/configurations/meson.build
@@ -1,27 +1,20 @@
-packagedir = join_paths(
- get_option('prefix'),
- get_option('datadir'),
- meson.project_name(),
-)
+install_subdir('pdr', install_dir: package_datadir)
+install_subdir('host', install_dir: package_datadir)
-install_subdir('pdr', install_dir: packagedir)
-
-install_subdir('host', install_dir: packagedir)
-
-install_subdir('events', install_dir: packagedir)
+install_subdir('events', install_dir: package_datadir)
if get_option('oem-ibm').disabled()
-install_data('fru_master.json', install_dir: packagedir)
+install_data('fru_master.json', install_dir: package_datadir)
endif
if get_option('oem-ibm').enabled()
- install_subdir('../oem/ibm/configurations/fru', install_dir: packagedir)
- install_subdir('../oem/ibm/configurations/events', install_dir: packagedir)
- install_subdir('../oem/ibm/configurations/bios', install_dir: packagedir)
- install_data('../oem/ibm/configurations/fru_master.json',install_dir: packagedir)
+ install_subdir('../oem/ibm/configurations/fru', install_dir: package_datadir)
+ install_subdir('../oem/ibm/configurations/events', install_dir: package_datadir)
+ install_subdir('../oem/ibm/configurations/bios', install_dir: package_datadir)
+ install_data('../oem/ibm/configurations/fru_master.json',install_dir: package_datadir)
install_data('../oem/ibm/configurations/fileTable.json',
- install_dir: packagedir)
- install_data('../oem/ibm/configurations/host_eid', install_dir: packagedir)
+ install_dir: package_datadir)
+ install_data('../oem/ibm/configurations/host_eid', install_dir: package_datadir)
endif