[csw-devel] SF.net SVN: gar:[2270] csw/trunk/server/amavisd-new

idogan23 at users.sourceforge.net idogan23 at users.sourceforge.net
Tue Nov 11 16:38:53 CET 2008


Revision: 2270
          http://gar.svn.sourceforge.net/gar/?rev=2270&view=rev
Author:   idogan23
Date:     2008-11-11 15:38:52 +0000 (Tue, 11 Nov 2008)

Log Message:
-----------
amavisd-new: finished custom-install, added postinstall, preinstall, init script with cswclassutils, depend file

Modified Paths:
--------------
    csw/trunk/server/amavisd-new/Makefile
    csw/trunk/server/amavisd-new/checksums

Added Paths:
-----------
    csw/trunk/server/amavisd-new/files/CSWamavisdnew.depend
    csw/trunk/server/amavisd-new/files/CSWamavisdnew.gspec
    csw/trunk/server/amavisd-new/files/CSWamavisdnew.postinstall
    csw/trunk/server/amavisd-new/files/CSWamavisdnew.preinstall
    csw/trunk/server/amavisd-new/files/cswamavisdnew

Modified: csw/trunk/server/amavisd-new/Makefile
===================================================================
--- csw/trunk/server/amavisd-new/Makefile	2008-11-11 09:40:13 UTC (rev 2269)
+++ csw/trunk/server/amavisd-new/Makefile	2008-11-11 15:38:52 UTC (rev 2270)
@@ -9,7 +9,7 @@
 
 MASTER_SITES = http://www.ijs.si/software/amavisd/#download
 DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
-DISTFILES += $(call admfiles,CSWpackage,)
+DISTFILES += $(call admfiles,CSWamavisdnew, depend postinstall preinstall)
 
 PATCHFILES += amavisd-agent.diff
 PATCHFILES += amavisd-nanny.diff
@@ -23,12 +23,25 @@
 TEST_SCRIPTS =
 INSTALL_SCRIPTS = custom
 
-AMAVIS_BINS=amavisd amavisd-agent amavisd-nanny amavisd-release p0f-analyzer.pl
+AMAVISBIN=amavisd-agent amavisd-nanny amavisd-release p0f-analyzer.pl
+AMAVISSBIN=amavisd-new
+AMAVISDOC=LDAP.schema README_FILES RELEASE_NOTES AAAREADME.first \
+          amavisd.conf-default amavisd.conf-sample
+AMAVISETC=amavisd-new.conf.CSW
 
 install-custom:
-	@echo " ==> Installing $(GARNAME)"
-	@ginstall -d $(DESTDIR)$(prefix)/bin
-	cp -r $(WORKSRC)/$(AMAVIS_BINS $(DESTDIR)
-	@$(MAKECOOKIE)
+	echo " ==> Installing $(GARNAME)"
+	ginstall -d $(DESTDIR)$(prefix)/bin
+	ginstall -d $(DESTDIR)$(prefix)/sbin
+	ginstall -d $(DESTDIR)$(prefix)/share/doc/amavisd-new
+	cd $(WORKSRC); \
+	mv amavisd amavisd-new; \
+	mv amavisd.conf amavisd-new.conf.CSW; \
+	cp $(AMAVISBIN) $(DESTDIR)$(prefix)/bin; \
+	cp $(AMAVISSBIN) $(DESTDIR)$(prefix)/sbin; \
+	cp -r $(AMAVISDOC) $(DESTDIR)$(prefix)/share/doc/amavisd-new
+	ginstall -d $(DESTDIR)/etc/opt/csw/init.d
+	ginstall -m 755 files/cswamavisdnew $(DESTDIR)/etc/opt/csw/init.d/cswamavisdnew
+	$(MAKECOOKIE)
 
 include ../category.mk

Modified: csw/trunk/server/amavisd-new/checksums
===================================================================
--- csw/trunk/server/amavisd-new/checksums	2008-11-11 09:40:13 UTC (rev 2269)
+++ csw/trunk/server/amavisd-new/checksums	2008-11-11 15:38:52 UTC (rev 2270)
@@ -1,5 +1,8 @@
 71761c55054095279bda559177682164  download/amavisd-new-2.6.0.tar.gz
-b1eb9cb153f91c1e3637dee42b84b7f5  download/CSWpackage.gspec
+e7621438f0fda006fa7e27a303321dc6  download/CSWamavisdnew.gspec
+8691b60b244d18b35e1f83396e60b015  download/CSWamavisdnew.depend
+65f66fb3036b7949057733aa99cff724  download/CSWamavisdnew.postinstall
+171767585ab6662c0cbedae26e9baa2c  download/CSWamavisdnew.preinstall
 06abbedc006af9fc3de5d2a0906ae106  download/amavisd-agent.diff
 009c78f04e602536ce0ba4573ab805e1  download/amavisd-nanny.diff
 f218d10e5280940268a3ffaa125a00ae  download/amavisd-release.diff

Added: csw/trunk/server/amavisd-new/files/CSWamavisdnew.depend
===================================================================
--- csw/trunk/server/amavisd-new/files/CSWamavisdnew.depend	                        (rev 0)
+++ csw/trunk/server/amavisd-new/files/CSWamavisdnew.depend	2008-11-11 15:38:52 UTC (rev 2270)
@@ -0,0 +1,14 @@
+P       CSWperl
+P	CSWcswclassutils
+P       CSWpmunixsyslog
+P       CSWpmiostringy
+P       CSWpmnetserver
+P       CSWpmmailtools
+P       CSWpmmimetools
+P       CSWpmcompresszlib
+P       CSWpmarchivetar
+P       CSWpmarchivezip
+P       CSWspamassassin
+P       CSWpmberkeleydb
+P       CSWpmconverttnef
+P       CSWpmconvertuulib

Added: csw/trunk/server/amavisd-new/files/CSWamavisdnew.gspec
===================================================================
--- csw/trunk/server/amavisd-new/files/CSWamavisdnew.gspec	                        (rev 0)
+++ csw/trunk/server/amavisd-new/files/CSWamavisdnew.gspec	2008-11-11 15:38:52 UTC (rev 2270)
@@ -0,0 +1,6 @@
+%var            bitname amavisd_new
+%var            pkgname CSWamavisdnew
+%include        url file://%{PKGLIB}/csw_dyndepend.gspec
+%copyright      url file://%{WORKSRC}/LICENSE
+%var		spkg_classes none cswinitsmf
+%var		arch all

Added: csw/trunk/server/amavisd-new/files/CSWamavisdnew.postinstall
===================================================================
--- csw/trunk/server/amavisd-new/files/CSWamavisdnew.postinstall	                        (rev 0)
+++ csw/trunk/server/amavisd-new/files/CSWamavisdnew.postinstall	2008-11-11 15:38:52 UTC (rev 2270)
@@ -0,0 +1,45 @@
+# Build log file name
+installlog=${BASEDIR}/opt/csw/var/amavisn/install-`date '+%Y%m%d%H%M%S'`
+
+# copy new config file, if it's not existing
+if [ ! -f $BASEDIR/opt/csw/etc/amavisd-new.conf ] ; then
+        cp -p $BASEDIR/opt/csw/etc/amavisd-new.conf.CSW $BASEDIR/opt/csw/etc/amavisd-new.conf
+fi
+
+
+# Upgrade and verify bdb database files for amavis.
+DB_HOME=${BASEDIR}/opt/csw/var/amavisn/db
+
+if [ -f ${BASEDIR}$DB_HOME/*.db ] ; then
+        cd ${BASEDIR}$DB_HOME
+
+        # Verify each file before upgrading
+        echo "Running db_verify (before upgrade) on $DB_HOME" >>$installlog
+        for each_db in `ls *.db`
+        do
+          #chroot $PKG_ROOT_DIR /opt/csw/bdb4/bin/db_verify -h $DB_HOME -o $each_db >>$installlog 2>&1
+          ${BASEDIR}/opt/csw/bdb44/bin/db_verify -h $DB_HOME -o $each_db >>$installlog 2>&1
+        done
+
+        # Update the database environment to the new value
+        echo "Running db_recover on $DB_HOME" >>$installlog
+        #chroot $PKG_ROOT_DIR /opt/csw/bdb4/bin/db_recover -h $DB_HOME >>$installlog 2>&1
+        ${BASEDIR}/opt/csw/bdb44/bin/db_recover -h $DB_HOME >>$installlog 2>&1
+
+        # Upgrade each file.  This does nothing if no upgrade is needed.
+        echo "Running db_upgrade on $DB_HOME" >>$installlog
+        for each_db in `ls *.db`
+        do
+          #chroot $PKG_ROOT_DIR /opt/csw/bdb4/bin/db_upgrade -h $DB_HOME $each_db >>$installlog 2>&1
+          ${BASEDIR}/opt/csw/bdb44/bin/db_upgrade -h $DB_HOME $each_db >>$installlog 2>&1
+        done
+
+        # Verify each file
+        echo "Running db_verify (after upgrade) on $DB_HOME" >>$installlog
+        for each_db in `ls *.db`
+        do
+          #chroot $PKG_ROOT_DIR /opt/csw/bdb4/bin/db_verify -h $DB_HOME -o $each_db >>$installlog 2>&1
+          ${BASEDIR}/opt/csw/bdb44/bin/db_verify -h $DB_HOME -o $each_db >>$installlog 2>&1
+        done
+fi
+

Added: csw/trunk/server/amavisd-new/files/CSWamavisdnew.preinstall
===================================================================
--- csw/trunk/server/amavisd-new/files/CSWamavisdnew.preinstall	                        (rev 0)
+++ csw/trunk/server/amavisd-new/files/CSWamavisdnew.preinstall	2008-11-11 15:38:52 UTC (rev 2270)
@@ -0,0 +1,46 @@
+#!/bin/sh
+
+# check, if the amavisn group does exist
+grep '^amavisn:' $PKG_ROOT_DIR/etc/group >/dev/null
+if [ $? -ne 0 ] ; then
+        getent passwd amavisn >/dev/null
+        if [ $? -ne 0 ] ; then
+                NEEDGROUP=1
+        fi
+fi
+
+# check, if the amavisn user does exist
+grep '^amavisn:' $PKG_ROOT_DIR/etc/passwd >/dev/null
+if [ $? -ne 0 ] ; then
+        getent passwd amavisn >/dev/null
+        if [ $? -ne 0 ] ; then
+                NEEDUSER=1
+        fi
+fi
+
+# create hte amavisn group, if NEEDGROUP=1
+if [ "$NEEDGROUP" = 1 ] ; then
+        echo Adding required amavisn group
+        /usr/sbin/groupadd amavisn
+fi
+
+# create the amavisn user, if NEEDUSER=1
+if [ "$NEEDUSER" = 1 ] ; then
+        echo Adding required amavisn user
+
+        # create necessary directories
+        mkdir -p /opt/csw/var/amavisn/tmp /opt/csw/var/amavisn/var /opt/csw/var/amavisn/db
+
+        # create the amavis user
+        /usr/sbin/useradd -d /opt/csw/var/amavisn -g amavisn -c 'amavisn pseud user' -s /bin/false amavisn
+
+        # change ownership & permissions
+        chown -R amavisn:amavisn /opt/csw/var/amavisn
+        chmod -R 750 /opt/csw/var/amavisn
+
+        # create a quarantine area for virus mails, set perm & owner
+        mkdir /opt/csw/var/amavisn-quarantine
+        chown amavisn:amavisn /opt/csw/var/amavisn-quarantine
+        chmod 750 /opt/csw/var/amavisn-quarantine
+fi
+

Added: csw/trunk/server/amavisd-new/files/cswamavisdnew
===================================================================
--- csw/trunk/server/amavisd-new/files/cswamavisdnew	                        (rev 0)
+++ csw/trunk/server/amavisd-new/files/cswamavisdnew	2008-11-11 15:38:52 UTC (rev 2270)
@@ -0,0 +1,20 @@
+#!/sbin/sh
+
+AMAVIS=/opt/csw/sbin/amavisd-new
+
+case $1 in 
+'start')
+        $AMAVIS start
+        ;;
+'stop')
+	$AMAVIS stop
+        ;;
+'reload')
+	$AMAVIS reload
+        ;;
+*)
+
+       echo "Usage: $0 { start | stop | reload }"
+       exit 1
+        ;;
+esac    


Property changes on: csw/trunk/server/amavisd-new/files/cswamavisdnew
___________________________________________________________________
Added: svn:executable
   + *


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list