[csw-devel] SF.net SVN: gar:[4694] csw/mgar/pkg/squidclamav/trunk

valholla at users.sourceforge.net valholla at users.sourceforge.net
Tue May 5 20:07:37 CEST 2009


Revision: 4694
          http://gar.svn.sourceforge.net/gar/?rev=4694&view=rev
Author:   valholla
Date:     2009-05-05 18:07:37 +0000 (Tue, 05 May 2009)

Log Message:
-----------
adjusted postinstall

Modified Paths:
--------------
    csw/mgar/pkg/squidclamav/trunk/Makefile
    csw/mgar/pkg/squidclamav/trunk/checksums

Added Paths:
-----------
    csw/mgar/pkg/squidclamav/trunk/files/CSWsquidclamav.postinstall
    csw/mgar/pkg/squidclamav/trunk/files/squidclamav.conf.CSW

Modified: csw/mgar/pkg/squidclamav/trunk/Makefile
===================================================================
--- csw/mgar/pkg/squidclamav/trunk/Makefile	2009-05-05 16:11:47 UTC (rev 4693)
+++ csw/mgar/pkg/squidclamav/trunk/Makefile	2009-05-05 18:07:37 UTC (rev 4694)
@@ -12,12 +12,13 @@
 
 MASTER_SITES = $(SF_MIRRORS)
 DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
+DISTFILES += squidclamav.conf.CSW
+DISTFILES += CSWsquidclamav.postinstall
 
 PACKAGES = CSWsquidclamav
 CATALOGNAME_CSWsquidclamav = squidclamav
 SPKG_DESC_CSWsquidclamav = $(DESCRIPTION)
 
-
 REQUIRED_PKGS_CSWsquidclamav = CSWcurlrt
 
 # We define upstream file regex so we can be notifed of 
@@ -30,4 +31,17 @@
 
 TEST_TARGET = check
 
+EXTRA_DOCFILES = AUTHORS ChangeLog INSTALL NEWS README
+
+post-install-modulated:
+	@ginstall -d $(DESTDIR)$(sysconfdir)
+	@ginstall -d $(DESTDIR)$(docdir)/$(GARNAME)
+	@ginstall -d $(DESTDIR)$(libexecdir)/cgi-bin
+	@cp $(DOWNLOADDIR)/squidclamav.conf.CSW $(DESTDIR)$(sysconfdir)
+	@( for file in $(EXTRA_DOCFILES); do \
+		cp $(abspath $(WORKSRC)/$$file) $(DESTDIR)$(docdir)/$(GARNAME); \
+	done )
+	@cp $(WORKSRC)/clwarn.cgi* $(DESTDIR)$(libexecdir)/cgi-bin
+	@$(MAKECOOKIE)
+
 include gar/category.mk

Modified: csw/mgar/pkg/squidclamav/trunk/checksums
===================================================================
--- csw/mgar/pkg/squidclamav/trunk/checksums	2009-05-05 16:11:47 UTC (rev 4693)
+++ csw/mgar/pkg/squidclamav/trunk/checksums	2009-05-05 18:07:37 UTC (rev 4694)
@@ -1 +1,3 @@
+eec6f1d7c46890ff70ae88f6967736bd  download/CSWsquidclamav.postinstall
 0a5e2fa8a4270a90235621fce9269949  download/squidclamav-4.0.tar.gz
+731fa1fc58327ee9353c9b4c2a8bd404  download/squidclamav.conf.CSW

