Better identification of global plugin dir

Looks in a couple of spots to identify the global plugin dir.
Tries to identify versions beneath that if they exist and chooses
the last (newest).
This commit is contained in:
Glen Gibb committed 2008-07-11 17:45:20 -07:00
1 parent d7b62547a7
commit 31091d70ce
1 file changed
+21 -3
@@ -10,9 +10,27 @@ PLUGIN_NAME = packet-openflow
LOCAL_PLUGIN_DIR = /home/$(shell whoami)/.wireshark/plugins
# determine global installation path (use latest plugin version path)
GLOBAL_PLUGIN_DIR_PARTIAL=/usr/local/lib/wireshark/plugins
GLOBAL_PLUGIN_VER=$(shell ls $(GLOBAL_PLUGIN_DIR_PARTIAL) | sort --reverse | head -n 1)
GLOBAL_PLUGIN_DIR=$(GLOBAL_PLUGIN_DIR_PARTIAL)/$(GLOBAL_PLUGIN_VER)
ifneq ($(wildcard /usr/lib/wireshark/plugins),)
GLOBAL_PLUGIN_DIR_PARTIAL=/usr/lib/wireshark/plugins
else ifneq ($(wildcard /usr/local/lib/wireshark/plugins),)
GLOBAL_PLUGIN_DIR_PARTIAL=/usr/local/lib/wireshark/plugins
endif
# Work out if there are version-specific subdirectories
GLOBAL_PLUGIN_DIR_FILES := $(wildcard $(GLOBAL_PLUGIN_DIR_PARTIAL)/*)
GLOBAL_PLUGIN_DIR_SUBDIRS := $(foreach file,$(GLOBAL_PLUGIN_DIR_FILES),$(dir $(wildcard $(file)/.)))
GLOBAL_PLUGIN_DIR_SUBDIRS := $(subst $(GLOBAL_PLUGIN_DIR_PARTIAL)/,,$(GLOBAL_PLUGIN_DIR_SUBDIRS))
GLOBAL_PLUGIN_DIR_SUBDIRS := $(subst /,,$(GLOBAL_PLUGIN_DIR_SUBDIRS))
# Assume that the "last" directory is the one we ant to use if it exists
GLOBAL_PLUGIN_VER := $(lastword $(sort $(GLOBAL_PLUGIN_DIR_SUBDIRS)))
# Create the actual global plugin dir to use
ifneq ($(GLOBAL_PLUGIN_VER),)
GLOBAL_PLUGIN_DIR=$(GLOBAL_PLUGIN_DIR_PARTIAL)/$(GLOBAL_PLUGIN_VER)
else
GLOBAL_PLUGIN_DIR=$(GLOBAL_PLUGIN_DIR_PARTIAL)
endif
# specify the port on which event capture packets will be destined
DISSECT_PORT = -DOPENFLOW_DST_TCP_PORT=975