/[gentoo-x86]/mail-filter/gld/gld-1.7-r2.ebuild
Gentoo

Contents of /mail-filter/gld/gld-1.7-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Sun Aug 12 12:02:47 2012 UTC (2 years, 1 month ago) by eras
Branch: MAIN
Change ip column to 39 chars in sql tables - bug #430384

(Portage version: 2.2.0_alpha121/cvs/Linux x86_64)

1 eras 1.1 # Copyright 1999-2012 Gentoo Foundation
2     # Distributed under the terms of the GNU General Public License v2
3     # $Header: /var/cvsroot/gentoo-x86/mail-filter/gld/gld-1.7-r1.ebuild,v 1.4 2011/06/22 21:35:10 ranger Exp $
4    
5     EAPI="4"
6    
7     inherit toolchain-funcs
8    
9     DESCRIPTION="A standalone anti-spam greylisting algorithm on top of Postfix"
10     HOMEPAGE="http://www.gasmi.net/gld.html"
11     SRC_URI="http://www.gasmi.net/down/${P}.tgz"
12    
13     LICENSE="GPL-2"
14     SLOT="0"
15     KEYWORDS="~amd64 ~ppc ~x86"
16     IUSE="postgres"
17     # Not adding a mysql USE flag. The package defaults to it, so we will too.
18     DEPEND="sys-libs/zlib
19     >=dev-libs/openssl-0.9.6
20     postgres? ( dev-db/postgresql-server )
21     !postgres? ( virtual/mysql )"
22     RDEPEND="${DEPEND}"
23    
24     src_prepare() {
25     sed -i gld.conf \
26     -e 's:^LOOPBACKONLY=.*:LOOPBACKONLY=1:' \
27     -e 's:^#USER=.*:USER=nobody:' \
28     -e 's:^#GROUP=.*:GROUP=nobody:' \
29     || die "sed gld.conf failed"
30    
31     sed -i Makefile.in \
32     -e '/ -c /{s|-O2|$(CFLAGS)|g}' \
33     -e '/ -o /{s|-O2|$(CFLAGS) $(LDFLAGS)|g}' \
34     -e '/strip/d' \
35     || die "sed Makefile.in failed"
36    
37     sed -i tables.{my,pg}sql \
38     -e '/ip char/s/16/39/' \
39     || die "sed sql tables failed"
40     }
41    
42     src_configure() {
43     tc-export CC
44     # It's kind of weird. $(use_with postgres pgsql) won't work if you don't
45     # use it...
46     if use postgres ; then
47     myconf="${myconf} --with-pgsql"
48     fi
49    
50     econf ${myconf}
51     }
52    
53     src_install() {
54     dobin gld
55    
56     insinto /etc
57     newins gld.conf gld.conf.example
58    
59     dodoc HISTORY README*
60    
61     insinto /usr/share/${PN}/sql
62     doins *.pgsql *-whitelist.sql "${FILESDIR}"/tables.sql
63    
64     newinitd "${FILESDIR}"/gld.rc gld
65     }
66    
67     pkg_preinst() {
68     elog "Please read the README file in /usr/share/doc/${PF} for"
69     elog "details on how to setup gld."
70     elog
71     elog "The sql files have been installed to /usr/share/${PN}/sql."
72     if [[ $REPLACING_VERSIONS == "1.7-r1" ]]; then
73     elog "You might want to use the ALTER_TABLE command to change the"
74     elog "ip field width to 39 chars to accomodate ipv6 addresses."
75     elog "Please see your sql server documentation."
76     fi
77     }

  ViewVC Help
Powered by ViewVC 1.1.20