updated on Tue Jan 10 08:08:34 UTC 2012
[aur-mirror.git] / sqlgrey / PKGBUILD
blobeb35fd4581c0dd93332b40ee83a649c9f5b1fda9
1 # Contributor: Phillip Smith <fukawi2@NO-SPAM.gmail.com>
2 pkgname=sqlgrey
3 pkgver=1.6.8
4 pkgrel=4
5 pkgdesc="Postfix greylisting policy service with auto-white-listing written in Perl with SQL database as storage backend. Greylisting stops 50 to 90 % junk mails (spam and virus) before they reach your Postfix server (saves BW, user time and CPU time)."
6 arch=(any)
7 url="http://sqlgrey.sourceforge.net/"
8 license=('GPL')
9 depends=('perl' 'perl-net-server' 'perl-io-multiplex' 'perl-dbi' 'perl-date-calc' 'postfix>=2.1')
10 optdepends=('perl-dbd-pg: for using postgresql as backend database' 'perl-dbd-mysql: for using mysql as backend database')
11 backup=('etc/sqlgrey/sqlgrey.conf' 'etc/sqlgrey/clients_ip_whitelist.local' 'etc/sqlgrey/clients_fqdn_whitelist.local')
12 install=$pkgname.install
13 source=("http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.bz2" "rc.$pkgname")
14 md5sums=('513ddb38e5a9760773d8e1a2b27e31a1'
15          '028c1b536ef89fa2eb6cbc7fb4708395')
17 build() {
18   # UID / GID 111 = sqlgrey
19         cd $srcdir/$pkgname-$pkgver
21         make || return 1
24 package() {
25         cd $srcdir/$pkgname-$pkgver
27   make ROOTDIR=${pkgdir} install || return 1
28         
29   msg "Installing rc.d script..."
30   install -D -m755 $srcdir/rc.$pkgname $pkgdir/etc/rc.d/$pkgname || return 1
31   
32   msg "Creating .local config files..."
33   touch $pkgdir/etc/sqlgrey/clients_ip_whitelist.local
34   touch $pkgdir/etc/sqlgrey/clients_fqdn_whitelist.local
35   cat > $pkgdir/etc/sqlgrey/clients_ip_whitelist.local <<EOD
36   # This is the local configuration for whitelisted IP addresses for sqlgrey.
37   # Add any IP addresses you need whitelisted to this file. One IP address per line.
38   # To add a /24 address space, omit the last octet of the address.
39   # For example, to whitelist 202.14.166.0/24, add the line:
40   #   202.14.166
41 EOD
43   cat > $pkgdir/etc/sqlgrey/clients_fqdn_whitelist.local <<EOD
44   # This is the local configuration for whitelisted hostnames for sqlgrey.
45   #
46   # hostname.domain.com # whole system name (least CPU intensive)
47   # *.domain.com        # whitelist any fqdn in the domain 'domain.com'
48   # /regexp/            # whitelist any fqdn matching the regexp (by far most CPU intensive)
50   # Note you need the following two lines to allow both
51   # <lots of mtas>.example.com and example.com
52   # *.example.com
53   # example.com 
54 EOD
56   msg "Setting permissions..."
57   chown -R 111:111 $pkgdir/etc/sqlgrey || return 1
59   msg "Cleaning up..."
60   rm -Rf $pkgdir/etc/init.d || return 1
63 # vim:set ts=2 sw=2 et: