summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2012-05-03 05:19:21 +0000
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2012-05-03 05:19:21 +0000
commitba12e5e2de9fab6e330e37ba83bf1260b153f54d (patch)
tree138f7bba0ae48ae6c4451ee01b2e9d092afb77ff /Makefile
parent1bc58d4a16cc7f3e8af1f08a187f264d3df98e28 (diff)
downloadawall-ba12e5e2de9fab6e330e37ba83bf1260b153f54d.tar.bz2
awall-ba12e5e2de9fab6e330e37ba83bf1260b153f54d.tar.xz
installer Makefile added
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile47
1 files changed, 47 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..51dd0e1
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,47 @@
+# Installer Makefile for Alpine Wall
+# Copyright (C) 2012 Kaarle Ritvanen
+# Licensed under the terms of GPL2
+
+ROOT_DIR := /
+LUA_VERSION := 5.1
+
+poldir := usr/share/awall
+
+all: install
+
+define mkdir =
+$(ROOT_DIR)/$(1):
+ install -d $$@
+
+files += $(1)
+endef
+
+define copy =
+$(ROOT_DIR)/$(2)/%.$(3): $(1)/%.$(3)
+ install -d $$(dir $$@)
+ install -m 644 $$< $$@
+
+files += $(patsubst $(1)/%.$(3),$(2)/%.$(3),$(shell find $(1) -name '*.$(3)'))
+endef
+
+define rename =
+$(ROOT_DIR)/$(2): $(1)
+ install -d $$(dir $$@)
+ install -m $(3) $(1) $$@
+
+files += $(2)
+endef
+
+$(eval $(call copy,awall,usr/share/lua/$(LUA_VERSION)/awall,lua))
+$(eval $(call copy,json,$(poldir)/mandatory,json))
+
+$(eval $(call rename,awall-cli,usr/sbin/awall,755))
+$(eval $(call rename,sample-policy.json,$(poldir)/sample/sample-policy.json,644))
+
+$(eval $(call mkdir,etc/awall))
+$(eval $(call mkdir,var/run/awall))
+$(eval $(call mkdir,$(poldir)/optional))
+
+install: $(foreach f,$(files),$(ROOT_DIR)/$(f))
+
+.PHONY: all