ia64/xen-unstable

view tools/security/Makefile @ 16522:54482c56e435

Implement legacy XML-RPC interface for ACM commands.

This patch moves the directory of files where xend is writing policies
and resource labels into to /var/lib/xend/security/policies.

Signed-off-by: Stefan Berger <stefanb@us.ibm.com>
author Keir Fraser <keir.fraser@citrix.com>
date Wed Dec 05 09:45:13 2007 +0000 (2007-12-05)
parents 5255eac35270
children 923b8dbb0fed
line source
1 XEN_ROOT = ../..
2 include $(XEN_ROOT)/tools/Rules.mk
4 CFLAGS += -Werror
5 CFLAGS += -fno-strict-aliasing
6 CFLAGS += -I. -I $(XEN_LIBXC)
8 CPPFLAGS += -MMD -MF .$*.d
9 PROG_DEPS = .*.d
11 XML2VERSION = $(shell xml2-config --version )
12 CFLAGS += $(shell xml2-config --cflags )
13 CFLAGS += $(shell if [[ $(XML2VERSION) < 2.6.20 ]]; then echo ""; else echo "-DVALIDATE_SCHEMA"; fi )
14 LDFLAGS += $(shell xml2-config --libs ) # if this does not work, try -L/usr/lib -lxml2 -lz -lpthread -lm
16 SRCS_TOOL = secpol_tool.c
17 OBJS_TOOL := $(patsubst %.c,%.o,$(filter %.c,$(SRCS_TOOL)))
19 ACM_INST_TOOLS = xensec_tool xensec_gen
20 ACM_EZPOLICY = xensec_ezpolicy
21 ACM_OBJS = $(OBJS_TOOL) $(OBJS_GETD)
22 ACM_SCRIPTS = python/xensec_tools/acm_getlabel
24 ACM_CONFIG_DIR = /etc/xen/acm-security
25 ACM_POLICY_DIR = $(ACM_CONFIG_DIR)/policies
26 ACM_SCRIPT_DIR = $(ACM_CONFIG_DIR)/scripts
28 ACM_INST_HTML = python/xensec_gen/index.html
29 ACM_INST_CGI = python/xensec_gen/cgi-bin/policy.cgi
30 ACM_SECGEN_HTMLDIR= /var/lib/xensec_gen
31 ACM_SECGEN_CGIDIR = $(ACM_SECGEN_HTMLDIR)/cgi-bin
33 ACM_SCHEMA = security_policy.xsd
34 ACM_EXAMPLES = client_v1 test
35 ACM_DEF_POLICIES = DEFAULT-UL
36 ACM_POLICY_SUFFIX = security_policy.xml
38 ifeq ($(ACM_SECURITY),y)
39 .PHONY: all
40 all: build
42 .PHONY: install
43 ifndef XEN_PYTHON_NATIVE_INSTALL
44 install: LIBPATH=$(shell PYTHONPATH=../python/xen/util python -c "import auxbin; print auxbin.libpath()")
45 endif
46 install: all $(ACM_CONFIG_FILE)
47 $(INSTALL_DIR) $(DESTDIR)/usr/sbin
48 $(INSTALL_PROG) $(ACM_INST_TOOLS) $(DESTDIR)/usr/sbin
49 $(INSTALL_PROG) $(ACM_EZPOLICY) $(DESTDIR)/usr/sbin
50 $(INSTALL_DIR) $(DESTDIR)$(ACM_CONFIG_DIR)
51 $(INSTALL_DIR) $(DESTDIR)$(ACM_POLICY_DIR)
52 $(INSTALL_DATA) policies/$(ACM_SCHEMA) $(DESTDIR)$(ACM_POLICY_DIR)
53 $(INSTALL_DIR) $(DESTDIR)$(ACM_POLICY_DIR)/example
54 for i in $(ACM_EXAMPLES); do \
55 $(INSTALL_DATA) policies/example/$$i-$(ACM_POLICY_SUFFIX) $(DESTDIR)$(ACM_POLICY_DIR)/example/; \
56 done
57 for i in $(ACM_DEF_POLICIES); do \
58 $(INSTALL_DATA) policies/$$i-$(ACM_POLICY_SUFFIX) $(DESTDIR)$(ACM_POLICY_DIR); \
59 done
60 $(INSTALL_DIR) $(DESTDIR)$(ACM_SCRIPT_DIR)
61 $(INSTALL_PROG) $(ACM_SCRIPTS) $(DESTDIR)$(ACM_SCRIPT_DIR)
62 $(INSTALL_DIR) $(DESTDIR)$(ACM_SECGEN_HTMLDIR)
63 $(INSTALL_DATA) $(ACM_INST_HTML) $(DESTDIR)$(ACM_SECGEN_HTMLDIR)
64 $(INSTALL_DIR) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
65 $(INSTALL_PROG) $(ACM_INST_CGI) $(DESTDIR)$(ACM_SECGEN_CGIDIR)
66 ifndef XEN_PYTHON_NATIVE_INSTALL
67 python python/setup.py install --install-lib="$(DESTDIR)$(LIBPATH)/python"
68 else
69 python python/setup.py install --root="$(DESTDIR)"
70 endif
71 else
72 .PHONY: all
73 all:
75 .PHONY: install
76 install:
77 endif
79 .PHONY: build
80 build: $(ACM_INST_TOOLS) $(ACM_NOINST_TOOLS)
81 python python/setup.py build
82 chmod 700 $(ACM_SCRIPTS)
84 xensec_tool: $(OBJS_TOOL)
85 $(CC) -g $(CFLAGS) $(LDFLAGS) -O0 -o $@ $^ -L$(XEN_LIBXC) -lxenctrl
87 xensec_gen: xensec_gen.py
88 cp -f $^ $@
90 .PHONY: clean
91 clean:
92 $(RM) $(ACM_INST_TOOLS) $(ACM_NOINST_TOOLS)
93 $(RM) $(ACM_OBJS)
94 $(RM) $(PROG_DEPS)
95 $(RM) -r build
97 .PHONY: mrproper
98 mrproper: clean
100 -include $(PROG_DEPS)