summaryrefslogtreecommitdiffstats
path: root/python/Makefile.am
blob: b3547192bd14c1cd8dc3b04e0c1c233fd817cf23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
LIBS =	\
		suricata/__init__.py \
		suricata/config/__init__.py \
		suricata/ctl/__init__.py \
		suricata/ctl/filestore.py \
		suricata/ctl/loghandler.py \
		suricata/ctl/main.py \
		suricata/ctl/test_filestore.py \
		suricata/sc/__init__.py \
		suricata/sc/specs.py \
		suricata/sc/suricatasc.py \
		suricatasc/__init__.py

BINS =	\
		suricatasc \
		suricatactl

EXTRA_DIST = $(LIBS) bin suricata/config/defaults.py

if HAVE_PYTHON

install-exec-local:
	install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricata/config"
	install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricata/ctl"
	install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricata/sc"
	install -d -m 0755 "$(DESTDIR)$(prefix)/lib/suricata/python/suricatasc"
	install -d -m 0755 "$(DESTDIR)$(prefix)/bin"
	for src in $(LIBS); do \
		install -m 0644 $(srcdir)/$$src "$(DESTDIR)$(prefix)/lib/suricata/python/$$src"; \
	done
	install suricata/config/defaults.py \
		"$(DESTDIR)$(prefix)/lib/suricata/python/suricata/config/defaults.py"
	for bin in $(BINS); do \
		cat "$(srcdir)/bin/$$bin" | \
		    sed -e "1 s,.*,#"'!'" ${HAVE_PYTHON}," > "${DESTDIR}$(bindir)/$$bin"; \
		chmod 0755 "$(DESTDIR)$(bindir)/$$bin"; \
	done

uninstall-local:
	rm -f $(DESTDIR)$(bindir)/suricatactl
	rm -f $(DESTDIR)$(bindir)/suricatasc
	rm -rf $(DESTDIR)$(prefix)/lib/suricata/python

clean-local:
	find . -name \*.pyc -print0 | xargs -0 rm -f

endif