splix-2.0.0_p20130826.ebuild 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils toolchain-funcs
  5. DESCRIPTION="A set of CUPS printer drivers for SPL (Samsung Printer Language) printers"
  6. HOMEPAGE="http://splix.sourceforge.net/"
  7. SRC_URI="https://dev.gentoo.org/~voyageur/distfiles/${P}.tar.bz2
  8. https://dev.gentoo.org/~voyageur/distfiles/samsung-cms-20120312.tar.xz"
  9. LICENSE="GPL-2"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. IUSE="+jbig"
  13. DEPEND=">=app-text/ghostscript-gpl-9.02
  14. >=net-print/cups-1.4.0
  15. jbig? ( media-libs/jbigkit )"
  16. RDEPEND="${DEPEND}"
  17. src_prepare() {
  18. # Move to correct place
  19. mv *.ppd ppd/ || die "ppd files move failed"
  20. # Honor LDFLAGS
  21. sed -e "/[a-z]_LDFLAGS/s/:=.*/:= $\{LDFLAGS\}/" -i module.mk \
  22. || die "module.mk sed failed"
  23. # Correct link comand
  24. sed -e "s/g++/$\{LINKER\}/" -i rules.mk \
  25. || die "rules.mk sed failed"
  26. }
  27. src_compile() {
  28. local options="MODE=optimized"
  29. use jbig || options="${options} DISABLE_JBIG=1"
  30. emake ${options} PSTORASTER=gstoraster CXX="$(tc-getCXX)" \
  31. OPTIM_CFLAGS="${CFLAGS}" OPTIM_CXXFLAGS="${CXXFLAGS}"
  32. }
  33. src_install() {
  34. emake DESTDIR="${D}" install
  35. gzip "${ED}"/$(cups-config --datadir)/model/*/*.ppd || die "ppd gzip failed"
  36. emake DESTDIR="${D}" CMSDIR="${WORKDIR}"/cms MANUFACTURER=samsung installcms
  37. # Add symlinks for xerox and dell models (installed in samsung)
  38. dosym $(cups-config --datadir)/profiles/samsung $(cups-config --datadir)/profiles/xerox
  39. dosym $(cups-config --datadir)/profiles/samsung $(cups-config --datadir)/profiles/dell
  40. }
  41. pkg_postinst() {
  42. ewarn "You *MUST* make sure that the PPD files that CUPS is using"
  43. ewarn "for actually installed printers are updated if you upgraded"
  44. ewarn "from a previous version of splix!"
  45. ewarn "Otherwise you will be unable to print (your printer might"
  46. ewarn "spit out blank pages etc.)."
  47. ewarn "To do that, simply delete the corresponding PPD file in"
  48. ewarn "/etc/cups/ppd/, click on 'Modify Printer' belonging to the"
  49. ewarn "corresponding printer in the CUPS webinterface (usually"
  50. ewarn "reachable via http://localhost:631/) and choose the correct"
  51. ewarn "printer make and model, for example:"
  52. ewarn "'Samsung' -> 'Samsung ML-1610, 1.0 (en)'"
  53. }