Added: csw/mgar/pkg/squidclamav/trunk/files/CSWsquidclamav.postinstall
===================================================================
--- csw/mgar/pkg/squidclamav/trunk/files/CSWsquidclamav.postinstall	                        (rev 0)
+++ csw/mgar/pkg/squidclamav/trunk/files/CSWsquidclamav.postinstall	2009-05-05 18:07:37 UTC (rev 4694)
@@ -0,0 +1,60 @@
+#!/bin/sh
+
+PATH=/usr/bin:/usr/sbin
+umask 0022
+
+CSW_PREFIX=${PKG_INSTALL_ROOT}/opt/csw
+SQUID_CONFDIR=${CSW_PREFIX}/etc
+SQUID_DOCDIR=${CSW_PREFIX}/share/doc
+SQUID_VARDIR=${CSW_PREFIX}/var
+SQUID_SBINDIR=${CSW_PREFIX}/sbin
+USER=''
+GRP=''
+SQUID_PORT=''
+
+if [ -f ${SQUID_CONFDIR}/squid.conf ]; then
+    USER="`awk '$1  ~ /cache_effective_user/ {print $2}' \
+            ${SQUID_CONFDIR}/squid.conf`"
+    GRP="`awk '$1 ~ /cache_effective_group/ {print $2}' \
+            ${SQUID_CONFDIR}/squid.conf`"
+    SQUID_PORT="`awk '$1 ~ /http_port/ {print $2}' \
+            ${SQUID_CONFDIR}/squid.conf`"
+fi
+
+if [ "_x${USER}x_" = "_xx_" ]; then
+    USER=nobody
+fi
+if [ "_x${GRP}x_" = "_xx_" ]; then
+    GRP=nobody
+fi
+if [ "_x${SQUID_PORT}x_" = "_xx_" ]; then
+    SQUID_PORT=3128
+fi
+
+perl -i -pe "s|_SQUIDPORT_|${SQUID_PORT}|" ${SQUID_CONFDIR}/squidclamav.conf.CSW
+
+if [ -f ${SQUID_CONFDIR}/squidclamav.conf ]; then
+    echo 'Found:squidclamav.conf, Preserving Existing Config'
+else
+    echo 'Creating squidclamav.conf'
+    cp ${SQUID_CONFDIR}/squidclamav.conf.CSW ${SQUID_CONFDIR}/squidclamav.conf
+    chmod 0644 ${SQUID_CONFDIR}/squidclamav.conf
+fi
+
+touch ${SQUID_VARDIR}/logs/squidclamav.log
+chown ${USER}:${GRP} ${SQUID_VARDIR}/logs/squidclamav.log
+
+cat << _EOF_
+******************************************************************************
+*   NOTICE:
+*       Please be sure to configure squidclamav
+*   Configuration File Location:
+*       ${SQUID_CONFDIR}/squidclamav.conf
+*
+*   Details on Configuration can be found in
+*       ${SQUID_DOCDIR}/squidclamav/README
+*
+******************************************************************************
+_EOF_
+
+exit 0

Added: csw/mgar/pkg/squidclamav/trunk/files/squidclamav.conf.CSW
===================================================================
--- csw/mgar/pkg/squidclamav/trunk/files/squidclamav.conf.CSW	                        (rev 0)
+++ csw/mgar/pkg/squidclamav/trunk/files/squidclamav.conf.CSW	2009-05-05 18:07:37 UTC (rev 4694)
@@ -0,0 +1,100 @@
+# squidclamav.conf.dist
+#
+# Lines have the form:
+#
+# 	regex|regexi pattern
+#
+# 	abort|aborti pattern
+#
+#	content|contenti pattern
+#
+#	abortcontent|abortcontenti pattern
+#
+#	redirect cgi_redirect_url
+# 
+#       logfile /path/to/log_file
+# 
+#       proxy none
+# 
+#       squid_ip 127.0.0.1
+#
+#       squid_port 3128
+#
+#       debug 0|1
+# 
+#	force 0|1
+#
+#       timeout secondes
+#
+#       clamd_ip 127.0.0.1
+#
+#       clamd_port 3310
+#
+#       clamd_local /tmp/clamd
+#
+#	stat 0|1
+#
+#	maxredir 10
+#
+#	squidguard /usr/local/squidGuard/bin/squidGuard
+#
+#	whitelist this.trustdomain.com
+#	whitelist .*\.domain\.*
+#
+#	useragent String_to_modify_curl_user_agent
+#
+#	trust_cache 0|1
+#
+# Note that the ordering of regex|abort|content|abortcontent|whitelist lines
+# in this file is critical. Some pattern can not be reached if a previous
+# pattern match.
+#
+#
+# Examples of valid lines:
+#
+#squid_ip 127.0.0.1
+#squid_port 3128
+#logfile /var/log/squidclamav.log
+#redirect http://proxy.domain.com/cgi-bin/clwarn.cgi
+#squidguard /usr/local/squidGuard/bin/squidGuard
+#debug 0
+#force 1
+#stat 1
+#maxredir 10
+#clamd_local /tmp/clamd
+#clamd_ip 192.168.1.5
+#clamd_port 3310
+#timeout 60
+#useragent Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)
+#trust_cache 0
+#
+#abort ^.*\.pdf$
+#abort ^.*\.js$
+#abort ^.*\.html$
+#abort ^.*\.css$
+#abort ^.*\.xml$
+#abort ^.*\.xsl$
+#abort ^.*\.js$
+#abort ^.*\.html$
+#abort ^.*\.css$
+#abort ^.*\.xml$
+#abort ^.*\.xsl$
+#abort ^.*\.js$
+#abort ^.*\.jsp$
+#abort ^.*\.jsp\?.*$
+#aborti ^.*servlet.*$
+#abort ^.*\.ico$
+#aborti ^.*\.gif$
+#aborti ^.*\.png$
+#aborti ^.*\.jpg$
+#aborti ^.*\.swf$
+#abortcontenti ^.*application\/x-mms-framed.*$
+#abortcontenti ^.*application\/x-javascript.*$
+#content ^.*application\/.*$
+#whitelist www.eicar.org
+
+squid_port _SQUIDPORT_
+logfile /var/log/squidclamav.log
+
+# Scan all files
+content ^.*\/.*$


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