# Copyright 1999-2007 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: $ inherit eutils DESCRIPTION="Ebuild wrapper for Samsung SCX/MFP unified binary drivers." HOMEPAGE="http://samsung.com/Products/PrinterandMultifunction/MultifunctionProducts" SRC_URI="http://org.downloadcenter.samsung.com/downloadfile/ContentsFile.aspx?CDSite=us&CttFileID=801111&CDCttType=DR&ModelType=N&ModelName=SCX-4521F&VPath=DR/200707/20070720165133984_UnifiedLinuxDriver.tar.gz fix-nopar? ( http://jacobo.tarrio.org/files/soft/scx/fix-nopar-scx4200-2.00.92-2007011301.tar.gz )" # Is license really as-is? LICENSE="as-is" SLOT="0" KEYWORDS="~x86 ~amd64 -*" IUSE="fix-nopar scanner X kde gnome" # Possibly we need qt3 here for gui tools? # No compilation, so DEPEND is empty? Or due to use dirs move cups and sane-backends to DEPEND? DEPEND="" RDEPEND="net-print/cups scanner? ( media-gfx/sane-backends ) virtual/ghostscript x86? ( sys-libs/lib-compat ) amd64? ( app-emulation/emul-linux-x86-compat )" RESTRICT="${RESTRICT} strip" # I think this FIXMEs from original ebuild are not needed #FIXME: add support for lprng/foomatic? still needs cups since raster* bins are linked against it #FIXME: add support for their kernel modules pkg_setup() { einfo "Here we have 2 main USE flags:" einfo "fix-nopar - binary patch to not try to open parallel port" einfo " without this patch non-root user got SegmentationFault with USB models" einfo "scanner - enables scanner drivers installation for MFP" einfo "Also, companion files are only installed if one of X, kde or gnome USE flags enabled" einfo if ! use scanner then ewarn ewarn "Are you sure you want to merge MFP drivers without scanner support?" ewarn "If it is not so, break current process and enable scanner use flag" ewarn ebeep 5 fi } src_install() { if [ "${ARCH}" == "x86" ]; then MFP_ARCH="i386" LIBDIR="lib" else MFP_ARCH="x86_64" LIBDIR="lib64" fi cd ${WORKDIR} # Common files if use fix-nopar then dolib.so fix-nopar/${MFP_ARCH}/libmfp.so.1.0.1 else dolib.so cdroot/Linux/${MFP_ARCH}/at_root/usr/${LIBDIR}/libmfp.so.1.0.1 fi dosym libmfp.so.1.0.1 /usr/lib/libmfp.so.1 dosym libmfp.so.1.0.1 /usr/lib/libmfp.so # or dohtml this htm? dodoc cdroot/Linux/Installer.htm if use X || use gnome || use kde then # Companion binary files insinto /opt/samsung/mfp/share doins cdroot/Linux/OEM.ini exeinto /opt/samsung/mfp/lib doexe cdroot/Linux/${MFP_ARCH}/at_opt/lib/* exeinto /opt/samsung/mfp/libexec doexe cdroot/Linux/${MFP_ARCH}/at_opt/bin/* # LD_LIBRARY_PATH wrapper exeinto /opt/samsung/mfp/bin doexe ${FILESDIR}/samsung-mfp-wrap #dosym /opt/samsung/mfp/bin/samsung-mfp-wrap /opt/bin/Configurator #dosym /opt/samsung/mfp/bin/samsung-mfp-wrap /opt/bin/shhv dosym samsung-mfp-wrap /opt/samsung/mfp/bin/Configurator dosym samsung-mfp-wrap /opt/samsung/mfp/bin/shhv # desktop files #MY_DESCRIPTION=${DESCRIPTION} #DESCRIPTION="Manage your printers and scanners here" #make_desktop_entry Configurator "Samsung Unified Driver Configurator" /opt/samsung/mfp/share/images/Configurator.png "System;X-Samsung-Config-UD" #DESCRIPTION="HTML help viewer utility" #make_desktop_entry shhv "Samsung Unified Driver Help" /opt/samsung/mfp/share/images/HelpViewer.png "System;X-Samsung-Config-UD" #DESCRIPTION="Order Toner Cartridge Online" #make_desktop_entry " http://www.dell.com/supplies" "Dell Toner Reorder" /opt/samsung/mfp/share/images/TonerReorder.png "System;X-Samsung-Config-UD;" #DESCRIPTION=${MY_DESCRIPTION} insinto /usr/share/applications doins ${FILESDIR}/samsung-mfp-bin-Configurator.desktop doins ${FILESDIR}/samsung-mfp-bin-HelpViewer.desktop doins ${FILESDIR}/samsung-mfp-bin-TonerReorder.desktop fi # Help insinto /opt/samsung/mfp/share doins cdroot/Linux/noarch/at_opt/share/VERSION* doins cdroot/Linux/noarch/at_opt/share/about* insinto /opt/samsung/mfp/share/help doins cdroot/Linux/noarch/at_opt/share/help/* # Images insinto /opt/samsung/mfp/share/images doins cdroot/Linux/noarch/at_opt/share/images/* # Printer files #cdroot/Linux/${MFP_ARCH}/at_root/usr/${LIBDIR}/cups => /usr/libexec/cups # here we have backend/mfp and # filter/{pscms,rastertosamsungpcl,rastertosamsungspl,rastertosamsungsplc} dodir /usr/libexec/cups cp -dapr cdroot/Linux/${MFP_ARCH}/at_root/usr/${LIBDIR}/cups ${D}/usr/libexec #exeinto /usr/libexec #doexe -r cdroot/Linux/${MFP_ARCH}/at_root/usr/${LIBDIR}/cups # If it is really unified driver we should copy defanitions for all supported devices #cdroot/Linux/noarch/at_opt/share/ppd/scx4200.ppd => /usr/share/cups/model #insinto /usr/share/cups/model #doins cdroot/Linux/noarch/at_opt/share/ppd/scx4200.ppd insinto /usr/share/cups/model/samsung doins cdroot/Linux/noarch/at_opt/share/ppd/*.ppd insinto /usr/share/cups/model/samsung/cms doins cdroot/Linux/noarch/at_opt/share/ppd/cms/* if use scanner then exeinto /usr/lib/sane doexe cdroot/Linux/${MFP_ARCH}/at_root/usr/${LIBDIR}/sane/libsane-smfp.so.1.0.1 dosym libsane-smfp.so.1.0.1 /usr/lib/sane/libsane-smfp.so.1 dosym libsane-smfp.so.1.0.1 /usr/lib/sane/libsane-smfp.so insinto /etc/sane.d doins cdroot/Linux/noarch/at_root/etc/sane.d/smfp.conf # code from samsung install.sh # we may use it, but better let user enable needed scanner by hands # as it was done in original ebuild (see src_postinstall()). #if ! grep -q '^smfp$' /etc/sane.d/dll.conf #then # dodir /etc/sane.d # cp -dapr /etc/sane.d/dll.conf ${D}/etc/sane.d/dll.conf # echo "smfp" >> ${D}/etc/sane.d/dll.conf # Here they comment out geniusvp2 backend. If it is really needed we can # copy those code here #fi fi # also there is a lot of other stuff there, but I don't know what for all of # them, so I don't install it cdroot/Linux/${MFP_ARCH}/at_opt/bin/Configurator # says while running "WARNING: configuration file not found" but I don't know # what this configurator for, so also don't install it } pkg_postinst() { if use scanner then elog "To enable scanning, add the proper line to /etc/sane.d/dll.conf (smfp)." elog "Also, Samsung original installation script disables geniusvp2 backend." elog "So, if it is enabled in your dll.conf and there are some problems try" elog "to disable it (comment it with #)." fi elog "Make sure that the user has permissions to access /dev/usb/lp0." elog "Usually, user should be added to lp group: usermod -a -G lp username" elog if use X || use gnome || use kde then elog "Also, notice that companion files are now installed. If someone detects their" elog "malfunctioning caused by non-samsung installer, please report them to Gentoo bugzilla" elog "via http://bugs.gentoo.org/show_bug.cgi?id=139715" elog fi elog "Your product can be registered as usual via" elog "http://www.samsung.com/Products/Printer/Registration/Printer_regist.htm" }