mtink-1.0.16-r2.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=6
  4. DESCRIPTION="mtink is a status monitor and inkjet cartridge changer for some Epson printers"
  5. HOMEPAGE="http://xwtools.automatix.de/"
  6. SRC_URI="http://xwtools.automatix.de/files/${P}.tar.gz"
  7. LICENSE="GPL-2"
  8. SLOT="0"
  9. KEYWORDS="~amd64 ~ppc ~sparc ~x86"
  10. IUSE="cups doc X"
  11. DEPEND="X? ( x11-libs/libX11
  12. x11-libs/libXpm
  13. x11-libs/libXt
  14. >=x11-libs/motif-2.3:0 )
  15. cups? ( net-print/cups )
  16. virtual/libusb:0"
  17. RDEPEND="${DEPEND}"
  18. PATCHES=(
  19. "${FILESDIR}/${P}-overflow.patch"
  20. "${FILESDIR}/${P}-flags.patch"
  21. )
  22. src_configure() {
  23. if use X ; then
  24. ./Configure || die
  25. else
  26. ./Configure -x || die
  27. fi
  28. }
  29. src_compile() {
  30. local mytargets
  31. mytargets="ttink detect/askPrinter mtinkd"
  32. if use X; then
  33. mytargets="${mytargets} mtink mtinkc";
  34. fi
  35. export CFLAGS LDFLAGS
  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. }