[csw-devel] SF.net SVN: gar:[17002] csw/mgar/pkg/spamass-milter/trunk

guengel at users.sourceforge.net guengel at users.sourceforge.net
Sun Feb 5 15:21:25 CET 2012


Revision: 17002
          http://gar.svn.sourceforge.net/gar/?rev=17002&view=rev
Author:   guengel
Date:     2012-02-05 14:21:24 +0000 (Sun, 05 Feb 2012)
Log Message:
-----------
spamass-milter/trunk: Added patch to make it compile on solaris. Startup script and startup script config added. Minimalistic README.CSW and changelog.CSW added.

Modified Paths:
--------------
    csw/mgar/pkg/spamass-milter/trunk/Makefile

Added Paths:
-----------
    csw/mgar/pkg/spamass-milter/trunk/files/0000-Workaround-for-missing-paths.h.patch
    csw/mgar/pkg/spamass-milter/trunk/files/README.CSW
    csw/mgar/pkg/spamass-milter/trunk/files/changelog.CSW
    csw/mgar/pkg/spamass-milter/trunk/files/cswspamass-milter
    csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter.CSW

Property Changed:
----------------
    csw/mgar/pkg/spamass-milter/trunk/Makefile

Modified: csw/mgar/pkg/spamass-milter/trunk/Makefile
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/Makefile	2012-02-05 13:35:54 UTC (rev 17001)
+++ csw/mgar/pkg/spamass-milter/trunk/Makefile	2012-02-05 14:21:24 UTC (rev 17002)
@@ -10,28 +10,46 @@
 
 MASTER_SITES = http://download.savannah.gnu.org/releases/spamass-milt/
 DISTFILES  = $(NAME)-$(VERSION).tar.gz
-DISTFILES += COPYING
+DISTFILES += cswspamass-milter
+DISTFILES += spamass-milter.CSW
+DISTFILES += README.CSW
+DISTFILES += changelog.CSW
 
+PATCHFILES  = 0000-Workaround-for-missing-paths.h.patch
+
+INITSMF = $(sysconfdir)/init.d/cswspamass-milter
+PRESERVECONF = $(sysconfdir)/spamass-milter
+
 PACKAGES = CSWspamass-milter
 CATALOGNAME = spamass_milter
 RUNTIME_DEP_PKGS = CSWspamassassin
 
+BUILD_DEP_PKGS  = CSWspamassassin
+BUILD_DEP_PKGS += CSWsendmail
+BUILD_DEP_PKGS += CSWlibmilter
+
 # We define upstream file regex so we can be notifed of new upstream software release
 UFILES_REGEX = $(NAME)-(\d+(?:\.\d+)*).tar.gz
 
-TEST_SCRIPTS = 
-INSTALL_SCRIPTS = custom
+SENDMAIL = $(libdir)/sendmail
 
+EXTRA_CONFIGURE_ENV = SENDMAIL=$(SENDMAIL)
+
 CONFIGURE_ARGS = $(DIRPATHS)
 
 include gar/category.mk
 
-DOCLIST = AUTHORS Changelog NEWS README TODO
+DOCLIST = AUTHORS ChangeLog NEWS README TODO
 
-install-custom:
+post-merge-modulated:
 	@echo " ==> Installing $(NAME) (custom)"
-	@( cd $(WORKSRC) ; \
-	  gmake DESTDIR=$(DESTDIR) install )
-	@ginstall -m 755 -d $(DESTDIR)$(docdir)/$(NAME)
-	@$(foreach DOC,$(DOCLIST),ginstall -m 444 $(WORKSRC)/$(DOC) $(DESTDIR)$(docdir)/$(NAME);)
+	@ginstall -m 755 -d $(PKGROOT)$(docdir)/$(NAME)
+	@$(foreach DOC,$(DOCLIST),ginstall -m 444 $(WORKSRC)/$(DOC) $(PKGROOT)$(docdir)/$(NAME);)
 	@$(MAKECOOKIE)
+
+post-merge:
+	@echo " ==> Installing startup script"
+	@ginstall -m 755 -d $(PKGROOT)$(sysconfdir)/init.d
+	@ginstall -m 755 $(FILEDIR)/cswspamass-milter $(PKGROOT)$(sysconfdir)/init.d/
+	@ginstall -m 755 $(FILEDIR)/spamass-milter.CSW $(PKGROOT)$(sysconfdir)/
+	@$(MAKECOOKIE)


Property changes on: csw/mgar/pkg/spamass-milter/trunk/Makefile
___________________________________________________________________
Added: svn:keywords
   + Id

