mtink-1.0.16-r1.ebuild 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=4
  4. inherit eutils base
  5. DESCRIPTION="mtink is a status monitor and inkjet cartridge changer for some Epson printers"
  6. HOMEPAGE="http://xwtools.automatix.de/"
  7. SRC_URI="http://xwtools.automatix.de/files/${P}.tar.gz"
  8. LICENSE="GPL-2"
  9. SLOT="0"
  10. KEYWORDS="amd64 ~ppc ~sparc x86"
  11. IUSE="cups doc X"
  12. DEPEND="X? ( x11-libs/libX11
  13. x11-libs/libXpm
  14. x11-libs/libXt
  15. >=x11-libs/motif-2.3:0 )
  16. cups? ( net-print/cups )
  17. virtual/libusb:0"
  18. RDEPEND="${DEPEND}"
  19. PATCHES=(
  20. "${FILESDIR}/${P}-options.patch"
  21. "${FILESDIR}/${P}-overflow.patch"
  22. )
  23. src_configure() {
  24. if use X ; then
  25. ./Configure || die
  26. else
  27. ./Configure -x || die
  28. fi
  29. }
  30. src_compile() {
  31. local mytargets
  32. mytargets="ttink detect/askPrinter mtinkd"
  33. if use X; then
  34. mytargets="${mytargets} mtink mtinkc";
  35. fi
  36. emake ${mytargets}
  37. }
  38. src_install() {
  39. dobin ttink detect/askPrinter
  40. if use X; then
  41. dobin mtinkc mtink
  42. fi
  43. dosbin mtinkd
  44. newinitd "${FILESDIR}"/mtinkd.rc mtinkd
  45. newconfd "${FILESDIR}"/mtinkd.confd mtinkd
  46. if use cups; then
  47. exeinto /usr/lib/cups/backend
  48. doexe etc/mtink-cups
  49. fi
  50. dodoc README CHANGE.LOG
  51. use doc && \
  52. dohtml html/*.gif html/*.html
  53. }
  54. pkg_postinst() {
  55. # see #70310
  56. chmod 700 /var/mtink /var/run/mtink 2>/dev/null
  57. elog
  58. elog "mtink needs correct permissions to access printer device."
  59. elog "To do this you either need to run the following chmod command:"
  60. elog "chmod 666 /dev/<device>"
  61. elog "or set the suid bit on mtink, mtinkc and ttink in /usr/bin"
  62. elog
  63. }