Hi,
some work on this port:
- add an rc script
- remove wget dependency
- install some more docs
- install and use DBIx::DBCluster if dbcluster=on in sqlgrey.conf

 Comments ? Ok ?
  Cheers
   Giovanni
Index: Makefile
===================================================================
RCS file: /cvs/ports/mail/sqlgrey/Makefile,v
retrieving revision 1.6
diff -u -p -u -p -r1.6 Makefile
--- Makefile	11 Oct 2013 23:50:01 -0000	1.6
+++ Makefile	28 May 2014 23:09:47 -0000
@@ -3,7 +3,7 @@
 COMMENT =	postfix greylist daemon
 
 DISTNAME =	sqlgrey-1.7.6
-REVISION =	0
+REVISION =	1
 CATEGORIES =	mail
 
 HOMEPAGE =	http://sqlgrey.sf.net/
@@ -21,7 +21,11 @@ NO_TEST =		Yes
 RUN_DEPENDS =		devel/p5-Net-Server \
 			devel/p5-IO-Multiplex \
 			devel/p5-Date-Calc \
-			net/wget \
 			p5-DBD-SQLite-*|p5-DBD-mysql-*|p5-DBD-Pg-*:databases/p5-DBD-SQLite
+
+post-install:
+	${INSTALL_DATA_DIR} ${PREFIX}/libdata/perl5/site_perl/DBIx/
+	${INSTALL_DATA} ${WRKSRC}/lib/DBIx-DBCluster-0.01/DBCluster.pm \
+		${PREFIX}/libdata/perl5/site_perl/DBIx/DBCluster.pm
 
 .include <bsd.port.mk>
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/mail/sqlgrey/patches/patch-Makefile,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 patch-Makefile
--- patches/patch-Makefile	16 Nov 2009 10:43:55 -0000	1.1.1.1
+++ patches/patch-Makefile	28 May 2014 23:09:47 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-Makefile,v 1.1.1.1 2009/11/16 10:43:55 giovanni Exp $
 --- Makefile.orig	Sun Oct 22 17:05:57 2006
-+++ Makefile	Tue Nov 10 18:26:14 2009
++++ Makefile	Thu May 29 00:27:00 2014
 @@ -1,10 +1,10 @@
  INSTALL = install
 -ETCDIR = $(ROOTDIR)/etc
@@ -26,7 +26,7 @@ $OpenBSD: patch-Makefile,v 1.1.1.1 2009/
  
  clean:
  	rm -f sqlgrey.1
-@@ -45,22 +46,24 @@ clean:
+@@ -45,22 +46,26 @@ clean:
  
  install: all
  	$(INSTALL) -d -m 755 $(SBINDIR)
@@ -46,7 +46,9 @@ $OpenBSD: patch-Makefile,v 1.1.1.1 2009/
  	$(INSTALL) -m 644 etc/discrimination.regexp $(CONFDIR)
  	$(INSTALL) -m 644 etc/dyn_fqdn.regexp $(CONFDIR)
  	$(INSTALL) -m 644 etc/smtp_server.regexp $(CONFDIR)
++	$(INSTALL) -m 644 FAQ $(DOCDIR)
 +	$(INSTALL) -m 644 HOWTO $(DOCDIR)
++	$(INSTALL) -m 644 README.* $(DOCDIR)
  	$(INSTALL) -m 644 etc/README $(CONFDIR)
  	$(INSTALL) -m 644 sqlgrey.1 $(MANDIR)
 +	$(INSTALL) -m 644 sqlgrey-logstats.1 $(MANDIR)
Index: patches/patch-sqlgrey
===================================================================
RCS file: patches/patch-sqlgrey
diff -N patches/patch-sqlgrey
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ patches/patch-sqlgrey	28 May 2014 23:09:47 -0000
@@ -0,0 +1,11 @@
+$OpenBSD$
+--- sqlgrey.orig	Thu May 29 00:59:30 2014
++++ sqlgrey	Thu May 29 00:59:45 2014
+@@ -30,6 +30,7 @@ use Pod::Usage;
+ use Getopt::Long 2.25 qw(:config posix_default no_ignore_case);
+ use Net::Server::Multiplex;
+ use DBI;
++use DBIx::DBCluster;
+ 
+ use POSIX ':sys_wait_h';
+ 
Index: patches/patch-update_sqlgrey_config
===================================================================
RCS file: /cvs/ports/mail/sqlgrey/patches/patch-update_sqlgrey_config,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 patch-update_sqlgrey_config
--- patches/patch-update_sqlgrey_config	16 Nov 2009 10:43:55 -0000	1.1.1.1
+++ patches/patch-update_sqlgrey_config	28 May 2014 23:09:47 -0000
@@ -1,6 +1,6 @@
 $OpenBSD: patch-update_sqlgrey_config,v 1.1.1.1 2009/11/16 10:43:55 giovanni Exp $
---- update_sqlgrey_config.orig	Wed Mar  2 01:49:41 2005
-+++ update_sqlgrey_config	Thu Jun  5 19:03:17 2008
+--- update_sqlgrey_config.orig	Thu Sep 15 12:11:24 2005
++++ update_sqlgrey_config	Thu May 29 00:31:44 2014
 @@ -1,10 +1,10 @@
 -#!/bin/bash
 +#!/bin/sh
@@ -15,7 +15,21 @@ $OpenBSD: patch-update_sqlgrey_config,v 
      exit -1
  fi
  DIFF=`which diff 2>/dev/null`
