summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Schweizer <genstef@gentoo.org>2008-03-11 19:44:04 +0000
committerStefan Schweizer <genstef@gentoo.org>2008-03-11 19:44:04 +0000
commitc908865119226f2cda813f6a02e70330d427c850 (patch)
treef99981d4bf058a3152480833a8e5d25189c3ab51 /net-print
parentamd64 stable, bug #212654 (diff)
downloadgentoo-2-c908865119226f2cda813f6a02e70330d427c850.tar.gz
gentoo-2-c908865119226f2cda813f6a02e70330d427c850.tar.bz2
gentoo-2-c908865119226f2cda813f6a02e70330d427c850.zip
version bump many thanks to roger <roger@eskimo.com> in bug 211480
(Portage version: 2.1.4.4)
Diffstat (limited to 'net-print')
-rw-r--r--net-print/foo2zjs/ChangeLog11
-rw-r--r--net-print/foo2zjs/files/foo2zjs-Makefile-20080225.diff185
-rw-r--r--net-print/foo2zjs/files/foo2zjs-udevfwld-20080225.diff232
-rw-r--r--net-print/foo2zjs/foo2zjs-20080225.ebuild108
4 files changed, 534 insertions, 2 deletions
diff --git a/net-print/foo2zjs/ChangeLog b/net-print/foo2zjs/ChangeLog
index 8a2326c81d34..3c8246b90e54 100644
--- a/net-print/foo2zjs/ChangeLog
+++ b/net-print/foo2zjs/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for net-print/foo2zjs
-# Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-print/foo2zjs/ChangeLog,v 1.31 2007/12/14 17:21:57 kingtaco Exp $
+# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-print/foo2zjs/ChangeLog,v 1.32 2008/03/11 19:44:03 genstef Exp $
+
+*foo2zjs-20080225 (11 Mar 2008)
+
+ 11 Mar 2008; Stefan Schweizer <genstef@gentoo.org>
+ +files/foo2zjs-Makefile-20080225.diff,
+ +files/foo2zjs-udevfwld-20080225.diff, +foo2zjs-20080225.ebuild:
+ version bump many thanks to roger <roger@eskimo.com> in bug 211480
14 Dec 2007; Mike Doty <kingtaco@gentoo.org> ChangeLog:
regen digest, bug 201396
diff --git a/net-print/foo2zjs/files/foo2zjs-Makefile-20080225.diff b/net-print/foo2zjs/files/foo2zjs-Makefile-20080225.diff
new file mode 100644
index 000000000000..e528f0e0da46
--- /dev/null
+++ b/net-print/foo2zjs/files/foo2zjs-Makefile-20080225.diff
@@ -0,0 +1,185 @@
+diff -Nur foo2zjs.orig/Makefile foo2zjs/Makefile
+--- foo2zjs.orig/Makefile 2008-02-16 05:58:26.000000000 -0900
++++ foo2zjs/Makefile 2008-02-25 20:50:15.000000000 -0900
+@@ -17,7 +17,7 @@
+
+ # Installation prefix...
+ PREFIX=/usr/local
+-PREFIX=/usr
++PREFIX=$(DESTDIR)/usr
+
+ # Pathnames for this package...
+ BIN=$(PREFIX)/bin
+@@ -34,7 +34,7 @@
+ INSTALL=install
+
+ # Pathnames for referenced packages...
+-FOODB=/usr/share/foomatic/db/source
++FOODB=$(PREFIX)/share/foomatic/db/source
+
+ # User ID's
+ LPuid=-olp
+@@ -245,7 +245,7 @@
+ endif
+
+ # Compiler flags
+-CFLAGS += -O2 -Wall
++CFLAGS ?= -O2 -Wall
+ #CFLAGS += -g
+
+ #
+@@ -537,12 +537,14 @@
+ UDEVBIN=/bin/
+
+ install-prog:
++ [ -d $(BIN) ] || install -d -m 755 $(BIN)/
++ [ -d $(DESTDIR)/bin/ ] || install -d -m 755 $(DESTDIR)/bin/
+ #
+ # Install driver, wrapper, and development tools
+ #
+ $(INSTALL) -c $(PROGS) $(SHELLS) $(BIN)/
+ if [ "$(BINPROGS)" != "" ]; then \
+- $(INSTALL) -c $(BINPROGS) $(UDEVBIN); \
++ install -c $(BINPROGS) $(DESTDIR)/bin/; \
+ fi
+ #
+ # Install gamma correction files. These are just templates,
+@@ -575,6 +577,7 @@
+ #
+ @if [ -d $(FOODB) ]; then \
+ for dir in driver printer opt; do \
++ [ -d $(FOODB)/$$dir/ ] || install -d -m 755 $(FOODB)/$$dir/; \
+ echo install -m 644 foomatic-db/$$dir/*.xml $(FOODB)/$$dir/; \
+ $(INSTALL) -c -m 644 foomatic-db/$$dir/*.xml $(FOODB)/$$dir/; \
+ done \
+@@ -592,10 +595,10 @@
+ #
+ # Clear foomatic cache and rebuild database if needed
+ #
+- rm -rf /var/cache/foomatic/*/*
+- rm -f /var/cache/foomatic/printconf.pickle
+- if [ -d /var/cache/foomatic/compiled ]; then \
+- cd /var/cache/foomatic/compiled; \
++ rm -rf $(DESTDIR)/var/cache/foomatic/*/*
++ rm -f $(DESTDIR)/var/cache/foomatic/printconf.pickle
++ if [ -d $(DESTDIR)/var/cache/foomatic/compiled ]; then \
++ cd $(DESTDIR)/var/cache/foomatic/compiled; \
+ foomatic-combo-xml -O >overview.xml; \
+ fi
+
+@@ -709,9 +712,9 @@
+ fi; \
+ done
+
+-MODEL=/usr/share/cups/model
++MODEL=$(PREFIX)/share/cups/model
+ LOCALMODEL=/usr/local/share/cups/model
+-PPD=/usr/share/ppd
++PPD=$(PREFIX)/share/ppd
+ VARPPD=/var/lp/ppd
+ install-ppd:
+ #
+@@ -727,13 +730,6 @@
+ done; \
+ ppdmgr -u; \
+ elif [ -d $(PPD) ]; then \
+- find $(PPD) -name '*foo2zjs*' | xargs rm -rf; \
+- find $(PPD) -name '*foo2hp*' | xargs rm -rf; \
+- find $(PPD) -name '*foo2xqx*' | xargs rm -rf; \
+- find $(PPD) -name '*foo2lava*' | xargs rm -rf; \
+- find $(PPD) -name '*foo2qpdl*' | xargs rm -rf; \
+- find $(PPD) -name '*foo2slx*' | xargs rm -rf; \
+- find $(PPD) -name '*foo2hiperc*' | xargs rm -rf; \
+ [ -d $(PPD)/foo2zjs ] || mkdir $(PPD)/foo2zjs; \
+ cd PPD; \
+ for ppd in *.ppd; do \
+@@ -752,9 +748,9 @@
+ done; \
+ fi
+
+-APPL=/usr/share/applications
+-OLDAPPL=/usr/share/gnome/apps/System
+-PIXMAPS=/usr/share/pixmaps
++APPL=$(PREFIX)/usr/share/applications
++OLDAPPL=$(PREFIX)/usr/share/gnome/apps/System
++PIXMAPS=$(PREFIX)/usr/share/pixmaps
+ install-desktop:
+ #
+ # Install GNOME desktop
+@@ -777,10 +773,8 @@
+ $(INSTALL) -c -m 755 hplj10xx_gui.tcl $(SHAREZJS)
+
+
+-USBDIR=/etc/hotplug/usb
+-UDEVDIR=/etc/udev/rules.d
+-RULES=hplj10xx.rules
+-install-hotplug: install-hotplug-test install-hotplug-prog
++USBDIR=$(DESTDIR)/etc/hotplug/usb
++install-hotplug: install-hotplug-test install-udev
+
+ install-hotplug-test:
+ #
+@@ -798,9 +792,6 @@
+ #
+
+ install-hotplug-prog:
+- if [ -d $(UDEVDIR) ]; then \
+- $(INSTALL) -c -m 644 $(RULES) $(UDEVDIR)/11-$(RULES); \
+- fi
+ [ -d $(USBDIR) ] || $(INSTALL) -d -m 755 $(USBDIR)/
+ $(INSTALL) -c -m 755 hplj1000 $(USBDIR)/
+ ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hplj1005
+@@ -809,13 +800,13 @@
+ ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1005
+ ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1006
+ ln -sf $(USBDIR)/hplj1000 $(USBDIR)/hpljP1505
+- $(USBDIR)/hplj1000 install-usermap
+- $(USBDIR)/hplj1005 install-usermap
+- $(USBDIR)/hplj1018 install-usermap
+- $(USBDIR)/hplj1020 install-usermap
+- $(USBDIR)/hpljP1005 install-usermap
+- $(USBDIR)/hpljP1006 install-usermap
+- $(USBDIR)/hpljP1505 install-usermap
++ install -c -m 644 hplj.usermap $(USBDIR)/
++
++UDEVDIR=$(DESTDIR)/etc/udev/rules.d
++RULES=hplj10xx.rules
++install-udev:
++ [ -d $(UDEVDIR) ] || install -d -m 755 $(UDEVDIR)/
++ install -c -m 644 $(RULES) $(UDEVDIR)/11-$(RULES)
+
+ cups: FRC
+ if [ -x /etc/init.d/cups ]; then \
+@@ -1169,7 +1160,6 @@
+ $(INSTALL) -c -m 644 README $(DOCDIR)
+ $(INSTALL) -c -m 644 ChangeLog $(DOCDIR)
+
+-GROFF=/usr/local/test/bin/groff
+ GROFF=groff
+ manual.pdf: $(MANPAGES)
+ -$(GROFF) -t -man $(MANPAGES) | ps2pdf - $@
+diff -Nur foo2zjs.orig/hplj.usermap foo2zjs/hplj.usermap
+--- foo2zjs.orig/hplj.usermap 1969-12-31 14:00:00.000000000 -1000
++++ foo2zjs/hplj.usermap 2008-02-25 20:49:33.000000000 -0900
+@@ -0,0 +1,4 @@
++hplj1000 0x0003 0x03f0 0x0517 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
++hplj1005 0x0003 0x03f0 0x1317 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
++hplj1018 0x0003 0x03f0 0x4117 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
++hplj1020 0x0003 0x03f0 0x2b17 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
+diff -Nur foo2zjs.orig/icc2ps/Makefile foo2zjs/icc2ps/Makefile
+--- foo2zjs.orig/icc2ps/Makefile 2007-11-27 12:13:53.000000000 -0900
++++ foo2zjs/icc2ps/Makefile 2008-02-25 20:49:33.000000000 -0900
+@@ -1,11 +1,11 @@
+ UNAME := $(shell uname)
+-PREFIX= /usr
++PREFIX= $(DESTDIR)/usr
+ BIN= $(PREFIX)/bin
+ SRC= icc2ps.c xgetopt.c
+ LIB= cmscam97.c cmscnvrt.c cmserr.c cmsgamma.c cmsgmt.c cmsintrp.c cmsio1.c \
+ cmslut.c cmsmatsh.c cmsmtrx.c cmsnamed.c cmspack.c cmspcs.c cmsps2.c \
+ cmssamp.c cmswtpnt.c cmsxform.c cmsio0.c cmsvirt.c
+-CFLAGS= -O3
++CFLAGS?= -O3
+ INSTALL=install
+ ifeq ($(UNAME),SunOS)
+ INSTALL=/usr/ucb/install
diff --git a/net-print/foo2zjs/files/foo2zjs-udevfwld-20080225.diff b/net-print/foo2zjs/files/foo2zjs-udevfwld-20080225.diff
new file mode 100644
index 000000000000..d5c1e5ee87b1
--- /dev/null
+++ b/net-print/foo2zjs/files/foo2zjs-udevfwld-20080225.diff
@@ -0,0 +1,232 @@
+diff -Nur foo2zjs.orig/Makefile foo2zjs/Makefile
+--- foo2zjs.orig/Makefile 2008-02-25 20:10:06.000000000 -0900
++++ foo2zjs/Makefile 2008-02-25 20:17:15.000000000 -0900
+@@ -19,6 +19,10 @@
+ PREFIX=/usr/local
+ PREFIX=$(DESTDIR)/usr
+
++# USB_PRINTERID is also installed there because it is needed by the FWloader
++FWLOADERDIR=$(DESTDIR)/sbin
++FIRMWAREDIR=$(DESTDIR)/lib/firmware
++
+ # Pathnames for this package...
+ BIN=$(PREFIX)/bin
+ SHAREZJS=$(PREFIX)/share/foo2zjs
+@@ -652,21 +656,21 @@
+ fi; \
+ done
+ # foo2zjs Firmware files (if any)
+- $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREZJS)/firmware/
++ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(FIRMWAREDIR)/
+ for i in sihp1*.img; do \
+ if [ -f $$i ]; then \
+ base=`basename $$i .img`; \
+ ./arm2hpdl $$i >$$base.dl; \
+- $(INSTALL) -c -m 644 $$base.dl $(SHAREZJS)/firmware/; \
++ $(INSTALL) -c -m 644 $$base.dl $(FIRMWAREDIR)/; \
+ fi; \
+ done
+ # foo2xqx Firmware files (if any)
+- $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(SHAREXQX)/firmware/
++ $(INSTALL) $(LPuid) $(LPgid) -m 775 -d $(FIRMWAREDIR)/
+ for i in sihpP*.img; do \
+ if [ -f $$i ]; then \
+ base=`basename $$i .img`; \
+ ./arm2hpdl $$i >$$base.dl; \
+- $(INSTALL) -c -m 644 $$base.dl $(SHAREXQX)/firmware/; \
++ $(INSTALL) -c -m 644 $$base.dl $(FIRMWAREDIR)/; \
+ fi; \
+ done
+ # foo2oak ICM files (if any)
+@@ -805,6 +809,8 @@
+ UDEVDIR=$(DESTDIR)/etc/udev/rules.d
+ RULES=hplj10xx.rules
+ install-udev:
++ [ -d $(FWLOADERDIR) ] || install -d -m 755 $(FWLOADERDIR)/
++ install -c -m 755 foo2zjs-loadfw $(FWLOADERDIR)/
+ [ -d $(UDEVDIR) ] || install -d -m 755 $(UDEVDIR)/
+ install -c -m 644 $(RULES) $(UDEVDIR)/11-$(RULES)
+
+diff -Nur foo2zjs.orig/foo2zjs-loadfw foo2zjs/foo2zjs-loadfw
+--- foo2zjs.orig/foo2zjs-loadfw 1969-12-31 14:00:00.000000000 -1000
++++ foo2zjs/foo2zjs-loadfw 2008-02-25 20:09:13.000000000 -0900
+@@ -0,0 +1,127 @@
++#!/bin/sh
++
++# foo2zjs-loadfw:
++#
++# Hotplug script for HP1000/1005/1020 USB laser printers. The model number
++# that this script deals with is determined from the udev env.
++#
++# Used to download firmware automatically into the printer when it
++# is powered up or plugged into the USB port.
++#
++# The inspiration fo this script is from:
++# Oscar Santacreu. Alicante-Spain (2002)
++# Mike Morgan (2004)
++# Modified by Stefan Schweizer (2005) to work as a udev-RUN-script
++
++#
++# Directory to find downloadable HP firmware files sihpMMMM.dl
++#
++FWDIR=/lib/firmware
++
++#
++# Program used to determine USB id information
++#
++USBID=/bin/usb_printerid
++
++#
++# Timeout to load firmware
++#
++TIMEOUT=6
++
++#
++# Figure out how to log our messages
++#
++if [ -t 1 ]; then
++ # Running from a tty...
++ log() {
++ echo "$0: $@"
++ }
++elif [ -x /usr/bin/logger ]; then
++ # Have logger...
++ log() {
++ logger -t "$0" -- "$@"
++ }
++else
++ # No logger...
++ log() {
++ echo "$0: $@" >> /var/log/messages
++ }
++fi
++
++#
++# Figure out the model number from the name of this script
++#
++case "$1" in
++1000)
++ MODEL=1000
++ MODELNAME="hp LaserJet $MODEL"
++ ;;
++1005)
++ MODEL=1005
++ MODELNAME="hp LaserJet $MODEL"
++ ;;
++1018)
++ MODEL=1018
++ MODELNAME="HP LaserJet $MODEL"
++ ;;
++1020)
++ MODEL=1020
++ MODELNAME="HP LaserJet $MODEL"
++ ;;
++*)
++ log "Only HP LaserJet 1000, 1005, 1018 and 1020 are supported"
++ log "You need to supply one of these on the cmdline: $0 10**"
++ exit
++ ;;
++esac
++
++if [ -n "$2" ]; then
++ DEVNAME=$2
++elif [ -n "$DEVNAME" ]; then
++ log 'using $DEVNAME'
++else
++ log "You need to either have $DEVNAME set in the environment or supply it on the cmdline, like:"
++ log "$0 10** /dev/usb/lp0"
++ exit 1
++fi
++
++#
++# Procedure to load a single device with firmware
++#
++load1() {
++ fw="$FWDIR/sihp$MODEL.dl"
++ if [ ! -f "$fw" ]; then
++ log "Missing HP LaserJet $MODEL firmware file $fw"
++ log "...read foo2zjs installation instructions and run ./getweb $MODEL"
++ return 1
++ fi
++
++ log "loading HP LaserJet $MODEL firmware $fw to $DEVNAME ..."
++ if cat $fw > $DEVNAME; then
++ sleep $TIMEOUT
++ log "... download successful."
++ else
++ log "... download failed."
++ fi
++ return 0
++}
++
++#
++# OK, now download firmware to any printers that need it
++#
++if [ -x $USBID ]; then
++ if $USBID $DEVNAME | grep "$MODELNAME" 2> /dev/null; then
++ # This is a LaserJet 100x
++ if $USBID $DEVNAME | grep 'FWVER' 2> /dev/null; then
++ log "HP LaserJet $MODEL firmware already loaded into $DEVNAME"
++ else
++ # Firmware is not yet loaded
++ load1 "$DEVNAME"
++ fi
++ else
++ log "No supported printer found."
++ fi
++else
++ log "HP LaserJet $MODEL firmware was not downloaded..."
++ log "...couldn't find $USBID"
++fi
+diff -Nur foo2zjs.orig/hplj1000 foo2zjs/hplj1000
+--- foo2zjs.orig/hplj1000 2007-11-25 02:55:09.000000000 -0900
++++ foo2zjs/hplj1000 2008-02-25 20:09:13.000000000 -0900
+@@ -35,7 +35,7 @@
+ #
+ # Directory to find downloadable HP firmware files sihpMMMM.dl
+ #
+-FWDIR=/usr/share/foo2zjs/firmware
++FWDIR=/lib/firmware
+
+ #
+ # Program used to determine USB printer id information
+diff -Nur foo2zjs.orig/hplj10xx.rules foo2zjs/hplj10xx.rules
+--- foo2zjs.orig/hplj10xx.rules 2007-11-24 22:15:34.000000000 -0900
++++ foo2zjs/hplj10xx.rules 2008-02-25 20:18:19.000000000 -0900
+@@ -1,28 +1,8 @@
+-#Own udev rule for HP Laserjet 1000
+-KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+- SYSFS{product}=="hp LaserJet 1000", NAME="usb/%k", \
+- SYMLINK+="hplj1000-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1000"
+-#Own udev rule for HP Laserjet 1005
+-KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+- SYSFS{product}=="hp LaserJet 1005 series", NAME="usb/%k", \
+- SYMLINK+="hplj1005-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1005"
+-#Own udev rule for HP Laserjet 1018
+-KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+- SYSFS{product}=="HP LaserJet 1018", NAME="usb/%k", \
+- SYMLINK+="hplj1018-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1018"
+-#Own udev rule for HP Laserjet 1020
+-KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+- SYSFS{product}=="HP LaserJet 1020", NAME="usb/%k", \
+- SYMLINK+="hplj1020-%n", MODE="0666", RUN+="/etc/hotplug/usb/hplj1020"
+-#Own udev rule for HP Laserjet P1005
+-KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+- SYSFS{product}=="HP LaserJet P1005", NAME="usb/%k", \
+- SYMLINK+="hpljP1005-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1005"
+-#Own udev rule for HP Laserjet P1006
+-KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+- SYSFS{product}=="HP LaserJet P1006", NAME="usb/%k", \
+- SYMLINK+="hpljP1006-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1006"
+-#Own udev rule for HP Laserjet P1505
+-KERNEL=="lp*", BUS=="usb", SYSFS{idVendor}=="03f0", \
+- SYSFS{product}=="HP LaserJet P1505", NAME="usb/%k", \
+- SYMLINK+="hpljP1505-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1505"
++ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
++ ATTRS{idProduct}=="0517", RUN+="/sbin/foo2zjs-loadfw 1000 $tempnode"
++ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
++ ATTRS{idProduct}=="1317", RUN+="/sbin/foo2zjs-loadfw 1005 $tempnode"
++ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
++ ATTRS{idProduct}=="4117", RUN+="/sbin/foo2zjs-loadfw 1018 $tempnode"
++ACTION=="add", KERNEL=="lp*", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \
++ ATTRS{idProduct}=="2b17", RUN+="/sbin/foo2zjs-loadfw 1020 $tempnode"
diff --git a/net-print/foo2zjs/foo2zjs-20080225.ebuild b/net-print/foo2zjs/foo2zjs-20080225.ebuild
new file mode 100644
index 000000000000..da2befd822a1
--- /dev/null
+++ b/net-print/foo2zjs/foo2zjs-20080225.ebuild
@@ -0,0 +1,108 @@
+# Copyright 1999-2008 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-print/foo2zjs/foo2zjs-20080225.ebuild,v 1.1 2008/03/11 19:44:03 genstef Exp $
+
+inherit eutils
+
+DESCRIPTION="Support for printing to ZjStream-based printers"
+HOMEPAGE="http://foo2zjs.rkkda.com/"
+
+# extracted by http://gentooexperimental.org/~genstef/dist/foo2zjs-helper.sh
+DEVICES=( "hp2600n" "hp1600" "hp1500" "km2530" "km2490" "km2480" "xp6115"
+"km2430" "km2300" "km2200" "kmcpwl" "sa300" "sa2160" "sa3160" "xp6110" "lm500"
+"hp1020" "hp1018" "hp1005" "hp1000" )
+URIS=(
+"http://foo2hp.rkkda.com/icm/hpclj2600n.tar.gz
+http://foo2zjs.rkkda.com/icm/km2430.tar.gz"
+"http://foo2hp.rkkda.com/icm/hpclj2600n.tar.gz
+http://foo2zjs.rkkda.com/icm/km2430.tar.gz"
+"http://foo2hp.rkkda.com/icm/hpclj2600n.tar.gz
+http://foo2zjs.rkkda.com/icm/km2430.tar.gz"
+"http://foo2lava.rkkda.com/icm/km2530.tar.gz"
+"http://foo2lava.rkkda.com/icm/km2530.tar.gz"
+"http://foo2lava.rkkda.com/icm/km2530.tar.gz"
+"http://foo2lava.rkkda.com/icm/km2530.tar.gz"
+"http://foo2zjs.rkkda.com/icm/km2430.tar.gz"
+"ftp://ftp.minolta-qms.com/pub/crc/out_going/win/m23dlicc.exe
+http://foo2zjs.rkkda.com/icm/km2430.tar.gz"
+"ftp://ftp.minolta-qms.com/pub/crc/out_going/win2000/m22dlicc.exe"
+"ftp://ftp.minolta-qms.com/pub/crc/out_going/windows/cpplxp.exe"
+"http://foo2qpdl.rkkda.com/icm/samclp300.tar.gz"
+"http://foo2qpdl.rkkda.com/icm/samclp300.tar.gz"
+"http://foo2qpdl.rkkda.com/icm/samclp300.tar.gz"
+"http://foo2qpdl.rkkda.com/icm/samclp300.tar.gz"
+"http://foo2slx.rkkda.com/icm/lexc500.tar.gz"
+"http://foo2zjs.rkkda.com/firmware/sihp1020.tar.gz"
+"http://foo2zjs.rkkda.com/firmware/sihp1018.tar.gz"
+"http://foo2zjs.rkkda.com/firmware/sihp1005.tar.gz"
+"http://foo2zjs.rkkda.com/firmware/sihp1000.tar.gz"
+)
+
+SRC_URI="http://gentooexperimental.org/~genstef/dist/${P}.tar.gz"
+IUSE="cups foomaticdb usb"
+for ((DEV=0; DEV < ${#DEVICES[*]}; DEV++)); do
+ SRC_URI="${SRC_URI} foo2zjs_devices_${DEVICES[DEV]}? ( ${URIS[DEV]} )"
+ IUSE="${IUSE} foo2zjs_devices_${DEVICES[DEV]}"
+ ALL_BEGIN="${ALL_BEGIN} !foo2zjs_devices_${DEVICES[DEV]}? ("
+ ALL_MIDDLE="${ALL_MIDDLE} ${URIS[DEV]}"
+ ALL_END="${ALL_END} )"
+done
+SRC_URI="${SRC_URI}${ALL_BEGIN}${ALL_MIDDLE}${ALL_END}"
+RESTRICT="mirror"
+LICENSE="GPL-2"
+SLOT="0"
+DEPEND="app-arch/unzip"
+RDEPEND="cups? ( net-print/cups )
+ foomaticdb? ( net-print/foomatic-db-engine )
+ net-print/foomatic-filters
+ sys-fs/udev"
+KEYWORDS="~x86 ~amd64 ~ppc"
+S=${WORKDIR}/${PN}
+
+src_unpack() {
+ unpack ${P}.tar.gz
+
+ # link getweb files in ${S} to get unpacked
+ for i in ${A}
+ do
+ ln -s ${DISTDIR}/${i} ${S}
+ done
+
+ cd ${S}
+ epatch ${FILESDIR}/foo2zjs-Makefile-20080225.diff
+ epatch ${FILESDIR}/foo2zjs-udevfwld-20080225.diff
+}
+
+src_compile() {
+ emake getweb || die "Failed building getweb script"
+
+ # remove wget as we got the firmware with portage
+ sed -i -e "s/.*wget .*//" \
+ -e 's/.*rm $.*//' \
+ -e "s/error \"Couldn't dow.*//" getweb
+
+ # unpack files
+ GOT=0;
+ for ((DEV=0; DEV < ${#DEVICES[*]}; DEV++)); do
+ if use foo2zjs_devices_${DEVICES[DEV]}; then
+ ./getweb ${DEVICES[DEV]:2}
+ GOT=1
+ fi
+ done
+ if [ ${GOT} == 0 ]; then ./getweb all; fi
+
+ emake || die "emake failed"
+}
+
+src_install() {
+ use foomaticdb && dodir /usr/share/foomatic/db/source
+
+ use cups && dodir /usr/share/cups/model
+
+ emake DESTDIR=${D} install install-udev \
+ || die "emake install failed"
+}
+
+pkg_postinst() {
+ udevcontrol reload_rules
+}