You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
83 lines
2.0 KiB
83 lines
2.0 KiB
6 years ago
|
# Copyright 1999-2019 Gentoo Authors
|
||
9 years ago
|
# Distributed under the terms of the GNU General Public License v2
|
||
|
|
||
6 years ago
|
EAPI="7"
|
||
9 years ago
|
|
||
|
inherit toolchain-funcs
|
||
|
|
||
|
DESCRIPTION="A standalone anti-spam greylisting algorithm on top of Postfix"
|
||
|
HOMEPAGE="http://www.gasmi.net/gld.html"
|
||
|
SRC_URI="http://www.gasmi.net/down/${P}.tgz"
|
||
|
|
||
|
LICENSE="GPL-2"
|
||
|
SLOT="0"
|
||
|
KEYWORDS="~amd64 ~ppc ~x86"
|
||
|
IUSE="libressl postgres"
|
||
|
# Not adding a mysql USE flag. The package defaults to it, so we will too.
|
||
|
DEPEND="sys-libs/zlib
|
||
6 years ago
|
!libressl? ( dev-libs/openssl:0= )
|
||
9 years ago
|
libressl? ( dev-libs/libressl )
|
||
6 years ago
|
!postgres? ( dev-db/mysql-connector-c:0= )
|
||
9 years ago
|
postgres? ( dev-db/postgresql:*[server] )"
|
||
|
RDEPEND="${DEPEND}"
|
||
|
|
||
|
src_prepare() {
|
||
|
sed -i gld.conf \
|
||
|
-e 's:^LOOPBACKONLY=.*:LOOPBACKONLY=1:' \
|
||
|
-e 's:^#USER=.*:USER=nobody:' \
|
||
|
-e 's:^#GROUP=.*:GROUP=nobody:' \
|
||
|
|| die "sed gld.conf failed"
|
||
|
|
||
|
sed -i Makefile.in \
|
||
|
-e '/ -c /{s|-O2|$(CFLAGS)|g}' \
|
||
|
-e '/ -o /{s|-O2|$(CFLAGS) $(LDFLAGS)|g}' \
|
||
|
-e '/strip/d' \
|
||
|
|| die "sed Makefile.in failed"
|
||
|
|
||
|
sed -i tables.{my,pg}sql \
|
||
|
-e '/ip char/s/16/39/' \
|
||
|
|| die "sed sql tables failed"
|
||
6 years ago
|
|
||
|
sed -i configure \
|
||
|
-e "/SQL_LIBS/{s~/lib~/$(get_libdir)~g}" || die
|
||
|
|
||
|
default
|
||
9 years ago
|
}
|
||
|
|
||
|
src_configure() {
|
||
|
tc-export CC
|
||
6 years ago
|
|
||
9 years ago
|
# It's kind of weird. $(use_with postgres pgsql) won't work if you don't
|
||
|
# use it...
|
||
6 years ago
|
econf $(usex postgres '--with-pgsql' '')
|
||
9 years ago
|
}
|
||
|
|
||
|
src_install() {
|
||
|
dobin gld
|
||
|
|
||
|
insinto /etc
|
||
|
newins gld.conf gld.conf.example
|
||
|
|
||
|
dodoc HISTORY README*
|
||
|
|
||
|
insinto /usr/share/${PN}/sql
|
||
|
doins *.pgsql *-whitelist.sql "${FILESDIR}"/tables.sql
|
||
|
|
||
|
newinitd "${FILESDIR}"/gld.rc gld
|
||
|
}
|
||
|
|
||
|
pkg_preinst() {
|
||
|
elog "Please read the README file in /usr/share/doc/${PF} for"
|
||
|
elog "details on how to setup gld."
|
||
|
elog
|
||
|
elog "The sql files have been installed to /usr/share/${PN}/sql."
|
||
6 years ago
|
local old_ver
|
||
|
for old_ver in ${REPLACING_VERSIONS} ; do
|
||
|
if ver_test ${old_ver} -eq "1.7-r1" ; then
|
||
|
elog "You might want to use the ALTER_TABLE command to change the"
|
||
|
elog "ip field width to 39 chars to accomodate ipv6 addresses."
|
||
|
elog "Please see your sql server documentation."
|
||
|
fi
|
||
|
done
|
||
9 years ago
|
}
|