1 # Copyright 1999-2014 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit toolchain-funcs
8 DESCRIPTION="A standalone anti-spam greylisting algorithm on top of Postfix"
9 HOMEPAGE="http://www.gasmi.net/gld.html"
10 SRC_URI="http://www.gasmi.net/down/${P}.tgz"
14 KEYWORDS="amd64 ppc x86"
16 # Not adding a mysql USE flag. The package defaults to it, so we will too.
18 >=dev-libs/openssl-0.9.6
19 postgres? ( dev-db/postgresql[server] )
20 !postgres? ( virtual/mysql )"
25 -e 's:^LOOPBACKONLY=.*:LOOPBACKONLY=1:' \
26 -e 's:^#USER=.*:USER=nobody:' \
27 -e 's:^#GROUP=.*:GROUP=nobody:' \
28 || die "sed gld.conf failed"
31 -e '/ -c /{s|-O2|$(CFLAGS)|g}' \
32 -e '/ -o /{s|-O2|$(CFLAGS) $(LDFLAGS)|g}' \
34 || die "sed Makefile.in failed"
36 sed -i tables.{my,pg}sql \
37 -e '/ip char/s/16/39/' \
38 || die "sed sql tables failed"
43 # It's kind of weird. $(use_with postgres pgsql) won't work if you don't
45 if use postgres ; then
46 myconf="${myconf} --with-pgsql"
56 newins gld.conf gld.conf.example
60 insinto /usr/share/${PN}/sql
61 doins *.pgsql *-whitelist.sql "${FILESDIR}"/tables.sql
63 newinitd "${FILESDIR}"/gld.rc gld
67 elog "Please read the README file in /usr/share/doc/${PF} for"
68 elog "details on how to setup gld."
70 elog "The sql files have been installed to /usr/share/${PN}/sql."
71 if [[ $REPLACING_VERSIONS == "1.7-r1" ]]; then
72 elog "You might want to use the ALTER_TABLE command to change the"
73 elog "ip field width to 39 chars to accomodate ipv6 addresses."
74 elog "Please see your sql server documentation."