Added: csw/mgar/pkg/spamass-milter/trunk/files/0000-Workaround-for-missing-paths.h.patch
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/files/0000-Workaround-for-missing-paths.h.patch	                        (rev 0)
+++ csw/mgar/pkg/spamass-milter/trunk/files/0000-Workaround-for-missing-paths.h.patch	2012-02-05 14:21:24 UTC (rev 17002)
@@ -0,0 +1,28 @@
+From 76a4a08fce40dab85084d56686e34b37e3b70ffd Mon Sep 17 00:00:00 2001
+From: Rafael Ostertag <rafi at opencsw.org>
+Date: Sun, 5 Feb 2012 12:01:08 +0100
+Subject: [PATCH] Workaround for missing paths.h
+
+---
+ daemon.c |    4 ++++
+ 1 files changed, 4 insertions(+), 0 deletions(-)
+
+diff --git a/daemon.c b/daemon.c
+index dd54571..d1245f6 100644
+--- a/daemon.c
++++ b/daemon.c
+@@ -39,7 +39,11 @@ static char sccsid[] = "@(#)daemon.c	8.1 (Berkeley) 6/4/93";
+ /* $Id: daemon.c,v 1.1 2003/10/21 21:40:32 dnelson Exp $ */
+ 
+ #include <fcntl.h>
++#ifndef __sun
+ #include <paths.h>
++#else
++#define _PATH_DEVNULL "/dev/null"
++#endif
+ #include <unistd.h>
+ 
+ int
+-- 
+1.7.9
+

Added: csw/mgar/pkg/spamass-milter/trunk/files/README.CSW
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/files/README.CSW	                        (rev 0)
+++ csw/mgar/pkg/spamass-milter/trunk/files/README.CSW	2012-02-05 14:21:24 UTC (rev 17002)
@@ -0,0 +1,10 @@
+spamass-milter README.CSW
+=========================
+
+You can customize spamass-milter startup options by editing
+/etc/opt/csw/spamass-milter. Please see /etc/opt/csw/spamass-milter.CSW for
+more information.
+
+Site wide configuration can be put into
+/opt/csw/etc/spamass-milter. Configuration in /etc/opt/csw/spamass-milter takes
+precedence over /opt/csw/etc/spamass-milter, though.

Added: csw/mgar/pkg/spamass-milter/trunk/files/changelog.CSW
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/files/changelog.CSW	                        (rev 0)
+++ csw/mgar/pkg/spamass-milter/trunk/files/changelog.CSW	2012-02-05 14:21:24 UTC (rev 17002)
@@ -0,0 +1,7 @@
+spamass-milter (0.3.2,REV=2012.02.05)
+
+  * New upstream release 0.3.2
+
+  * Added startup script and configuration file for startup script
+
+ -- Rafael Ostertag <raos at opencsw.org>  Sun, 05 Feb 2012 15:10:36 +0100

