1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_USE_WITH='sqlite?'
11 DESCRIPTION="Flexible print quota and accounting package for use with CUPS and lpd"
12 HOMEPAGE="http://www.pykota.com"
13 SRC_URI="https://dev.gentoo.org/~dilfridge/distfiles/${P}.tar.xz"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="ldap mysql postgres snmp sqlite xml"
20 DEPEND="dev-lang/python
21 dev-python/egenix-mx-base
25 ldap? ( dev-python/python-ldap )
26 mysql? ( dev-python/mysql-python )
27 postgres? ( dev-db/postgresql[server] dev-python/pygresql )
28 snmp? ( net-analyzer/net-snmp =dev-python/pysnmp-3.4* )
29 xml? ( dev-python/jaxml )"
34 DOCS="README TODO SECURITY CREDITS FAQ"
37 python_set_active_version 2
44 sed -i -e 's:from pysqlite2 import dbapi2:import sqlite3:' \
45 pykota/storages/sqlitestorage.py || die
49 dodir /etc/${PN} || die
52 # cups backend ----------------------------------------------
54 dodir $(cups-config --serverbin)/backend || die
55 dosym /usr/share/pykota/cupspykota $(cups-config --serverbin)/backend/cupspykota || die
57 # extra docs: inits -----------------------------------------
59 init_dir="/usr/share/doc/${PF}/initscripts"
61 doins -r initscripts/* || die
63 # Fixes permissions for bug 155865
64 chmod 700 "${D}"/usr/share/pykota/cupspykota
66 for doc in ${DOCS}; do
67 rm "${D}"/usr/share/doc/${PN}/${doc} || die
69 rm "${D}"/usr/share/doc/${PN}/{LICENSE,COPYING} || die
70 mv "${D}"/usr/share/doc/${PN}/* "${D}"/usr/share/doc/${PF}/ || die
71 rmdir "${D}"/usr/share/doc/${PN} || die