diff --git a/configure.ac b/configure.ac index 7109977e..076dac23 100644 --- a/configure.ac +++ b/configure.ac @@ -15,11 +15,11 @@ AM_INIT_AUTOMAKE([tar-ustar]) PACKAGE_DATE=m4_esyscmd_s([date +%Y%m%d]) PACKAGE_VENDOR="CORE Developers" PACKAGE_MAINTAINERS="$PACKAGE_VENDOR <$PACKAGE_BUGREPORT>" + +# core specific variables CORE_LIB_DIR="\${prefix}/lib/core" -# TODO: hard setting path, until support by setup.py CORE_CONF_DIR="/etc/core" -CORE_DATA_DIR="\${datarootdir}/core" -# TODO: verify there is need to hard set /var +CORE_DATA_DIR="\${datadir}/core" CORE_STATE_DIR="/var" AC_SUBST(PACKAGE_DATE) diff --git a/daemon/Makefile.am b/daemon/Makefile.am index ee8dc238..bf24f512 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -46,7 +46,7 @@ install-exec-hook: uninstall-hook: rm -rf $(DESTDIR)/etc/core rm -rf $(DESTDIR)/$(datadir)/core - rm -f $(addprefix $(DESTDIR)/$(datadir)/man/man1/, $(MAN_FILES)) + rm -f $(addprefix $(DESTDIR)/$(datarootdir)/man/man1/, $(MAN_FILES)) rm -f $(addprefix $(DESTDIR)/$(bindir)/,$(SCRIPT_FILES)) rm -rf $(DESTDIR)/$(pythondir)/core-$(PACKAGE_VERSION)-py$(PYTHON_VERSION).egg-info rm -rf $(DESTDIR)/$(pythondir)/core diff --git a/daemon/core/constants.py.in b/daemon/core/constants.py.in index 7dea1ad8..fc901893 100644 --- a/daemon/core/constants.py.in +++ b/daemon/core/constants.py.in @@ -1,18 +1,27 @@ +import os + COREDPY_VERSION = "@PACKAGE_VERSION@" CORE_STATE_DIR = "@CORE_STATE_DIR@" CORE_CONF_DIR = "@CORE_CONF_DIR@" CORE_DATA_DIR = "@CORE_DATA_DIR@" -CORE_LIB_DIR = "@CORE_LIB_DIR@" - -VNODED_BIN = "@bindir@/vnoded" -VCMD_BIN = "@bindir@/vcmd" -BRCTL_BIN = "@brctl_path@/brctl" -SYSCTL_BIN = "@sysctl_path@/sysctl" -IP_BIN = "@ip_path@/ip" -TC_BIN = "@tc_path@/tc" -EBTABLES_BIN = "@ebtables_path@/ebtables" QUAGGA_STATE_DIR = "@CORE_STATE_DIR@/run/quagga" -MOUNT_BIN = "@mount_path@/mount" -UMOUNT_BIN = "@umount_path@/umount" -OVS_BIN = "@ovs_vs_path@/ovs-vsctl" -OVS_FLOW_BIN = "@ovs_of_path@/ovs-ofctl" + + +def which(command): + for path in os.environ["PATH"].split(os.pathsep): + command_path = os.path.join(path, command) + if os.path.isfile(command_path) and os.access(command_path, os.X_OK): + return command_path + + +VNODED_BIN = which("vnoded") +VCMD_BIN = which("vcmd") +BRCTL_BIN = which("brctl") +SYSCTL_BIN = which("sysctl") +IP_BIN = which("ip") +TC_BIN = which("tc") +EBTABLES_BIN = which("ebtables") +MOUNT_BIN = which("mount") +UMOUNT_BIN = which("umount") +OVS_BIN = which("ovs-vsctl") +OVS_FLOW_BIN = which("ovs-ofctl")