# (c) 2008 Tobias Hommel, Distributed under GPLv2 # $Header: $ inherit eutils linux-info MY_V="1.4" MY_P="${PN}.${PV}" DESCRIPTION="an antispam-daemon which denies connection to a mailserver if the client hasn't connected to a fake mailserver before" HOMEPAGE="http://michael.stapelberg.de/mxallowd" SRC_URI="${HOMEPAGE}/${MY_P}.tar.bz2 doc? ( ${HOMEPAGE}/mxallowd.pdf )" LICENSE="GPL-2" SLOT="0" #tested on x86 and amd64 KEYWORDS="~alpha amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86" IUSE="debug doc dontoptimize libipq" DEPEND="net-firewall/iptables !libipq? ( net-libs/libnetfilter_queue )" RDEPEND="${DEPEND}" S="${WORKDIR}/mxallowd/" src_unpack() { unpack "${MY_P}.tar.bz2" ; cd "${S}" use doc && cp "${DISTDIR}/mxallowd.pdf" ${S} if kernel_is ge 2 6 23; then cd ${S} epatch $FILESDIR/${MY_V}_nfq_unbind_pf_2.6.23.patch fi sed -i "s:/etc/mxallowd.conf:/etc/mxallowd/mxallowd.conf:g"\ "${S}mxallowd.1" || die "sed failed on mxallowd.1" sed -i "s:/etc/mxallowd.conf:/etc/mxallowd/mxallowd.conf:g"\ "${S}include/mxallowd.h" || die "dosed on mxallowd.h failed" sed -i "s:/etc/mxallowd.conf:/etc/mxallowd/mxallowd.conf:g"\ "${S}src/mxallowd.c" || die "dosed on mxallowd.c failed" } src_compile() { use dontoptimize && CONFOPTS="${CONFOPTS} --dont-optimize" use debug && CONFOPTS="${CONFOPTS} --enable-debug" use libipq && CONFOPTS="${CONFOPTS} --force-libipq" ./configure ${CONFOPTS} || die "configure failed" emake || die "make failed" } src_install() { dobin mxallowd || die "dobin failed" newinitd $FILESDIR/${MY_V}_mxallowd.initd mxallowd newconfd $FILESDIR/${MY_V}_mxallowd.confd mxallowd dodir /etc/mxallowd/ insinto /etc/mxallowd/ newins $FILESDIR/${MY_V}_mxallowd.conf mxallowd.conf newins $FILESDIR/${MY_V}_mx_add.sh mx_add.sh doman mxallowd.1 dodoc README dodoc $FILESDIR/README-${MY_V}.gentoo use doc && dodoc mxallowd.pdf } pkg_postinst() { einfo "documentation can be found on ${HOMEPAGE}/" if use doc ; then einfo "or in /usr/share/doc/${PF}/mxallowd.pdf" fi elog "You should read /usr/share/doc/${PF}/README.gentoo for information about configuring mxallowd on gentoo." einfo "Also remember to read the documentation if you run into problems like \"I can't send mail anymore\"." }