From 3b009b7dd2b29980ed3642dd2e3165edb5451a3c Mon Sep 17 00:00:00 2001 From: Omar Tarabai Date: Mon, 14 Apr 2014 13:54:29 +0000 Subject: [PATCH] fixed loading sensor definitions --- src/sensor/Makefile.am | 10 ++++++++++ src/sensor/gnunet-service-sensor.c | 8 +++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/sensor/Makefile.am b/src/sensor/Makefile.am index eeed7fc8f..1efad0ed6 100644 --- a/src/sensor/Makefile.am +++ b/src/sensor/Makefile.am @@ -57,3 +57,13 @@ test_sensor_api_SOURCES = \ test_sensor_api_LDADD = \ $(top_builddir)/src/util/libgnunetutil.la +pkgsensordir = sensors + +install-data-local: + $(mkinstalldirs) $(datadir)/$(PACKAGE)/$(pkgsensordir) + @$(NORMAL_INSTALL) + for sensor in $(pkgsensordir)/*; do \ + if test -f $$sensor; then \ + $(INSTALL_DATA) $$sensor $(datadir)/$(PACKAGE)/$(pkgsensordir)/ ; \ + fi \ + done diff --git a/src/sensor/gnunet-service-sensor.c b/src/sensor/gnunet-service-sensor.c index 08b54453a..82da2c993 100644 --- a/src/sensor/gnunet-service-sensor.c +++ b/src/sensor/gnunet-service-sensor.c @@ -383,11 +383,9 @@ get_sensor_dir() char* datadir; char* sensordir; - datadir = GNUNET_OS_installation_get_path(GNUNET_OS_IPK_SELF_PREFIX); - //should eval to '$prefix/share/gnunet-mi/sensors/' - //TODO: is there a better way? - GNUNET_asprintf(&sensordir, "%sshare%sgnunet-mi%ssensors%s", - datadir, DIR_SEPARATOR_STR, DIR_SEPARATOR_STR, DIR_SEPARATOR_STR); + datadir = GNUNET_OS_installation_get_path(GNUNET_OS_IPK_DATADIR); + GNUNET_asprintf(&sensordir, "%ssensors%s", + datadir, DIR_SEPARATOR_STR); return sensordir; } -- 2.25.1