pykota-1.26-r1.ebuild 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. PYTHON_COMPAT=( python2_7 )
  5. PYTHON_REQ_USE='sqlite?'
  6. inherit distutils-r1
  7. DESCRIPTION="Flexible print quota and accounting package for use with CUPS and lpd"
  8. HOMEPAGE="http://www.pykota.com"
  9. SRC_URI="https://dev.gentoo.org/~dilfridge/distfiles/${P}.tar.xz"
  10. LICENSE="GPL-2"
  11. SLOT="0"
  12. KEYWORDS="~amd64 ~x86"
  13. IUSE="ldap mysql postgres snmp sqlite xml"
  14. RDEPEND="
  15. dev-python/egenix-mx-base[${PYTHON_USEDEP}]
  16. net-print/pkpgcounter[${PYTHON_USEDEP}]
  17. dev-python/chardet[${PYTHON_USEDEP}]
  18. dev-python/pkipplib[${PYTHON_USEDEP}]
  19. ldap? ( dev-python/python-ldap[${PYTHON_USEDEP}] )
  20. mysql? ( dev-python/mysql-python[${PYTHON_USEDEP}] )
  21. postgres? ( dev-db/postgresql[server] dev-python/pygresql[${PYTHON_USEDEP}] )
  22. snmp? ( net-analyzer/net-snmp dev-python/pysnmp[${PYTHON_USEDEP}] )
  23. xml? ( dev-python/jaxml[${PYTHON_USEDEP}] )"
  24. # CUPS required because of cups-config call, #563402
  25. DEPEND="${RDEPEND}
  26. net-print/cups"
  27. python_prepare_all() {
  28. sed -i -e 's:from pysqlite2 import dbapi2:import sqlite3:' \
  29. pykota/storages/sqlitestorage.py || die
  30. distutils-r1_python_prepare_all
  31. }
  32. python_install_all() {
  33. local DOCS=()
  34. distutils-r1_python_install_all
  35. dodir /etc/${PN}
  36. # cups backend ----------------------------------------------
  37. dodir "$(cups-config --serverbin)/backend"
  38. dosym "${EPREFIX}"/usr/share/pykota/cupspykota \
  39. "$(cups-config --serverbin)/backend/cupspykota"
  40. # extra docs: inits -----------------------------------------
  41. init_dir="/usr/share/doc/${PF}/initscripts"
  42. insinto "${init_dir}"
  43. doins -r initscripts/*
  44. # Fixes permissions for bug 155865
  45. fperms 0700 /usr/share/pykota/cupspykota || die
  46. rm "${ED%/}"/usr/share/doc/${PN}/{LICENSE,COPYING} || die
  47. mv "${ED%/}"/usr/share/doc/{${PN},${PF}} || die
  48. }