summaryrefslogtreecommitdiff
blob: 89d515114ed5ddf4ad042611e4f99d673777b060 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-proxy/squirm/squirm-1.23.ebuild,v 1.4 2006/09/20 13:18:08 mrness Exp $

DESCRIPTION="A redirector for Squid"
HOMEPAGE="http://squirm.foote.com.au"
SRC_URI="http://squirm.foote.com.au/${P}.tgz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="x86 ppc"
IUSE=""

RDEPEND="net-proxy/squid"

src_unpack() {
	unpack ${A}

	sed -i \
		-e 's|^EXTRALIBS=.*|EXTRALIBS=|' \
		-e 's|^PREFIX=.*|PREFIX=/usr/squirm|' \
		-e "s|^OPTIMISATION=.*|OPTIMISATION=${CFLAGS}|" \
		-e "s|^CFLAGS =.*|CFLAGS=${CFLAGS} -DPREFIX=\\\\\"\$(PREFIX)\\\\\"|" \
		"${S}/Makefile"
}

src_install() {
	make PREFIX="${D}/usr/squirm" install || die "make install failed"
}

pkg_postinst() {
	einfo "To enable squirm, add the following lines to /etc/squid/squid.conf:"
	einfo " - for squid ver 2.5"
	einfo "    ${HILITE}redirect_program /usr/squirm/bin/squirm${NORMAL}"
	einfo "    ${HILITE}redirect_children 10${NORMAL}"
	einfo " - for squid ver 2.6"
	einfo "    ${HILITE}url_rewrite_program /usr/squirm/bin/squirm${NORMAL}"
	einfo "    ${HILITE}url_rewrite_children 10${NORMAL}"
}