summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-09-22 14:11:26 +0000
committerTed Trask <ttrask01@yahoo.com>2009-09-22 14:11:26 +0000
commita30b97b092520b2cf6665eccd9a4978a182d6723 (patch)
tree96d535f7987837be1753fc234250f8c7e7851dfe
downloadacf-amavisd-new-0.1.0.tar.bz2
acf-amavisd-new-0.1.0.tar.xz
First cut at ACF for amavis.v0.1.0
-rw-r--r--Makefile44
-rw-r--r--README1
-rw-r--r--amavis-controller.lua18
l---------amavis-expert-html.lsp1
-rw-r--r--amavis-model.lua33
l---------amavis-startstop-html.lsp1
l---------amavis-status-html.lsp1
-rw-r--r--amavis.menu3
-rw-r--r--amavis.roles3
-rw-r--r--config.mk10
10 files changed, 115 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..fce605e
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,44 @@
+APP_NAME=amavisd-new
+PACKAGE=acf-$(APP_NAME)
+VERSION=0.1.0
+
+APP_DIST=\
+ amavis* \
+
+
+EXTRA_DIST=README Makefile config.mk
+
+DISTFILES=$(APP_DIST) $(EXTRA_DIST)
+
+TAR=tar
+
+P=$(PACKAGE)-$(VERSION)
+tarball=$(P).tar.bz2
+install_dir=$(DESTDIR)/$(appdir)/$(APP_NAME)
+
+all:
+clean:
+ rm -rf $(tarball) $(P)
+
+dist: $(tarball)
+
+install:
+ mkdir -p "$(install_dir)"
+ cp -a $(APP_DIST) "$(install_dir)"
+
+$(tarball): $(DISTFILES)
+ rm -rf $(P)
+ mkdir -p $(P)
+ cp -a $(DISTFILES) $(P)
+ $(TAR) -jcf $@ $(P)
+ rm -rf $(P)
+
+# target that creates a tar package, unpacks is and install from package
+dist-install: $(tarball)
+ $(TAR) -jxf $(tarball)
+ $(MAKE) -C $(P) install DESTDIR=$(DESTDIR)
+ rm -rf $(P)
+
+include config.mk
+
+.PHONY: all clean dist install dist-install
diff --git a/README b/README
new file mode 100644
index 0000000..d78940b
--- /dev/null
+++ b/README
@@ -0,0 +1 @@
+ACF for amavisd-new
diff --git a/amavis-controller.lua b/amavis-controller.lua
new file mode 100644
index 0000000..a7bc988
--- /dev/null
+++ b/amavis-controller.lua
@@ -0,0 +1,18 @@
+module(..., package.seeall)
+
+-- Load libraries
+require("controllerfunctions")
+
+default_action = "status"
+
+function status(self)
+ return self.model.getstatus()
+end
+
+function startstop(self)
+ return controllerfunctions.handle_startstop(self, self.model.startstop_service, self.clientdata)
+end
+
+function expert(self)
+ return controllerfunctions.handle_form(self, self.model.get_filedetails, self.model.update_filedetails, self.clientdata, "Save", "Edit Amavis Config", "Configuration Set")
+end
diff --git a/amavis-expert-html.lsp b/amavis-expert-html.lsp
new file mode 120000
index 0000000..207f324
--- /dev/null
+++ b/amavis-expert-html.lsp
@@ -0,0 +1 @@
+../expert-html.lsp \ No newline at end of file
diff --git a/amavis-model.lua b/amavis-model.lua
new file mode 100644
index 0000000..d3d9ce0
--- /dev/null
+++ b/amavis-model.lua
@@ -0,0 +1,33 @@
+module(..., package.seeall)
+
+-- Load libraries
+require("modelfunctions")
+
+-- Set variables
+local configfile = "/etc/amavisd.conf"
+local processname = "amavisd"
+local packagename = "amavisd-new"
+
+local path = "PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin "
+
+-- ################################################################################
+-- LOCAL FUNCTIONS
+
+-- ################################################################################
+-- PUBLIC FUNCTIONS
+
+function startstop_service(action)
+ return modelfunctions.startstop_service(processname, action)
+end
+
+function getstatus()
+ return modelfunctions.getstatus(processname, packagename, "Amavis Status")
+end
+
+function get_filedetails()
+ return modelfunctions.getfiledetails(configfile)
+end
+
+function update_filedetails(filedetails)
+ return modelfunctions.setfiledetails(filedetails, {configfile})
+end
diff --git a/amavis-startstop-html.lsp b/amavis-startstop-html.lsp
new file mode 120000
index 0000000..0ea2627
--- /dev/null
+++ b/amavis-startstop-html.lsp
@@ -0,0 +1 @@
+../startstop-html.lsp \ No newline at end of file
diff --git a/amavis-status-html.lsp b/amavis-status-html.lsp
new file mode 120000
index 0000000..b2f8480
--- /dev/null
+++ b/amavis-status-html.lsp
@@ -0,0 +1 @@
+../status-html.lsp \ No newline at end of file
diff --git a/amavis.menu b/amavis.menu
new file mode 100644
index 0000000..59cf75c
--- /dev/null
+++ b/amavis.menu
@@ -0,0 +1,3 @@
+#CAT GROUP/DESC TAB ACTION
+Applications 63Amavis Status status
+Applications 63Amavis Expert expert
diff --git a/amavis.roles b/amavis.roles
new file mode 100644
index 0000000..a5b91d2
--- /dev/null
+++ b/amavis.roles
@@ -0,0 +1,3 @@
+USER=amavis:status,amavis:startstop
+EXPERT=amavis:expert
+ADMIN=amavis:status,amavis:startstop,amavis:expert
diff --git a/config.mk b/config.mk
new file mode 100644
index 0000000..45f4d21
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,10 @@
+prefix=/usr
+datadir=${prefix}/share
+sysconfdir=${prefix}/etc
+localstatedir=${prefix}/var
+acfdir=${datadir}/acf
+wwwdir=${acfdir}/www
+cgibindir=${acfdir}/cgi-bin
+appdir=${acfdir}/app
+acflibdir=${acfdir}/lib
+sessionsdir=${localstatedir}/lib/acf/sessions