summaryrefslogtreecommitdiff
blob: 356c7f184c6376703c514df332f7ecd4b0426995 (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-2012 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-print/pykota/pykota-1.26.ebuild,v 1.2 2012/03/20 14:46:11 jer Exp $

EAPI=3
PYTHON_DEPEND="2"

inherit distutils

DESCRIPTION="Flexible print quota and accounting package for use with CUPS and lpd."
HOMEPAGE="http://www.pykota.com"
SRC_URI="http://dev.gentoo.org/~dilfridge/distfiles/${P}.tar.xz"

LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="ldap mysql postgres snmp sqlite xml"

DEPEND="dev-lang/python
	dev-python/egenix-mx-base
	net-print/pkpgcounter
	dev-python/chardet
	dev-python/pkipplib
	ldap?     ( dev-python/python-ldap )
	mysql?    ( dev-python/mysql-python )
	postgres? ( dev-db/postgresql-server dev-db/pygresql )
	sqlite?   ( dev-python/pysqlite:2 )
	snmp?     ( net-analyzer/net-snmp =dev-python/pysnmp-3.4* )
	xml?      ( dev-python/jaxml )"
RDEPEND="${DEPEND}"

S="${WORKDIR}/${P}"

DOCS="README TODO SECURITY CREDITS FAQ"

pkg_setup() {
	python_set_active_version 2
	python_pkg_setup
}

src_install() {
	dodir /etc/${PN} || die
	distutils_src_install

	# cups backend ----------------------------------------------

	dodir $(cups-config --serverbin)/backend || die
	dosym /usr/share/pykota/cupspykota $(cups-config --serverbin)/backend/cupspykota || die

	# extra docs: inits -----------------------------------------

	init_dir="/usr/share/doc/${PF}/initscripts"
	insinto "${init_dir}"
	doins -r initscripts/* || die

	# Fixes permissions for bug 155865
	chmod 700 "${D}"/usr/share/pykota/cupspykota

	for doc in ${DOCS}; do
		rm "${D}"/usr/share/doc/${PN}/${doc} || die
	done
	rm "${D}"/usr/share/doc/${PN}/{LICENSE,COPYING} || die
	mv "${D}"/usr/share/doc/${PN}/* "${D}"/usr/share/doc/${PF}/ || die
	rmdir "${D}"/usr/share/doc/${PN} || die
}