diff options
author | Ted Trask <ttrask01@yahoo.com> | 2011-08-30 20:13:24 +0000 |
---|---|---|
committer | Ted Trask <ttrask01@yahoo.com> | 2011-08-30 20:13:24 +0000 |
commit | 42750f022f4b2b9a9df6237c0981fdd479f4532d (patch) | |
tree | 219a575c980e5942c2ca9473b426caf289188e15 | |
parent | 733a51c96e6b97a725afab9923efd7ef5b509e0b (diff) | |
download | acf-core-42750f022f4b2b9a9df6237c0981fdd479f4532d.tar.bz2 acf-core-42750f022f4b2b9a9df6237c0981fdd479f4532d.tar.xz |
Moved mvc.lua into /usr/share/lua and cli to /usr/bin/acf_cli
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | README | 1 | ||||
-rw-r--r-- | bin/Makefile | 36 | ||||
-rwxr-xr-x | bin/acf_cli (renamed from www/cgi-bin/cli) | 16 | ||||
-rw-r--r-- | config.mk | 2 | ||||
-rw-r--r-- | lua/Makefile | 35 | ||||
-rwxr-xr-x | lua/mvc.lua (renamed from www/cgi-bin/mvc.lua) | 0 | ||||
-rw-r--r-- | www/Makefile | 4 | ||||
-rwxr-xr-x | www/cgi-bin/acf | 2 | ||||
-rw-r--r-- | www/sample.html | 117 |
10 files changed, 83 insertions, 132 deletions
@@ -6,7 +6,7 @@ P=$(PACKAGE)-$(VERSION) DISTDIR:=$(shell pwd)/$(P) DISTPKG=$(P).tar.bz2 -SUBDIRS=app lib www +SUBDIRS=app bin lib lua www EXTRA_DIST=config.mk Makefile README CONF_FILES=acf.conf @@ -1,5 +1,4 @@ Alpine Configuration Framework -(A work in progress.) To install the package run: diff --git a/bin/Makefile b/bin/Makefile new file mode 100644 index 0000000..77158af --- /dev/null +++ b/bin/Makefile @@ -0,0 +1,36 @@ +include ../config.mk + +BIN_DIST=acf_cli\ + +EXTRA_DIST=Makefile +DISTFILES=$(BIN_DIST) $(EXTRA_DIST) + +install_dir=$(DESTDIR)/$(bindir) +dist_dir=$(DISTDIR)/$(notdir $(PWD)) + +phony+=all +all: + +phony+=clean +clean: + +phony+=distdir +distdir: $(DISTFILES) + mkdir -p "$(dist_dir)" + for i in $(DISTFILES); do\ + dest=`dirname "$(dist_dir)/$$i"`;\ + mkdir -p "$$dest";\ + cp "$$i" "$$dest";\ + done + +phony+=install +install: + mkdir -p $(install_dir) + for i in $(BIN_DIST); do\ + dest=`dirname "$(install_dir)/$$i"`;\ + mkdir -p "$$dest";\ + cp "$$i" "$$dest";\ + done + chmod 700 $(install_dir)/acf_cli + +.PHONY: $(phony) diff --git a/www/cgi-bin/cli b/bin/acf_cli index 437a211..4ef512e 100755 --- a/www/cgi-bin/cli +++ b/bin/acf_cli @@ -2,7 +2,7 @@ if #arg == 0 then print([[ACF Client interface -Usage: cli [action] [parameter]... +Usage: acf_cli [action] [parameter]... Actions are of the form "prefix/controller/action" Parameters are of the form "parameter=value" @@ -10,7 +10,7 @@ Parameters are of the form "parameter=value" boolean parameters are true if defined, false is undefined Example: -cli acf-util/password/newuser password="test123" password_confirm="test123" roles[1]="ADMIN" userid="root" Create +acf_cli acf-util/password/newuser password="test123" password_confirm="test123" roles[1]="ADMIN" userid="root" Create For forms, remember to pass in the "option" value as a parameter (see Create in example above). Output will be a serialized Lua table. @@ -19,12 +19,12 @@ Output will be a serialized Lua table. end require("posix") -local PATH = package.path -local p = posix.dirname(arg[0]) -if p:sub(1,1) ~= "/" then p = posix.getcwd().."/"..p end -package.path = p.."/?.lua;" .. package.path -require("mvc") -package.path = PATH +--local PATH = package.path +--local p = posix.dirname(arg[0]) +--if p:sub(1,1) ~= "/" then p = posix.getcwd().."/"..p end +--package.path = p.."/?.lua;" .. package.path +mvc = require("acf.mvc") +--package.path = PATH -- this is to get around having to store -- the config file in /etc/helloworld/helloworld.conf @@ -8,3 +8,5 @@ cgibindir=${wwwdir}/cgi-bin appdir=${acfdir}/app acflibdir=${acfdir}/lib sessionsdir=${localstatedir}/lib/acf/sessions +bindir=${prefix}/bin +luadir=${prefix}/share/lua/5.1/acf diff --git a/lua/Makefile b/lua/Makefile new file mode 100644 index 0000000..c9e7b43 --- /dev/null +++ b/lua/Makefile @@ -0,0 +1,35 @@ +include ../config.mk + +LUA_DIST=mvc.lua\ + +EXTRA_DIST=Makefile +DISTFILES=$(LUA_DIST) $(EXTRA_DIST) + +install_dir=$(DESTDIR)/$(luadir) +dist_dir=$(DISTDIR)/$(notdir $(PWD)) + +phony+=all +all: + +phony+=clean +clean: + +phony+=distdir +distdir: $(DISTFILES) + mkdir -p "$(dist_dir)" + for i in $(DISTFILES); do\ + dest=`dirname "$(dist_dir)/$$i"`;\ + mkdir -p "$$dest";\ + cp "$$i" "$$dest";\ + done + +phony+=install +install: + mkdir -p $(install_dir) + for i in $(LUA_DIST); do\ + dest=`dirname "$(install_dir)/$$i"`;\ + mkdir -p "$$dest";\ + cp "$$i" "$$dest";\ + done + +.PHONY: $(phony) diff --git a/www/cgi-bin/mvc.lua b/lua/mvc.lua index 41aa9db..41aa9db 100755 --- a/www/cgi-bin/mvc.lua +++ b/lua/mvc.lua diff --git a/www/Makefile b/www/Makefile index 5bc108c..71e6c62 100644 --- a/www/Makefile +++ b/www/Makefile @@ -1,10 +1,7 @@ include ../config.mk WWW_DIST=cgi-bin/acf\ - cgi-bin/cli\ - cgi-bin/mvc.lua\ index.html\ - sample.html\ EXTRA_DIST=Makefile DISTFILES=$(WWW_DIST) $(EXTRA_DIST) @@ -36,6 +33,5 @@ install: cp "$$i" "$$dest";\ done chmod 755 $(install_dir)/cgi-bin/acf - chmod 700 $(install_dir)/cgi-bin/cli .PHONY: $(phony) diff --git a/www/cgi-bin/acf b/www/cgi-bin/acf index d866de9..7f6592d 100755 --- a/www/cgi-bin/acf +++ b/www/cgi-bin/acf @@ -1,6 +1,6 @@ #!/usr/bin/haserl --shell=lua --upload-limit=256 <% -require("mvc") +mvc = require("acf.mvc") -- create a new container FRAMEWORK=mvc:new() diff --git a/www/sample.html b/www/sample.html deleted file mode 100644 index e4c9e14..0000000 --- a/www/sample.html +++ /dev/null @@ -1,117 +0,0 @@ -<!DOCTYPE HTML PUBLIC "-//W3C//ddD HTML 4.01 Transitional//EN"> -<html lang="en"> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> -<title>Alpine</title> -<link rel="stylesheet" type="text/css" href="snow/snow.css"> -</head> - - -<body> -<div id=header> - <a href="#Content" class="hide">[Skip to main content]</a> - <h1 class="logo">AlpineLinux</h1> - <div class="leader">[ this is h-leader div text <a href="#Content">Goto content</a>]</div> - <p>This is plain old Head div text</p> -</div> - -<div id="main"> - <div id="nav"> - <ul><li>Networking - <ul><a href=""><li>Interfaces</li></a> - <a href=""><li>Firewall</li></a> - <a href=""><li>BGP</li></a> - <a href=""><li>DHCP Server</li></a> - <a href=""><li>Ipsec VPN</li></a> - </ul></li> - <li>Applications - <ul><li><a href="">Web Proxy</a></li> - <li><a href="">Content Filter</a></li> - <li><a href="">Fetchmail</a></li> - <li><a href="">Certificate Authority</a></li> - </ul></li> - <li>System - <ul><li><a href="">Backup</a></li> - <li><a href="">Package Management</a></li> - <li><a href="">General Health</a></li> - <li><a href="">System Logs</a></li> - <li><a href="">SNMP</a></li> - </ul></li> - </ul> - </div> - - <div class="postnav"> - <h2>Networking : Interfaces</h2> - <p>[ welcome ] > [ login ] > [ bgp ] > [ firewall ] > [ content filter ] > [ interfaces ]</p> - </div> - <a name="Content"></a> - <div id="subnav"> - <a href="">Nav 1</a> - <strong class=selected>Nav 2</strong> - <a href="">Nav 3</a> - </div> - - <div id="content"> - - - - <p> -This is plain old content -</p> - - -<h1>Errors</h1> -<p class="error">This is error text. As if you didn't know that. Just check the errors below.</p> -<p class="hide">This is some plain content level hide text</p> -<p>This is a page with a <a href="foo">link</a> in it.</p> - -<h1>Networking - Status</h1> -<p>This is the networking page. This is a very long paragraph in that page, talking about -all the good things on this page. This is not the real page, its just a standin page for -the page you want. Evenutally, you'll see the page you want. But not quite yet.</p> - -<h2>Status</h2> -<p>The service is running</p> -<form> -<dl> -<dt>bozo</dt> -<dd><input class=error type=text value="Baz" name=bozo size=3>This is error text</dd> - -<dt>foo</dt><dd> -<input type=text value="foo" name=foo size=40> -</dd> - -<dt>Command</dt> -<dd> -<input type=submit value="Start" name="cmd"> -<input type=submit value="Stop" name="cmd"> -<input type=submit value="Restart" name="cmd"> -</dd> - -<dt>Textbox</dt> -<dd><textarea cols=80 rows=10 name="textbox">fooo</textarea> -</dd> - - -<dt>A Tag with no form element</dt> -<dd>This is just some text</dd> - -</dl> -</form> - -<h2>Configure</h2> -<p>Bring Service Down</p> -<p>Bring Service Up</p> -</div> -</div> - -<div id=c-trailer>This is c-trailer</div> - -<div id="footer"> - <div id="f-leader">F leader</div> - <p>Made with care by webconf</p> - <div id="f-nav">F nav</div> - <div id="f-trailer">F trailer</div> -</div> -</body> -</html> |