Use https by default
[gentoo.git] / net-print / pykota / pykota-1.26.ebuild
1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Id$
4
5 EAPI=3
6 PYTHON_DEPEND="2"
7 PYTHON_USE_WITH='sqlite?'
8
9 inherit distutils
10
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"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~amd64 ~x86"
18 IUSE="ldap mysql postgres snmp sqlite xml"
19
20 DEPEND="dev-lang/python
21         dev-python/egenix-mx-base
22         net-print/pkpgcounter
23         dev-python/chardet
24         dev-python/pkipplib
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 )"
30 RDEPEND="${DEPEND}"
31
32 S="${WORKDIR}/${P}"
33
34 DOCS="README TODO SECURITY CREDITS FAQ"
35
36 pkg_setup() {
37         python_set_active_version 2
38         python_pkg_setup
39 }
40
41 src_prepare() {
42         distutils_src_prepare
43
44         sed -i -e 's:from pysqlite2 import dbapi2:import sqlite3:' \
45                 pykota/storages/sqlitestorage.py || die
46 }
47
48 src_install() {
49         dodir /etc/${PN} || die
50         distutils_src_install
51
52         # cups backend ----------------------------------------------
53
54         dodir $(cups-config --serverbin)/backend || die
55         dosym /usr/share/pykota/cupspykota $(cups-config --serverbin)/backend/cupspykota || die
56
57         # extra docs: inits -----------------------------------------
58
59         init_dir="/usr/share/doc/${PF}/initscripts"
60         insinto "${init_dir}"
61         doins -r initscripts/* || die
62
63         # Fixes permissions for bug 155865
64         chmod 700 "${D}"/usr/share/pykota/cupspykota
65
66         for doc in ${DOCS}; do
67                 rm "${D}"/usr/share/doc/${PN}/${doc} || die
68         done
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
72 }