]> git.etc.gen.nz Git - spong.git/commitdiff
add missing files from 2.7.7 release to the CVS
authorJan Willamowius <jan@willamowius.de>
Tue, 13 Sep 2005 15:23:09 +0000 (15:23 +0000)
committerJan Willamowius <jan@willamowius.de>
Tue, 13 Sep 2005 15:23:09 +0000 (15:23 +0000)
Makefile [new file with mode: 0644]
config.mk [new file with mode: 0644]
httpd.in [new file with mode: 0644]
spong.mk [new file with mode: 0644]

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..0fdbd8c
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,253 @@
+# $Id: Makefile,v 1.11 2005/09/13 15:23:09 willamowius Exp $
+#
+# Makefile for Spong (Version 2.6f and up).
+#
+# Presently you can put this in the directory with the build script
+# and run:
+#
+#      make server     
+#      make client SYSTEM=OS
+#
+# and if ./config/spong.conf.OS exists it will build a spong client
+# installation in ./OS-client.
+#
+# Default for SYSTEM is defined in config.mk
+
+include config.mk
+include spong.mk
+
+#---- Targets
+
+default:       help
+
+help:
+#      @echo "Try 'make client SYSTEM=<OS>' where <OS> is in the list: "
+#      @echo " $(OS)"
+#      @echo "Default OS is $(SYSTEM)"
+
+       @echo "'make server'  installs the server for the default platform"
+       @echo "               defined in config.mk"
+       @echo
+       @echo "'make client'  installs the client for the default platform"
+       @echo "               in ./client-<OS>"
+       @echo
+       @echo "'make client SYSTEM=<OS>'  will build clients for other platforms"
+
+#---- Clients [ this is incredibly ugly, GH. ]
+#
+# A better way might be to use a client.mk include file :) and use the
+# server part below ...  We'd need to redefine the lists above.
+#
+
+server: beroot bindir etcdir libdir webdir cgidir tmpdir vardir
+
+beroot:
+       @[ `whoami` = root ] || false
+       @echo " Yer root"
+
+client:        $(SYSTEM)-client
+
+$(SYSTEM)-test:
+       @[ -f ./config/spong.conf.$(SYSTEM) ] || \
+       ( echo "No such system $(SYSTEM)" && false )
+       mkdir -p $(SYSTEM)-client/lib/Spong
+
+$(SYSTEM)-client:      $(SYSTEM)-test clientdir clientlib clientetc clientbin
+       -find $(SYSTEM)-client -name CVS -exec rm -rf '{}' \;
+
+clientdir:     $(SYSTEM)-client/lib/Spong 
+       [ -d ./$(SYSTEM)-client/lib/Spong ] ||  \
+          mkdir -p ./$(SYSTEM)-client/lib/Spong
+       [ -d  ./$(SYSTEM)-client/etc ] || mkdir ./$(SYSTEM)-client/etc
+       [ -d ./$(SYSTEM)-client/bin ] || mkdir ./$(SYSTEM)-client/bin
+       [ -d ./$(SYSTEM)-client/tmp ] || mkdir ./$(SYSTEM)-client/tmp
+
+clientlib:
+       mkdir -p ./$(SYSTEM)-client/lib/Spong
+       for f in $(CLIENT_LIBS) ; do cp ./src/lib/Spong/$$f $(SYSTEM)-client/lib/Spong/; done
+       cp -rp ./src/lib/Spong/Client $(SYSTEM)-client/lib/Spong/
+       chmod 644 $(SYSTEM)-client/lib/Spong/*
+       chmod 755 $(SYSTEM)-client/lib/Spong/Client
+       chown -R $(ADMUSER) ./$(SYSTEM)-client/lib
+       chgrp -R $(ADMGROUP) ./$(SYSTEM)-client/lib
+
+clientbin:     $(SYSTEM)-client/bin/spong-client
+
+$(SYSTEM)-client/bin/%:        ./src/%.pl
+       sed -e "s%@@PERL@@%$(PERL)%g" \
+       -e "s%@@BINDIR@@%$(BINDIR)%g" \
+       -e "s%@@LIBDIR@@%$(LIBDIR)%g" \
+       -e "s%@@ETCDIR@@%$(ETCDIR)%g" \
+       -e "s%@@WWWDIR@@%$(WWWDIR)%g" \
+       $< > $@
+       chmod +x ./$(SYSTEM)-client/bin/*
+       chown $(ADMUSER) ./$(SYSTEM)-client/bin/*
+       chgrp $(ADMGROUP) ./$(SYSTEM)-client/bin/*
+
+clientetc: ./config/spong.conf
+       for f in $(CCONFIGS) ; do cp ./config/$$f $(SYSTEM)-client/etc; done
+       cat ./config/spong.conf.$(SYSTEM) >> ./$(SYSTEM)-client/etc/spong.conf
+       chown -R $(ADMUSER) ./$(SYSTEM)-client/etc
+       chgrp -R $(ADMGROUP) ./$(SYSTEM)-client/etc
+
+client-install:
+
+
+# Server [ much nicer :) ]
+
+cvsclean:
+       find $(BINDIR) $(ETCDIR) $(LIBDIR) $(CGIDIR) $(WWWDIR) \
+       -type d -name CVS -exec rm -rf '{}' \;
+
+# --- daemons ---
+
+bindir:                $(BINDIR) daemons
+
+daemons:       $(DAEMONS)
+
+$(BINDIR):
+       mkdir -p $@
+
+daemons:       $(DAEMONS)
+
+$(BINDIR)/%:   ./src/%.pl
+       sed -e "s%@@PERL@@%$(PERL)%g" \
+       -e "s%@@BINDIR@@%$(BINDIR)%g" \
+       -e "s%@@LIBDIR@@%$(LIBDIR)%g" \
+       -e "s%@@ETCDIR@@%$(ETCDIR)%g" \
+       -e "s%@@WWWDIR@@%$(WWWDIR)%g" \
+       $< > $@
+       chmod -R 755 $(BINDIR)
+       chown -R $(ADMUSER) $(BINDIR)
+       chgrp -R $(ADMGROUP) $(BINDIR)
+
+# --- configs ---
+
+etcdir:                $(ETCDIR) configs etcown
+
+$(ETCDIR):
+       mkdir -p $@
+       chmod 751 $(ETCDIR)
+etcown:
+       chown -R $(ADMUSER) $(ETCDIR)
+       chgrp -R $(ADMGROUP) $(ETCDIR)
+
+configs:       $(CONFIGS)
+
+$(ETCDIR)/spong.conf:  ./config/spong.conf ./config/spong.conf.$(SYSTEM)
+       cat $< > $@.dist
+       cat ./config/spong.conf.$(SYSTEM) >> $@.dist
+       chmod 644 $@.dist
+       [ -f $@ ] || mv $@.dist $@
+       touch $@
+
+$(ETCDIR)/%:   ./config/%
+       cat $< > $@.dist
+       [ -f $@ ] || mv $@.dist $@
+       touch $@
+
+./config/spong.conf:   ./config/spong.conf.in
+       ./utils/mkTarg $< > ./spong.conf.mk
+       $(MAKE) -f ./spong.conf.mk
+       rm -f ./spong.conf.mk
+
+# --- library ---
+
+libdir:                $(LIBDIR) library
+
+$(LIBDIR):
+       mkdir -p $@
+
+library:       $(LIBDIR)/Spong
+
+$(LIBDIR)/Spong:       ./src/lib/Spong
+       cp -rp ./src/lib/Spong $(LIBDIR)/Spong/
+       chmod -R ugo+rwX,go-w $(LIBDIR)/Spong/
+       chown -R $(ADMUSER) $(LIBDIR)
+       chgrp -R $(ADMGROUP) $(LIBDIR)
+
+# --- webpages ---
+
+webdir:                $(WWWDIR) webpages
+
+$(WWWDIR):
+       mkdir -p $@
+       mkdir $@/html
+       chown $(WEBUSER) $@ $@/html
+       chgrp $(WEBGROUP) $@ $@/html
+
+webpages:      $(WEBDIRS) $(WEBPAGES)
+
+# $(WEBDIRS). Must create WEBDIR first and other directories must be
+# Subdirectories.
+$(WWWDIR)/docs:        ./www/docs
+       cp -rp $< $@
+       chmod -R ugo+rwX,go-w $@
+       chown -R $(WEBUSER) $@
+       chgrp -R $(WEBGROUP) $@
+
+$(WWWDIR)/gifs:        ./www/gifs
+       cp -rp $< $@
+       chmod -R ugo+rwX,go-w $@
+       chown -R $(WEBUSER) $@
+       chgrp -R $(WEBGROUP) $@
+
+$(WWWDIR)/html/%:      ./www/html/%
+       sed -e "s%__DIR__%$(DOCROOT)%g" $< > $@
+       chmod ugo+rwX,go-w $@
+       chown $(WEBUSER) $@
+       chgrp $(WEBGROUP) $@
+
+# --- cgiscripts ---
+
+cgidir:                $(CGIDIR) cgiscripts cgiown
+
+$(CGIDIR):
+       mkdir -p $@
+cgiown:
+       chown -R $(ADMUSER) $(CGIDIR)
+       chgrp -R $(ADMGROUP) $(CGIDIR)
+
+cgiscripts:    $(CGISCRIPTS)
+
+$(CGIDIR)/%:   ./src/%.pl
+       sed -e "s%@@PERL@@%$(PERL)%g" \
+       -e "s%@@BINDIR@@%$(BINDIR)%g" \
+       -e "s%@@LIBDIR@@%$(LIBDIR)%g" \
+       -e "s%@@ETCDIR@@%$(ETCDIR)%g" \
+       -e "s%@@WWWDIR@@%$(WWWDIR)%g" \
+       -e "s%@@VER@@%$(SPONGVER)%g" \
+       $< > $@
+       chmod 0755 $@
+       chown $(WEBUSER) $@
+       chgrp $(WEBGROUP) $@
+
+# --- misc install directories ---
+
+tmpdir:        $(TMPDIR)
+
+$(TMPDIR):
+       [ -d $@ ] || mkdir -p $@
+       chmod ugo+rwX,go-w $@
+       chown $(ADMUSER) $@
+       chgrp $(ADMGROUP) $@
+
+vardir:        $(VARDIR) $(VARDIR)/archives $(DBDIR)
+
+$(VARDIR):
+       [ -d $@ ] || mkdir -p $@
+       chmod ugo+rwX,go-w $@
+       chown $(ADMUSER) $@
+       chgrp $(ADMGROUP) $@
+
+$(DBDIR):
+       [ -d $@ ] || mkdir -p $@
+       chmod ugo+rwX,go-w $@
+       chown $(ADMUSER) $@
+       chgrp $(ADMGROUP) $@
+
+$(VARDIR)/archives:
+       [ -d $@ ] || mkdir -p $@
+       chmod ugo+rwX,go-w $@
+       chown $(ADMUSER) $@
+       chgrp $(ADMGROUP) $@
diff --git a/config.mk b/config.mk
new file mode 100644 (file)
index 0000000..ea1d81c
--- /dev/null
+++ b/config.mk
@@ -0,0 +1,41 @@
+# $Id: config.mk,v 1.8 2005/09/13 15:23:09 willamowius Exp $
+#
+# Test include for ./Makefile
+# Rename this "config.mk" for testing.
+#
+#---- Default OS
+SYSTEM=linux
+
+#---- Modifiable Variables from Build Script ------------------
+
+PERL=/usr/bin/perl
+
+PREFIX=/usr/local/spong
+BINDIR=$(PREFIX)/bin
+ETCDIR=$(PREFIX)/etc
+LIBDIR=$(PREFIX)/lib
+TMPDIR=$(PREFIX)/tmp
+VARDIR=$(PREFIX)/var
+
+DBDIR=$(VARDIR)/database
+
+SPONGSERVER=janhh
+
+#WEBDIR=./WEBDIR
+WEBDIR=$(PREFIX)
+WWWDIR=$(WEBDIR)/www
+CGIDIR=$(WEBDIR)/cgi-bin
+# Apache configuration
+DOMAIN=
+SERVER=janhh
+VSERVER=janhh
+ALIASES=spong
+ADMIN=jan@willamowius.de
+
+
+#DOCROOT=/www
+
+WEBUSER=nobody
+WEBGROUP=nobody
+ADMUSER=spong
+ADMGROUP=spong
diff --git a/httpd.in b/httpd.in
new file mode 100644 (file)
index 0000000..422a42e
--- /dev/null
+++ b/httpd.in
@@ -0,0 +1,28 @@
+# NameVirtualHost @@SERVER@@
+
+<VirtualHost @@VSERVER@@>
+   ServerAdmin @@ADMIN@@
+   ServerName @@VSERVER@@
+   ServerAlias @@ALIASES@@
+#   User nobody
+#   Group nobody
+
+   DocumentRoot @@WWWDIR@@
+   ScriptAlias  /cgi/ @@CGIDIR@@
+   DirectoryIndex /cgi/www-spong
+
+   <Directory @@WWWDIR@@>
+      Options Indexes FollowSymLinks
+      <Limit GET POST>
+        allow from all 
+      </Limit>
+   </Directory>
+
+   <Directory @@CGIDIR@@/images>
+      Options None
+      <Limit GET>
+        allow from all 
+      </Limit>
+   </Directory>
+
+</VirtualHost>
diff --git a/spong.mk b/spong.mk
new file mode 100644 (file)
index 0000000..b9cede3
--- /dev/null
+++ b/spong.mk
@@ -0,0 +1,92 @@
+# $Id: spong.mk,v 1.9 2005/09/13 15:23:09 willamowius Exp $
+#
+#
+# Spong version
+
+SPONGVER=2.7.5
+
+#---- Operating system list [ should match ./config/spong.conf.$OS ]
+
+OS=aix bsdi freebsd hpux irix linux osf1 solaris
+
+#---- Arrays from build script
+#
+# I don't think I'm using these at the moment but it still helps to track 
+# spong version differences 
+
+BINLIST= \
+       spong spong-server spong-network spong-client spong-message \
+       spong-ack spong-cleanup spong-status
+
+LIBLIST= \
+       Ack AckList History HistoryList Host HostList Info Service \
+       ServiceList Log Logger
+
+CGILIST= www-spong www-spong-ack wap-spong
+
+#---- New "Arrays"
+
+DAEMONS= \
+       $(BINDIR)/spong-ack \
+       $(BINDIR)/spong-cleanup \
+       $(BINDIR)/spong-client \
+       $(BINDIR)/spong-message \
+       $(BINDIR)/spong-network \
+       $(BINDIR)/spong-server \
+       $(BINDIR)/spong-status \
+       $(BINDIR)/spong
+
+# For client
+# CCONFIGS= spong.conf spong.hosts spong.groups spong.message
+CCONFIGS= spong.conf
+
+CONFIGS= \
+       $(ETCDIR)/spong.conf \
+       $(ETCDIR)/spong.hosts \
+       $(ETCDIR)/spong.groups \
+       $(ETCDIR)/spong.message
+
+# For server, LIBRARY is lib/Spong/
+# For client, LIBRARY is lib/Spong/Client + CLIENT_LIBS in lib/Spong
+
+CLIENT_LIBS=Daemon.pm Status.pm Log.pm Logger.pm SafeExec.pm
+
+WEBDIRS = \
+       $(WWWDIR)/docs \
+       $(WWWDIR)/gifs \
+       $(WWWDIR)/docs
+#
+# This is somewhat ridiculous.  We really only want to munge help.html
+# but:
+#   1. If we install $(WWWDIR)/html then help.html is up-to-date.
+#   2. If we have a target $(WWWDIR)/%: it hides $(WWWDIR)/html/%:
+# Need to talk to Stephen about completely redoing the documentation
+# part of this.
+
+WEBPAGES = \
+       $(WWWDIR)/html/cpu.html \
+       $(WWWDIR)/html/disk.html \
+       $(WWWDIR)/html/dns.html \
+       $(WWWDIR)/html/ftp.html \
+       $(WWWDIR)/html/help.html \
+       $(WWWDIR)/html/history.html \
+       $(WWWDIR)/html/home.html \
+       $(WWWDIR)/html/host.html \
+       $(WWWDIR)/html/http.html \
+       $(WWWDIR)/html/imap.html \
+       $(WWWDIR)/html/jobs.html \
+       $(WWWDIR)/html/lan.html \
+       $(WWWDIR)/html/logs.html \
+       $(WWWDIR)/html/nntp.html \
+       $(WWWDIR)/html/ping.html \
+       $(WWWDIR)/html/pop3.html \
+       $(WWWDIR)/html/procs.html \
+       $(WWWDIR)/html/service.html \
+       $(WWWDIR)/html/smtp.html \
+       $(WWWDIR)/html/unix.html
+
+CGISCRIPTS= \
+       $(CGIDIR)/www-spong \
+       $(CGIDIR)/www-spong-ack \
+       $(CGIDIR)/wap-spong
+