Added: csw/mgar/pkg/spamass-milter/trunk/files/cswspamass-milter
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/files/cswspamass-milter	                        (rev 0)
+++ csw/mgar/pkg/spamass-milter/trunk/files/cswspamass-milter	2012-02-05 14:21:24 UTC (rev 17002)
@@ -0,0 +1,243 @@
+#!/sbin/sh
+#RC_KNUM 20         # Number used for kill script symlink, e.g. K20cswfoo
+#RC_SNUM 80         # Number used for start script symlink, e.g. S80cswfoo
+#RC_KLEV 0,1,2,S    # Run levels that should have a kill script symlink
+#RC_SLEV 3          # Run levels that should have a start script symlink
+#FMRI network       # FMRI path for service (S10+), default is /network.
+#                     Changing the value here, yields a generated FMRI of
+#                     "svc:/somethingelse/cswfoo:default"
+#AUTOENABLE no     # If set to no will not enable service regardless of
+#                     local csw.conf, use when a package needs setup before
+#                     being useful, would otherwise leave service in
+#                     maintenance mode
+#
+# /etc/init.d/ sample script for Solaris
+# Modified for CSW
+# $Id$
+
+# The defaults. They can be overwritten by /opt/csw/etc/spamass-milter
+# or /etc/opt/csw/spamass-milter. The latter takes precedence over the
+# former.
+SPAMASS_SOCK=/var/run/spamass.sock
+SPAMASS_PID=/var/opt/csw/run/spamass-milter.pid
+DONTMODIFY=ignore
+MAILADDR_EXPANSION=no
+PREFIX=/opt/csw
+
+if [ -n "${SMF_FMRI}" ]
+then
+    . /lib/svc/share/smf_include.sh
+fi
+
+warning() {
+    if [ -n "${SMF_FMRI}" ]
+    then
+	/usr/bin/logger -p daemon.warning "$@"
+    else
+	echo "WARNING: $@"
+    fi
+    return 0
+}
+
+error() {
+    if [ -n "${SMF_FMRI}" ]
+    then
+	/usr/bin/logger -p daemon.error "$@"
+    else
+	echo "ERROR: $@"
+    fi
+    return 0
+}
+
+start() {
+    if [ -f "${SPAMASS_PID}" ]
+    then
+	kill -0 "`cat ${SPAMASS_PID}`"
+	if [ $? -eq 0 ]
+	then
+	    warning "spamass-milter already running with pid `cat ${SPAMASS_PID}`"
+	    exit 0
+	else
+	    warning "Removing stale pid file ${SPAMASS_PID}"
+	    rm -f "${SPAMASS_PID}"
+	fi
+    fi
+    rm -f "${SPAMASS_SOCK}" > /dev/null 2>&1
+    if [ ! -n "${SMF_FMRI}" ]
+    then
+	printf "%-60s" "Starting spamass-milter: "
+    fi
+    ${PREFIX}/sbin/spamass-milter ${BASE_ARGS} ${ARGS}
+    RETVAL=$?
+    if [ ${RETVAL} -eq 0 ] ; then
+	if [ ! -n "${SMF_FMRI}" ]
+	then
+	    echo "[  OK  ]"
+	fi
+    else
+	if [ -n "${SMF_FMRI}" ]
+	then
+	    exit ${SMF_EXIT_MON_OFFLINE}
+	fi
+	echo "[FAILED]"
+	exit 1
+
+    fi
+    if [ ! -f "${SPAMASS_PID}" ]
+    then
+	warning "PID File ${SPAMASS_PID} not existent after launch."
+	if [ -n "${SMF_FMRI}" ]
+	then
+	    exit ${SMF_EXIT_MON_DEGRADE}
+	fi
+	exit 2
+    fi
+    return 0
+}
+
+stop() {
+    if [ ! -f "${SPAMASS_PID}" ]
+    then
+	warning "${SPAMASS_PID} not found. Assuming daemon not running"
+	return 0
+    fi
+
+    kill -0 "`cat ${SPAMASS_PID}`"
+    if [ $? -ne 0 ]
+    then
+	warning "spamass-milter not running. Nothing to stop."
+	return 0
+    fi
+
+    if [ ! -n "${SMF_FMRI}" ]
+    then
+	printf "%-60s" "Shutting down spamass-milter: "
+    fi
+    kill "`cat ${SPAMASS_PID}`"
+    RETVAL=$?
+    if [ ${RETVAL} -eq 0 ] ; then
+	if [ ! -n "${SMF_FMRI}" ]
+	then
+	    echo "[  OK  ]"
+	fi
+    else
+	if [ ! -n "${SMF_FMRI}" ]
+	then
+	    echo "[FAILED]"
+	    exit 3
+	fi
+	error "Error while terminating spamass-milter"
+	exit ${SMF_EXIT_ERR_FATAL}
+    fi
+    return 0
+}
+
+if [ ! -x "${PREFIX}/sbin/spamass-milter" ]
+then
+    error "${PREFIX}/sbin/spamass-milter does not exist or not executable."
+    if [ -n "${SMF_FMRI}" ]
+    then
+	exit ${SMF_EXIT_ERR_FATAL}
+    fi
+
+    exit 1
+fi
+
+
+# Source config files
+if [ -f /opt/csw/etc/spamass-milter ]
+then
+    . /opt/csw/etc/spamass-milter
+fi
+if [ -f /etc/opt/csw/spamass-milter ]
+then
+    . /etc/opt/csw/spamass-milter
+fi
+
+BASE_ARGS="-f -p ${SPAMASS_SOCK} -P ${SPAMASS_PID}"
+ARGS=""
+
+# Assemble arguments for spamass-milter. SPAMASS_SOCK and SPAMASS_PID
+# are already taken care of in BASE_ARGS.
+if [ -n "${BUCKET}" ]
+then
+    ARGS="${ARGS} -b ${BUCKET}"
+fi
+if [ -n "${BUCKET_BCC}" ]
+then
+    if [ -n "${BUCKET}" ]
+    then
+	warning "BUCKET already set. Ignoring BUCKET_BCC"
+    else
+	ARGS="${ARGS} -B ${BUCKET_BCC}"
+    fi
+fi
+if [ -n "${DEFAULTDOMAIN}" ]
+then
+    ARGS="${ARGS} -e ${DEFAULTDOMAIN}"
+fi
+if [ -n "${IGNORE}" ]
+then
+    ARGS="${ARGS} -i ${IGNORE}"
+fi
+if [ -n "${DONTMODIFY}" ]
+then
+    case "${DONTMODIFY}" in
+	'any')
+	    ARGS="${ARGS} -M"
+	    ;;
+	'some')
+	    ARGS="${ARGS} -m"
+	    ;;
+	'ignore')
+	    :
+	    ;;
+	*)
+	    warning "${DONTMODIFY} is not a valid value for DONTMODIFY. Assuming 'ignore'."
+	    ;;
+    esac
+fi
+if [ -n "${REJECT}" ]
+then
+    ARGS="${ARGS} -r ${REJECT}"
+fi
+if [ -n "${DEFAULTUSER}" ]
+then
+    ARGS="${ARGS} -u ${DEFAULTUSER}"
+fi
+if [ -n "${MAILADDR_EXPANSION}" ]
+then
+    case "${MAILADDR_EXPANSION}" in
+	'yes')
+	    ARGS="${ARGS} -x"
+	    ;;
+	'no')
+	    :
+	    ;;
+	*)
+	    warning "${MAILADDR_EXPANSION} is not a valid value for MAILADDR_EXPANSION. Assuming 'no'."
+	    ;;
+    esac
+fi
+if [ -n "${SPAMC_FLAGS}" ]
+then
+    ARGS="${ARGS} -- ${SPAMC_FLAGS}"
+fi
+
+case "$1" in
+    start)
+	start
+	;;
+    stop)
+	stop
+	;;
+    restart)
+	stop
+	start
+	;;
+*)
+	echo "Usage: `basename $0` {start|stop|restart}" >&2
+	;;
+esac
+
+exit 0


