summaryrefslogtreecommitdiff
blob: ad26dfa304f65ea1172e44e575bbd455204bca00 (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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# Copyright 1999-2009 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-mail/getmail/getmail-4.9.0.ebuild,v 1.1 2009/04/07 05:30:10 tove Exp $

inherit distutils

IUSE=""
DESCRIPTION="A POP3 mail retriever with reliable Maildir and mbox delivery"
HOMEPAGE="http://pyropus.ca/software/getmail/"
SRC_URI="http://pyropus.ca/software/getmail/old-versions/${P}.tar.gz"

SLOT="4"
LICENSE="GPL-2"
KEYWORDS="~alpha ~amd64 ~ppc ~sparc ~x86"

DEPEND=">=dev-lang/python-2.3.3"

src_unpack() {
	unpack ${A}
	cd "${S}"

	# getmail.spec is missing due to upstream packaging mistake
	sed -i -e '/getmail.spec/d' setup.py
}

src_compile() {
	distutils_src_compile
}

src_install() {
	distutils_src_install

	if has_version "=net-mail/getmail-3*" ; then
		mv "${D}"/usr/bin/getmail "${D}"/usr/bin/getmail4
		mv "${D}"/usr/bin/getmail_maildir "${D}"/usr/bin/getmail_maildir4
		mv "${D}"/usr/bin/getmail_mbox "${D}"/usr/bin/getmail_mbox4
	fi

	# handle docs the gentoo way
	rm "${D}"/usr/share/doc/${P}/COPYING
	if [ ${P} != ${PF} ]; then
		mv "${D}"/usr/share/doc/${P} "${D}"/usr/share/doc/${PF}
	fi

	dodir /usr/share/doc/${PF}/html
	mv "${D}"/usr/share/doc/${PF}/*.html "${D}"/usr/share/doc/${PF}/*.css "${D}"/usr/share/doc/${PF}/html
}

pkg_postinst() {
	python_version
	python_mod_optimize /usr/lib/python${PYVER}/site-packages/getmailcore

	if has_version "=net-mail/getmail-3*" ; then
		echo
		ewarn "An already installed instance of getmail v3 was detected. In order to"
		ewarn "co-exist with it the three main scripts of getmail v4 were renamed to"
		ewarn "getmail4, getmail_maildir4, getmail_mbox4."
		echo
	fi
}

pkg_postrm() {
	python_version
	python_mod_cleanup
}