aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-03-31 19:34:55 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2014-03-31 19:34:55 +0300
commite958336d6ca387cbd0dfdbe193b2d39f28d435af (patch)
treec29b15feddde01d75b4347543503f67840a71446
parent8e0c7cb2607622cf601c90e691ef7ef4380779f4 (diff)
downloadawall-e958336d6ca387cbd0dfdbe193b2d39f28d435af.tar.bz2
awall-e958336d6ca387cbd0dfdbe193b2d39f28d435af.tar.xz
remove Lua version number from source file
-rw-r--r--Makefile18
-rw-r--r--awall/init.lua2
2 files changed, 12 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index ba36d62..9e95b58 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,11 @@
# Installer Makefile for Alpine Wall
-# Copyright (C) 2012-2013 Kaarle Ritvanen
+# Copyright (C) 2012-2014 Kaarle Ritvanen
# See LICENSE file for license details
ROOT_DIR := /
LUA_VERSION := 5.1
-poldir := usr/share/awall
+resdir := usr/share/awall
confdir := etc/awall
all: install
@@ -34,17 +34,21 @@ files += $(2)
endef
$(eval $(call copy,awall,usr/share/lua/$(LUA_VERSION)/awall,lua))
-$(eval $(call copy,json,$(poldir)/mandatory,json))
+$(eval $(call copy,json,$(resdir)/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 rename,sample-policy.json,$(resdir)/sample/sample-policy.json,644))
$(eval $(call mkdir,$(confdir)))
$(eval $(call mkdir,$(confdir)/optional))
$(eval $(call mkdir,$(confdir)/private))
-$(eval $(call mkdir,$(poldir)/optional))
-$(eval $(call mkdir,$(poldir)/private))
+$(eval $(call mkdir,$(resdir)/optional))
+$(eval $(call mkdir,$(resdir)/private))
-install: $(foreach f,$(files),$(ROOT_DIR)/$(f))
+$(ROOT_DIR)/$(resdir)/modules:
+ install -d $(dir $@)
+ ln -s ../lua/$(LUA_VERSION)/awall/modules $@
+
+install: $(foreach f,$(files),$(ROOT_DIR)/$(f)) $(ROOT_DIR)/$(resdir)/modules
.PHONY: all
diff --git a/awall/init.lua b/awall/init.lua
index d954849..1c62ce8 100644
--- a/awall/init.lua
+++ b/awall/init.lua
@@ -46,7 +46,7 @@ function M.loadmodules(path)
if path then lfs.chdir(path) end
local modules = {}
- for modfile in lfs.dir((path or '/usr/share/lua/5.1')..'/awall/modules') do
+ for modfile in lfs.dir((path or '/usr/share')..'/awall/modules') do
if stringy.endswith(modfile, '.lua') then
table.insert(modules, 'awall.modules.'..modfile:sub(1, -5))
end