-@@ -33,11 +33,6 @@ if [ -z "$whitelists_host" ]
+@@ -13,12 +13,7 @@ then
+     echo "diff not found in PATH, can't continue"
+     exit -1
+ fi
+-WGET=`which wget 2>/dev/null`
+-if [ $? -ne 0 ]
+-then
+-    echo "wget not found in PATH, can't continue"
+-    exit -1
+-fi
++FTP=/usr/bin/ftp
+ 
+ # md5sum output parsing need a known locale
+ LANG=C
+@@ -33,11 +28,6 @@ if [ -z "$whitelists_host" ]
  then
      whitelists_host="sqlgrey.bouton.name"
  fi
@@ -27,7 +41,7 @@ $OpenBSD: patch-update_sqlgrey_config,v 
  
  # Go into a temp directory
  MYTMP=`mktemp -d ${TMPDIR:-/tmp}/sqlgrey.XXXXXX`
-@@ -48,7 +43,6 @@ MYTMP=`mktemp -d ${TMPDIR:-/tmp}/sqlgrey.XXXXXX`
+@@ -48,18 +38,17 @@ MYTMP=`mktemp -d ${TMPDIR:-/tmp}/sqlgrey.XXXXXX`
  
  # Setup a clean exit
  clean_exit() {
@@ -35,7 +49,11 @@ $OpenBSD: patch-update_sqlgrey_config,v 
      [ -n "$MYTMP" -a -d "$MYTMP" ] && rm -rf $MYTMP
      exit $1
  }
-@@ -59,7 +53,7 @@ $WGET -q http://$whitelists_host/MD5SUMS
+ trap clean_exit 2 3 15
+ 
+ # Fetch MD5
+-$WGET -q http://$whitelists_host/MD5SUMS
++$FTP -V http://$whitelists_host/MD5SUMS
  
  # Check installed files
  cd $MYDIR
@@ -44,7 +62,16 @@ $OpenBSD: patch-update_sqlgrey_config,v 
  
  if [ -z "$TOUPDATE" ]
  then
-@@ -85,7 +79,7 @@ do
+@@ -77,7 +66,7 @@ for todownload in $TOUPDATE
+ do
+     echo "updating $MYDIR/$todownload:"
+     rm $todownload 2>/dev/null
+-    $WGET -N -q http://$whitelists_host/$todownload
++    $FTP -V http://$whitelists_host/$todownload
+     if [ -f $MYDIR/$todownload ]; then
+ 	$DIFF -u $MYDIR/$todownload $todownload
+     else
+@@ -85,7 +74,7 @@ do
      fi
  done
  
@@ -53,7 +80,7 @@ $OpenBSD: patch-update_sqlgrey_config,v 
  if [ $? -ne 0 ]
  then
      # Can only happen if remote site is borked or file got corrupt in transit
-@@ -99,6 +93,6 @@ rm MD5SUMS
+@@ -99,6 +88,6 @@ rm MD5SUMS
  mv * $MYDIR
  
  # Reload whitelists
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/mail/sqlgrey/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -p -u -p -r1.1.1.1 PLIST
--- pkg/PLIST	16 Nov 2009 10:43:55 -0000	1.1.1.1
+++ pkg/PLIST	28 May 2014 23:09:47 -0000
@@ -2,12 +2,19 @@
 @newgroup _sqlgrey:647
 @newuser _sqlgrey:647:_sqlgrey:daemon:SQLgrey Account:/nonexistent:/sbin/nologin
 bin/sqlgrey-logstats
+libdata/perl5/site_perl/DBIx/
+libdata/perl5/site_perl/DBIx/DBCluster.pm
 @man man/man1/sqlgrey-logstats.1
 @man man/man1/sqlgrey.1
 sbin/sqlgrey
 sbin/update_sqlgrey_config
 share/doc/sqlgrey/
+share/doc/sqlgrey/FAQ
 share/doc/sqlgrey/HOWTO
+share/doc/sqlgrey/README.DBCLUSTER
+share/doc/sqlgrey/README.DISCRIMINATION
+share/doc/sqlgrey/README.OPTINOUT
+share/doc/sqlgrey/README.PERF
 share/examples/sqlgrey/
 @sample ${SYSCONFDIR}/sqlgrey/
 share/examples/sqlgrey/README
@@ -24,3 +31,4 @@ share/examples/sqlgrey/smtp_server.regex
 @sample ${SYSCONFDIR}/sqlgrey/smtp_server.regexp
 share/examples/sqlgrey/sqlgrey.conf
 @sample ${SYSCONFDIR}/sqlgrey/sqlgrey.conf
+@rcscript ${RCDIR}/sqlgrey
Index: pkg/sqlgrey.rc
===================================================================
RCS file: pkg/sqlgrey.rc
diff -N pkg/sqlgrey.rc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ pkg/sqlgrey.rc	28 May 2014 23:09:47 -0000
@@ -0,0 +1,18 @@
+#!/bin/sh
+#
+# $OpenBSD: rc.template,v 1.5 2011/03/10 13:46:59 ajacoutot Exp $
+
+daemon="${TRUEPREFIX}/sbin/sqlgrey"
+daemon_flags="-d"
+
+. /etc/rc.d/rc.subr
+
+pexp="/usr/bin/perl -w ${daemon} ${daemon_flags}"
+
+rc_reload=NO
+
+rc_stop() {
+	${daemon} -k
+}
+
+rc_cmd $1

Reply via email to