Property changes on: csw/mgar/pkg/spamass-milter/trunk/files/cswspamass-milter
___________________________________________________________________
Added: svn:keywords
   + Id

Added: csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter.CSW
===================================================================
--- csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter.CSW	                        (rev 0)
+++ csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter.CSW	2012-02-05 14:21:24 UTC (rev 17002)
@@ -0,0 +1,97 @@
+# This is a shell script fragment. It will be sourced by
+# /etc/opt/csw/init.d/cswspamass-milter.
+#
+# Use this file to pass flags to spamass-milter during startup.
+#
+# $Id$
+
+# path to create socket.
+#
+# Equivalent to: -p
+#
+# Default: /var/run/spamass.sock
+#SPAMASS_SOCK=/var/run/spamass.sock
+
+# Redirect spam to this mail address.  The orignal recipient(s) will
+# not receive anything.
+#
+# BUCKET and BUCKET_BCC are mutually exclusive.
+#
+# Equivalent to: -b
+#
+# Default: none
+#BUCKET=
+
+# add this mail address as a BCC recipient of spam.
+#
+# Equivalent to: -B
+#
+# BUCKET and BUCKET_BCC are mutually exclusive.
+#
+# Default: none
+#BUCKET_BCC=
+
+# Pass full email address to spamc instead of just username.  Uses
+# 'defaultdomain' if there was none.
+#
+# Equivalent to: -e
+#
+# Default: none
+#DEFAULTDOMAIN=
+
+# skip (ignore) checks from these IPs or netblocks. Example:
+#
+#  192.168.12.5,10.0.0.0/8,172.16.0.0/255.255.0.0
+#
+# Equivalent to: -i
+#
+# Default: none
+#IGNORE=
+
+# Values: any,some,ignore
+# 
+# any: don't modify the message at all (-M)
+#
+# some: don't modify body, Content-type: or Subject: (-m)
+#
+# ignore: ignore this flag, and use default behavior of spamass-milter
+#
+# Default: ignore
+#DONTMODIFY=ignore
+
+# pidfile: Put processid in pidfile
+#
+# Equivalent to: -P
+#
+# Default: /var/opt/csw/run/spamass-milter.pid
+#SPAMASS_PID=/var/opt/csw/run/spamass-milter.pid
+
+# reject messages with a score >= nn with an SMTP error. Use -1 to
+# reject any messages tagged by SA.
+#
+# Equivalent to: -r
+#
+# Default: none
+#REJECT=5
+
+# pass the recipient's username to spamc. Uses 'defaultuser' if there
+# are multiple recipients.
+#
+# Equivalent to: -u
+#
+# Default: none
+#DEFAULTUSER=
+
+# pass email address through alias and virtusertable expansion.
+#
+# Values: yes,no (yes: -x)
+#
+# Default: no
+#MAILADDR_EXPANSION=no
+
+# Pass flags to spamc.
+#
+# Equivalent to: --
+#
+# Default: none
+#SPAMC_FLAGS=
\ No newline at end of file


Property changes on: csw/mgar/pkg/spamass-milter/trunk/files/spamass-milter.CSW
___________________________________________________________________
Added: svn:keywords
   + Id

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