summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhillip Smith2015-06-02 12:04:46 +1000
committerPhillip Smith2015-06-02 12:04:46 +1000
commite79b945696ca61ba283be39d88564f0b9871e1be (patch)
tree189bf26f8aa7e46d55b81d2e8f6de4657841c926
downloadaur-e79b945696ca61ba283be39d88564f0b9871e1be.tar.gz
initial commit
-rw-r--r--.SRCINFO34
-rw-r--r--.gitignore4
-rw-r--r--PKGBUILD75
-rw-r--r--clients_fqdn_whitelist.local11
-rw-r--r--clients_ip_whitelist.local5
-rw-r--r--fix-Makefile-path-to-perldoc.patch11
-rw-r--r--fix-Makefile-sbinpath.patch11
-rw-r--r--sqlgrey.install22
-rw-r--r--sqlgrey.service10
9 files changed, 183 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..9defa66e95f3
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,34 @@
+pkgbase = sqlgrey
+ pkgdesc = Postfix greylisting policy service with auto-white-listing with SQL database as storage backend.
+ pkgver = 1.8.0
+ pkgrel = 3
+ url = http://sqlgrey.sourceforge.net/
+ install = sqlgrey.install
+ arch = any
+ license = GPL
+ depends = perl
+ depends = perl-net-server
+ depends = perl-io-multiplex
+ depends = perl-dbi
+ depends = perl-date-calc
+ depends = postfix>=2.1
+ optdepends = perl-dbd-pg: for using postgresql as backend database
+ optdepends = perl-dbd-mysql: for using mysql as backend database
+ backup = etc/sqlgrey/sqlgrey.conf
+ backup = etc/sqlgrey/clients_ip_whitelist.local
+ backup = etc/sqlgrey/clients_fqdn_whitelist.local
+ source = http://downloads.sourceforge.net/project/sqlgrey/sqlgrey-1.8%20%28stable%29/sqlgrey-1.8.0.tar.gz
+ source = fix-Makefile-path-to-perldoc.patch
+ source = fix-Makefile-sbinpath.patch
+ source = sqlgrey.service
+ source = clients_fqdn_whitelist.local
+ source = clients_ip_whitelist.local
+ md5sums = de9c6d0740fd2589d4e353e76c40e2c7
+ md5sums = 0f87aa737aec1d1ac8a1bb6915f619a0
+ md5sums = ee03f586291b6f377ab28d5c1d5aca60
+ md5sums = bcf0940abe01a48fbfc9a4c5c5a7ae6f
+ md5sums = 235535e43def87509936e13f5a9bab44
+ md5sums = 9ad7dd44af527e10674c79e511fc1dfc
+
+pkgname = sqlgrey
+
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 000000000000..1baaf00b05ab
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,4 @@
+/sqlgrey-*.pkg.tar.xz
+/sqlgrey-*.tar.gz
+/pkg/
+/src/
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..6f086921d66c
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,75 @@
+# Maintainer: Phillip Smith <fukawi2@NO-SPAM.gmail.com>
+# http://github.com/fukawi2/aur-packages
+
+### I AM ONLY THE PACKAGER, NOT THE DEVELOPER
+### Please ask support questions about this software in one of:
+### 1) The AUR comments; OR
+### 2) Upstream forums/maillist etc; OR
+### 3) The ArchLinux forums
+### I do not always know enough about the software itself, or don't have the
+### time to promptly respond to direct emails.
+### If you have found a problem with the package/PKGBUILD (as opposed to
+### the software) then please do email me or post an AUR comment.
+
+pkgname=sqlgrey
+pkgver=1.8.0
+pkgrel=3
+pkgdesc="Postfix greylisting policy service with auto-white-listing with SQL database as storage backend."
+arch=('any')
+url="http://sqlgrey.sourceforge.net/"
+license=('GPL')
+depends=('perl' 'perl-net-server' 'perl-io-multiplex' 'perl-dbi' 'perl-date-calc' 'postfix>=2.1')
+optdepends=('perl-dbd-pg: for using postgresql as backend database'
+ 'perl-dbd-mysql: for using mysql as backend database')
+backup=('etc/sqlgrey/sqlgrey.conf'
+ 'etc/sqlgrey/clients_ip_whitelist.local'
+ 'etc/sqlgrey/clients_fqdn_whitelist.local')
+install="${pkgname}.install"
+source=("http://downloads.sourceforge.net/project/sqlgrey/sqlgrey-1.8%20%28stable%29/${pkgname}-${pkgver}.tar.gz"
+ 'fix-Makefile-path-to-perldoc.patch'
+ 'fix-Makefile-sbinpath.patch'
+ 'sqlgrey.service'
+ 'clients_fqdn_whitelist.local'
+ 'clients_ip_whitelist.local')
+md5sums=('de9c6d0740fd2589d4e353e76c40e2c7'
+ '0f87aa737aec1d1ac8a1bb6915f619a0'
+ 'ee03f586291b6f377ab28d5c1d5aca60'
+ 'bcf0940abe01a48fbfc9a4c5c5a7ae6f'
+ '235535e43def87509936e13f5a9bab44'
+ '9ad7dd44af527e10674c79e511fc1dfc')
+
+_UID=111
+_GID=111
+
+prepare() {
+ cd "$srcdir"/$pkgname-$pkgver
+ patch -p0 < $srcdir/fix-Makefile-path-to-perldoc.patch
+ patch -p0 < $srcdir/fix-Makefile-sbinpath.patch
+}
+
+build() {
+ cd "$srcdir"/$pkgname-$pkgver
+
+ make
+}
+
+package() {
+ cd "$srcdir"/$pkgname-$pkgver
+
+ make ROOTDIR="${pkgdir}" install
+
+ # install sample config files
+ install -Dm644 -o $UID -g $_GID "$srcdir"/clients_fqdn_whitelist.local "$pkgdir"/etc/sqlgrey/clients_fqdn_whitelist.local
+ install -Dm644 -o $UID -g $_GID "$srcdir"/clients_ip_whitelist.local "$pkgdir"/etc/sqlgrey/clients_ip_whitelist.local
+
+ # set permissions
+ chown -R $_UID:$_GID "$pkgdir"/etc/sqlgrey
+
+ # remove redundant init.d directory
+ rmdir "$pkgdir"/etc/init.d
+
+ # install systemd "unit file"
+ install -D -m755 "$srcdir"/sqlgrey.service "$pkgdir"/usr/lib/systemd/system/sqlgrey.service
+}
+
+# vim:set ts=2 sw=2 et:
diff --git a/clients_fqdn_whitelist.local b/clients_fqdn_whitelist.local
new file mode 100644
index 000000000000..fef4953df369
--- /dev/null
+++ b/clients_fqdn_whitelist.local
@@ -0,0 +1,11 @@
+# This is the local configuration for whitelisted hostnames for sqlgrey.
+#
+# hostname.domain.com # whole system name (least CPU intensive)
+# *.domain.com # whitelist any fqdn in the domain 'domain.com'
+# /regexp/ # whitelist any fqdn matching the regexp (by far most CPU intensive)
+
+# Note you need the following two lines to allow both
+# <lots of mtas>.example.com and example.com
+# *.example.com
+# example.com
+
diff --git a/clients_ip_whitelist.local b/clients_ip_whitelist.local
new file mode 100644
index 000000000000..3a87c2747dfb
--- /dev/null
+++ b/clients_ip_whitelist.local
@@ -0,0 +1,5 @@
+# This is the local configuration for whitelisted IP addresses for sqlgrey.
+# Add any IP addresses you need whitelisted to this file. One IP address per line.
+# To add a /24 address space, omit the last octet of the address.
+# For example, to whitelist 202.14.166.0/24, add the line:
+# 202.14.166
diff --git a/fix-Makefile-path-to-perldoc.patch b/fix-Makefile-path-to-perldoc.patch
new file mode 100644
index 000000000000..d2e5087a2ab1
--- /dev/null
+++ b/fix-Makefile-path-to-perldoc.patch
@@ -0,0 +1,11 @@
+--- Makefile.ORIG 2013-06-04 11:43:45.401204266 +1000
++++ Makefile 2013-06-04 11:44:00.380484590 +1000
+@@ -35,7 +35,7 @@
+ chmod a+x sqlgrey
+
+ manpage:
+- perldoc -u sqlgrey | pod2man -n sqlgrey > sqlgrey.1
++ /usr/bin/core_perl/perldoc -u sqlgrey | pod2man -n sqlgrey > sqlgrey.1
+
+ clean:
+ rm -f sqlgrey.1
diff --git a/fix-Makefile-sbinpath.patch b/fix-Makefile-sbinpath.patch
new file mode 100644
index 000000000000..a2ed1f9e414c
--- /dev/null
+++ b/fix-Makefile-sbinpath.patch
@@ -0,0 +1,11 @@
+--- Makefile.ORIG 2013-06-04 11:46:26.823448692 +1000
++++ Makefile 2013-06-04 11:46:35.723021110 +1000
+@@ -1,7 +1,7 @@
+ INSTALL = install
+ ETCDIR = $(ROOTDIR)/etc
+ CONFDIR = $(ETCDIR)/sqlgrey
+-SBINDIR = $(ROOTDIR)/usr/sbin
++SBINDIR = $(ROOTDIR)/usr/bin
+ BINDIR = $(ROOTDIR)/usr/bin
+ INITDIR = $(ETCDIR)/init.d
+ MANDIR = $(ROOTDIR)/usr/share/man/man1
diff --git a/sqlgrey.install b/sqlgrey.install
new file mode 100644
index 000000000000..9563ab62f607
--- /dev/null
+++ b/sqlgrey.install
@@ -0,0 +1,22 @@
+post_install() {
+ if [ -z "`getent group sqlgrey`" ]; then
+ groupadd -g 111 sqlgrey
+ fi
+ if [ -z "`getent passwd sqlgrey`" ]; then
+ useradd -u 111 -g sqlgrey -c "SQLgrey Daemon" -d /var/lib/sqlgrey -m -s /bin/false sqlgrey
+ fi
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ userdel sqlgrey &> /dev/null
+ groupdel sqlgrey &> /dev/null
+}
+
+op=$1
+shift
+
+$op $*
diff --git a/sqlgrey.service b/sqlgrey.service
new file mode 100644
index 000000000000..619abb2c0864
--- /dev/null
+++ b/sqlgrey.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Postfix greylisting policy service
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/sqlgrey -d
+
+[Install]
+WantedBy=multi-user.target