]> Pileus Git - ~andy/sunrise/blob - net-misc/moblock/moblock-0.8-r1.ebuild
sunrise/ app-portage/elog-list/elog-list-0.0.6.ebuild: Update header
[~andy/sunrise] / net-misc / moblock / moblock-0.8-r1.ebuild
1 # Copyright 1999-2009 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 inherit eutils toolchain-funcs linux-info
6
7 KEYWORDS="~amd64 ~x86"
8
9 MY_P=${P/mob/MoB}
10
11 DESCRIPTION="Blocks connections from/to hosts listed in a file in peerguardian format using iptables."
12 HOMEPAGE="http://moblock.berlios.de/"
13 SRC_URI="mirror://berlios/${PN}/${MY_P}-i586.tar.bz2"
14 LICENSE="GPL-2"
15 SLOT="0"
16 IUSE=""
17
18 DEPEND=">=net-libs/libnetfilter_queue-0.0.11
19                 >=net-libs/libnfnetlink-0.0.14
20                 net-firewall/iptables"
21 RDEPEND="${DEPEND}"
22
23 S=${WORKDIR}/${MY_P}
24
25 CONFIG_CHECK="NETFILTER NETFILTER_XTABLES NETFILTER_XT_TARGET_NFQUEUE IP_NF_IPTABLES IP_NF_FILTER"
26
27 src_unpack() {
28         unpack ${A}
29         cd "${S}"
30         epatch "${FILESDIR}/${P}-makefile.patch"
31 }
32
33 src_compile() {
34         emake CC=$(tc-getCC) || die "emake failed"
35 }
36
37 src_install() {
38         dosbin moblock
39         dosbin "${FILESDIR}/${PVR}/moblock-update"
40         dosbin "${FILESDIR}/${PVR}/moblock-stats"
41
42         newconfd "${FILESDIR}/${PVR}/confd" moblock
43         newinitd "${FILESDIR}/${PVR}/initd" moblock
44
45         dodir /var/db/moblock
46         touch "${D}/var/db/moblock/guarding.p2p"
47
48         keepdir /var/cache/moblock
49
50         dodoc Changelog README
51 }
52
53 pkg_postinst() {
54         elog "Run moblock-update to update your block list."
55         elog "You can set moblock to update daily with the command"
56         elog "  ln -s /usr/sbin/moblock-update /etc/cron.daily/moblock-update"
57         elog "Or weekly with"
58         elog "  ln -s /usr/sbin/moblock-update /etc/cron.weekly/moblock-update"
59 }
60
61 pkg_postrm() {
62         if ! has_version ${CATEGORY}/${PN} && [[ -d ${ROOT}/var/cache/moblock ]] ; then
63                 einfo "Removing leftover cache..."
64                 rm -rf "${ROOT}"/var/cache/moblock
65         fi
66 }