diff options
author | Ivan Shapovalov | 2016-10-23 10:39:44 +0300 |
---|---|---|
committer | Ivan Shapovalov | 2016-10-23 10:39:44 +0300 |
commit | 708b0af517fe496e892757d2b1eb66412f0e69eb (patch) | |
tree | 1b889562d3484e28ae694a21b2a2568d2a5fedac | |
parent | cc6d59e67e284fdc277cdc003d9c74320b33d0ac (diff) | |
download | aur-708b0af517fe496e892757d2b1eb66412f0e69eb.tar.gz |
Finally fix new hotplug implementation
-rw-r--r-- | .SRCINFO | 20 | ||||
-rw-r--r-- | 0001-Makefile-DESTDIR-support.patch | 2 | ||||
-rw-r--r-- | 0002-Makefile-general-fixes.patch | 96 | ||||
-rw-r--r-- | 0003-Rework-firmware-loading.patch | 180 | ||||
-rw-r--r-- | 0004-Makefile-fix-generating-.ppd-in-place.patch (renamed from 0005-Makefile-fix-generating-.ppd-in-place.patch) | 8 | ||||
-rw-r--r-- | 0004-Makefile-skip-installing-Foomatic-files.patch | 25 | ||||
-rw-r--r-- | 0005-Makefile-leverage-default-rules-as-much-as-possible-.patch (renamed from 0006-Makefile-leverage-default-rules-as-much-as-possible-.patch) | 15 | ||||
-rw-r--r-- | PKGBUILD | 20 | ||||
-rw-r--r-- | foo2zjs.install | 8 |
9 files changed, 203 insertions, 171 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Sun Oct 23 01:04:18 UTC 2016 +# Sun Oct 23 07:38:52 UTC 2016 pkgbase = foo2zjs pkgdesc = foo2zjs Printer Drivers. Includes also foo2hp, foo2hbpl, foo2oak, foo2xqx, foo2qpdl, foo2slx, foo2hiperc and foo2lava drivers. pkgver = 20161021 - pkgrel = 3 + pkgrel = 4 url = http://foo2zjs.rkkda.com/ install = foo2zjs.install arch = i686 @@ -24,16 +24,14 @@ pkgbase = foo2zjs source = 0001-Makefile-DESTDIR-support.patch source = 0002-Makefile-general-fixes.patch source = 0003-Rework-firmware-loading.patch - source = 0004-Makefile-skip-installing-Foomatic-files.patch - source = 0005-Makefile-fix-generating-.ppd-in-place.patch - source = 0006-Makefile-leverage-default-rules-as-much-as-possible-.patch + source = 0004-Makefile-fix-generating-.ppd-in-place.patch + source = 0005-Makefile-leverage-default-rules-as-much-as-possible-.patch sha256sums = 55604f4580fb21534739c294df64e041b6ea96ef45d8a0ff4cdcf516eff243a3 - sha256sums = 2c0e40294c3f77a33e242280e280a98ed834a16584072b2d0f5fa95d0c44503f - sha256sums = b3fdf0702404bf2e4e5e47588d4c1440b95fb301abe0a03c58cf27aedefcadeb - sha256sums = 2cc5c9c51f240218106713e36682fd69caca05e04cfe3ee5b857a9bb55959977 - sha256sums = 81abc3714cf1a6a1f46d5eefe4a6d554e66017befcca66a1d6891ab26f2a014d - sha256sums = 537db87a3d7e81c154d6a6b4b6d3b67f893aa4cede6046bf7658e414e9a5f825 - sha256sums = 90a78899436021695246b884e717cd0f7fb6b4ec8e16e6aac029e0b348c4be50 + sha256sums = f13c6a2308df53d7ed5636f6d77aae7616fc0e8437ca5f4f79ed4361c92eb709 + sha256sums = cf40a20898b9619545bdcf2a59e72e0018c47d81b965b8a781e01688faa1abae + sha256sums = dd049ccd362c098515d3873c17b9f09b2d78da697e89d2022f537d7587874861 + sha256sums = ef76d05b549e2c5875eabe7f526fda3caa5151824000ef582a869601edfbf690 + sha256sums = 83c37616c37887df933910b5dee30cedb118e4c3e4b08d7ab6dd7813466441f2 pkgname = foo2zjs diff --git a/0001-Makefile-DESTDIR-support.patch b/0001-Makefile-DESTDIR-support.patch index a591aa322eef..d858e138dc54 100644 --- a/0001-Makefile-DESTDIR-support.patch +++ b/0001-Makefile-DESTDIR-support.patch @@ -1,7 +1,7 @@ From 90b8910997b272afb346ceec050b6313fb91e054 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov <intelfx@intelfx.name> Date: Sat, 22 Oct 2016 12:35:14 +0300 -Subject: [PATCH 1/6] Makefile: DESTDIR support +Subject: [PATCH 1/5] Makefile: DESTDIR support --- Makefile | 27 ++++++++++++++------------- diff --git a/0002-Makefile-general-fixes.patch b/0002-Makefile-general-fixes.patch index d4c8794ca676..d2e3236c074e 100644 --- a/0002-Makefile-general-fixes.patch +++ b/0002-Makefile-general-fixes.patch @@ -1,47 +1,48 @@ -From d31cbe5a360edb065defbd5545e9bcf3c12d6d1c Mon Sep 17 00:00:00 2001 +From 4916c2a75905dfd628672e13e0913e1c2515637c Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov <intelfx@intelfx.name> -Date: Sun, 23 Oct 2016 00:56:42 +0300 -Subject: [PATCH 2/6] Makefile: general fixes +Date: Sun, 23 Oct 2016 10:21:54 +0300 +Subject: [PATCH 2/5] Makefile: general fixes --- - Makefile | 62 ++++++++++++++++++++++++-------------------------------------- - 1 file changed, 24 insertions(+), 38 deletions(-) + Makefile | 57 +++++++++++++++++++++++++++++---------------------------- + 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/Makefile b/Makefile -index 387b221..4c83e4e 100644 +index 387b221..6b707a9 100644 --- a/Makefile +++ b/Makefile -@@ -382,7 +382,7 @@ JBGOPTS=-m 16 -d 0 -p 92 # Equivalent options for pbmtojbg +@@ -42,7 +42,7 @@ FOODB=$(PREFIX)/share/foomatic/db/source + + # User ID's + LPuid=-oroot +-LPgid=-glp ++LPgid=-groot + ifeq ($(UNAME),Darwin) + LPuid=-oroot + LPgid=-gwheel +@@ -381,8 +381,8 @@ JBGOPTS=-m 16 -d 0 -p 92 # Equivalent options for pbmtojbg + # # The usual build rules # - all: all-test $(PROGS) $(BINPROGS) $(SHELLS) getweb \ +-all: all-test $(PROGS) $(BINPROGS) $(SHELLS) getweb \ - all-icc2ps all-osx-hotplug man doc \ ++all: $(PROGS) $(BINPROGS) $(SHELLS) getweb \ + all-icc2ps man doc \ all-done all-test: -@@ -554,11 +554,6 @@ getweb: getweb.in Makefile - all-icc2ps: - cd icc2ps; $(MAKE) all - --all-osx-hotplug: --ifeq ($(UNAME),Darwin) -- cd osx-hotplug; $(MAKE) all --endif -- - ok: ok.o $(LIBJBG) - $(CC) $(CFLAGS) ok.o $(LIBJBG) -o $@ - -@@ -645,8 +640,6 @@ install-test: - # - - --UDEVBIN=$(DESTDIR)/bin/ -- - install-prog: +@@ -604,8 +604,8 @@ command2foo2lava-pjl.o: command2foo2lava-pjl.c + # + # Installation rules + # +-install: all install-test install-prog install-icc2ps install-osx-hotplug \ +- install-extra install-crd install-foo install-ppd \ ++install: all install-prog install-icc2ps install-osx-hotplug \ ++ install-extra install-crd install-ppd \ + install-gui install-desktop install-filter \ + install-man install-doc # - # Install driver, wrapper, and development tools -@@ -654,8 +647,8 @@ install-prog: +@@ -654,8 +654,8 @@ install-prog: $(INSTALL) -d $(BIN) $(INSTALL) -c $(PROGS) $(SHELLS) $(BIN)/ if [ "$(BINPROGS)" != "" ]; then \ @@ -52,7 +53,7 @@ index 387b221..4c83e4e 100644 fi # # Install gamma correction files. These are just templates, -@@ -735,7 +728,7 @@ install-crd: +@@ -735,7 +735,7 @@ install-crd: # Install prebuilt CRD files (from m2300w project) # $(INSTALL) -d $(SHAREZJS)/ @@ -61,7 +62,7 @@ index 387b221..4c83e4e 100644 for i in crd/zjs/*.*; do \ $(INSTALL) -c -m 644 $$i $(SHAREZJS)/crd/; \ done -@@ -743,7 +736,7 @@ install-crd: +@@ -743,7 +743,7 @@ install-crd: # Install prebuilt CRD files for CLP-300/CLP-600 # $(INSTALL) -d $(SHAREQPDL)/ @@ -70,7 +71,7 @@ index 387b221..4c83e4e 100644 for i in crd/qpdl/*cms* crd/qpdl/*.ps; do \ $(INSTALL) -c -m 644 $$i $(SHAREQPDL)/crd/; \ done -@@ -753,7 +746,7 @@ install-psfiles: +@@ -753,7 +753,7 @@ install-psfiles: # Install prebuilt psfiles files (from m2300w project) # $(INSTALL) -d $(SHAREHP)/ @@ -79,7 +80,7 @@ index 387b221..4c83e4e 100644 for i in psfiles/*.*; do \ $(INSTALL) -c -m 644 $$i $(SHAREHP)/psfiles/; \ done -@@ -767,14 +760,14 @@ install-extra: +@@ -767,14 +767,14 @@ install-extra: # $(INSTALL) -d $(SHAREZJS)/ # foo2zjs ICM files (if any) @@ -96,7 +97,7 @@ index 387b221..4c83e4e 100644 for i in sihp1*.img; do \ if [ -f $$i ]; then \ base=`basename $$i .img`; \ -@@ -783,7 +776,7 @@ install-extra: +@@ -783,7 +783,7 @@ install-extra: fi; \ done # foo2xqx Firmware files (if any) @@ -105,7 +106,7 @@ index 387b221..4c83e4e 100644 for i in sihpP*.img; do \ if [ -f $$i ]; then \ base=`basename $$i .img`; \ -@@ -792,49 +785,49 @@ install-extra: +@@ -792,49 +792,49 @@ install-extra: fi; \ done # foo2oak ICM files (if any) @@ -162,7 +163,7 @@ index 387b221..4c83e4e 100644 for i in hbpl*.icm; do \ if [ -f $$i ]; then \ $(INSTALL) -c -m 644 $$i $(SHAREHBPL)/icm/; \ -@@ -851,30 +844,22 @@ install-ppd: +@@ -851,14 +851,14 @@ install-ppd: # Install PPD files for CUPS # export PATH=$$PATH:`pwd`:; \ @@ -179,15 +180,7 @@ index 387b221..4c83e4e 100644 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; \ -- find $(PPD) -name '*foo2hbpl*' | xargs rm -rf; \ - [ -d $(PPD)/foo2zjs ] || mkdir $(PPD)/foo2zjs; \ +@@ -874,7 +874,7 @@ install-ppd: cd PPD; \ for ppd in *.ppd; do \ modify-ppd <$$ppd | gzip > $(PPD)/foo2zjs/$$ppd.gz; \ @@ -196,7 +189,7 @@ index 387b221..4c83e4e 100644 done; \ fi # -@@ -884,21 +869,21 @@ install-ppd: +@@ -884,21 +884,21 @@ install-ppd: cd PPD; \ for ppd in *.ppd; do \ modify-ppd <$$ppd | gzip > $(MODEL)/$$ppd.gz; \ @@ -221,7 +214,16 @@ index 387b221..4c83e4e 100644 done; \ fi -@@ -1040,7 +1025,8 @@ install-hotplug-osx: +@@ -939,7 +939,7 @@ DEVDDIR=/etc/devd + ifeq ($(UNAME),Darwin) + install-hotplug: install-hotplug-test install-hotplug-osx + else +-install-hotplug: install-hotplug-test install-hotplug-prog ++install-hotplug: install-hotplug-prog + endif + + install-hotplug-test: +@@ -1040,7 +1040,8 @@ install-hotplug-osx: install-filter: if [ "$(CUPS_SERVERBIN)" != "" ]; then \ diff --git a/0003-Rework-firmware-loading.patch b/0003-Rework-firmware-loading.patch index 41d024e1294c..b297352df2e3 100644 --- a/0003-Rework-firmware-loading.patch +++ b/0003-Rework-firmware-loading.patch @@ -1,19 +1,21 @@ -From 10d612accdc7f43e1517907b0664ed7d2df15755 Mon Sep 17 00:00:00 2001 +From c2829ff4264a3bccb49d63f032d798fbaca54150 Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov <intelfx@intelfx.name> -Date: Sun, 23 Oct 2016 00:59:32 +0300 -Subject: [PATCH 3/6] Rework firmware loading +Date: Sun, 23 Oct 2016 10:18:08 +0300 +Subject: [PATCH 3/5] Rework firmware loading --- - Makefile | 80 ++++++++----------------------------- - foo2zjs-loadfw.in | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ - hplj10xx.rules | 59 ++++++++++----------------- - usblp.conf | 1 + - 4 files changed, 154 insertions(+), 102 deletions(-) + Makefile | 99 +++++++++++------------------------ + foo2zjs-loadfw.in | 128 +++++++++++++++++++++++++++++++++++++++++++++ + foo2zjs-loadfw@.service.in | 6 +++ + hplj10xx.rules | 60 ++++++++------------- + usblp.conf | 1 + + 5 files changed, 186 insertions(+), 108 deletions(-) create mode 100644 foo2zjs-loadfw.in + create mode 100644 foo2zjs-loadfw@.service.in create mode 100644 usblp.conf diff --git a/Makefile b/Makefile -index 4c83e4e..6ddcf96 100644 +index 6b707a9..2f546f9 100644 --- a/Makefile +++ b/Makefile @@ -167,6 +167,7 @@ FILES = \ @@ -24,16 +26,28 @@ index 4c83e4e..6ddcf96 100644 foo2zjs-wrapper.in \ foo2zjs-wrapper.1in \ foo2hp2600-wrapper.in \ -@@ -271,7 +272,7 @@ endif - SHELLS= foo2zjs-wrapper foo2oak-wrapper foo2hp2600-wrapper \ - foo2xqx-wrapper foo2lava-wrapper foo2qpdl-wrapper \ - foo2slx-wrapper foo2hiperc-wrapper foo2hbpl2-wrapper --SHELLS+= foo2zjs-pstops -+SHELLS+= foo2zjs-loadfw foo2zjs-pstops - SHELLS+= printer-profile - MANPAGES= foo2zjs-wrapper.1 foo2zjs.1 zjsdecode.1 - MANPAGES+= foo2oak-wrapper.1 foo2oak.1 oakdecode.1 -@@ -482,6 +483,12 @@ foo2hiperc: foo2hiperc.o $(LIBJBG) +@@ -287,10 +288,7 @@ MANPAGES+= foo2zjs-pstops.1 arm2hpdl.1 usb_printerid.1 + MANPAGES+= printer-profile.1 + LIBJBG = jbig.o jbig_ar.o + BINPROGS= +- +-ifeq ($(UNAME),Linux) +- BINPROGS += usb_printerid +-endif ++MISC= foo2zjs-loadfw foo2zjs-loadfw@.service + + # Compiler flags + #CFLAGS += -O2 -Wall -Wno-unused-but-set-variable +@@ -381,7 +379,7 @@ JBGOPTS=-m 16 -d 0 -p 92 # Equivalent options for pbmtojbg + # + # The usual build rules + # +-all: $(PROGS) $(BINPROGS) $(SHELLS) getweb \ ++all: $(PROGS) $(BINPROGS) $(SHELLS) $(MISC) getweb \ + all-icc2ps man doc \ + all-done + +@@ -482,6 +480,18 @@ foo2hiperc: foo2hiperc.o $(LIBJBG) foo2hbpl2: foo2hbpl2.o $(LIBJBG) $(CC) $(CFLAGS) -o $@ foo2hbpl2.o $(LIBJBG) @@ -43,32 +57,37 @@ index 4c83e4e..6ddcf96 100644 + -e 's:@FWDIR_ZJS@:$(SHAREZJS)/firmware:' \ + -e 's:@FWDIR_XQX@:$(SHAREXQX)/firmware:' || (rm -f $@ && exit 1) + chmod 555 $@ ++ ++foo2zjs-loadfw@.service: foo2zjs-loadfw@.service.in Makefile ++ [ ! -f $@ ] || chmod +w $@ ++ sed < $@.in > $@ \ ++ -e 's:@PREFIX@:$(PREFIX):' || (rm -f $@ && exit 1) ++ chmod 444 $@ foo2zjs-wrapper: foo2zjs-wrapper.in Makefile [ ! -f $@ ] || chmod +w $@ -@@ -913,18 +920,18 @@ install-gui: +@@ -928,13 +938,15 @@ install-gui: $(INSTALL) -c -m 755 hplj10xx_gui.tcl $(SHAREZJS) -USBDIR=$(DESTDIR)/etc/hotplug/usb - UDEVDIR=/etc/udev/rules.d - LIBUDEVDIR=/lib/udev/rules.d -+LIBMODPROBEDIR=/lib/modprobe.d - RULES=hplj10xx.rules -+USBLP=usblp.conf +-UDEVDIR=/etc/udev/rules.d +-LIBUDEVDIR=/lib/udev/rules.d +-RULES=hplj10xx.rules ++LIBUDEVDIR=$(PREFIX)/lib/udev/rules.d ++LIBMODPROBEDIR=$(PREFIX)/lib/modprobe.d ++UNITDIR=$(PREFIX)/lib/systemd/system ++HOTPLUG_PROGS=foo2zjs-loadfw ++HOTPLUG_RULES=hplj10xx.rules ++HOTPLUG_UNITS=foo2zjs-loadfw@.service ++HOTPLUG_USBLP=usblp.conf #UDEVD=/sbin/udevd # For FreeBSD 8.0 -DEVDDIR=/etc/devd ifeq ($(UNAME),Darwin) install-hotplug: install-hotplug-test install-hotplug-osx - else --install-hotplug: install-hotplug-test install-hotplug-prog -+install-hotplug: install-hotplug-prog - endif - - install-hotplug-test: -@@ -960,65 +967,12 @@ install-hotplug-test: +@@ -975,65 +987,14 @@ install-hotplug-test: # install-hotplug-prog: @@ -131,21 +150,23 @@ index 4c83e4e..6ddcf96 100644 - $(USBDIR)/hpljP1505 install-usermap - # modprobe usblp - $(USBDIR)/hplj1000 install-usblp -+ $(INSTALL) -d -m 755 $(PREFIX)$(LIBUDEVDIR) -+ $(INSTALL) -c -m 644 $(RULES) $(PREFIX)$(LIBUDEVDIR)/70-$(RULES) + $(INSTALL) -d -m 755 $(BIN) -+ $(INSTALL) -c -m 755 foo2zjs-loadfw $(BIN) -+ $(INSTALL) -d -m 755 $(PREFIX)$(LIBMODPROBEDIR) -+ $(INSTALL) -c -m 644 $(USBLP) $(PREFIX)$(LIBMODPROBEDIR) ++ $(INSTALL) -c -m 755 $(HOTPLUG_PROGS) $(BIN) ++ $(INSTALL) -d -m 755 $(LIBUDEVDIR) ++ $(INSTALL) -c -m 644 $(HOTPLUG_RULES) $(LIBUDEVDIR)/71-$(HOTPLUG_RULES) ++ $(INSTALL) -d -m 755 $(LIBMODPROBEDIR) ++ $(INSTALL) -c -m 644 $(HOTPLUG_USBLP) $(LIBMODPROBEDIR) ++ $(INSTALL) -d -m 755 $(UNITDIR) ++ $(INSTALL) -c -m 644 $(HOTPLUG_UNITS) $(UNITDIR) install-hotplug-osx: cd osx-hotplug; $(MAKE) PREFIX=$(PREFIX) install-hotplug diff --git a/foo2zjs-loadfw.in b/foo2zjs-loadfw.in new file mode 100644 -index 0000000..c0f5ec0 +index 0000000..911fe0a --- /dev/null +++ b/foo2zjs-loadfw.in -@@ -0,0 +1,116 @@ +@@ -0,0 +1,128 @@ +#!/bin/bash + +# foo2zjs-loadfw: @@ -177,16 +198,28 @@ index 0000000..c0f5ec0 +# Figure out how to log our messages +# +log() { -+ echo "$0: $@" >&2 ++ echo "$@" >&2 +} + -+log "Firmware download script" -+ +# +# Figure out the model number and firmware file from the arguments +# -+MODEL="$1" -+SERIAL="$2" ++DEVPATH="$1" ++eval $(udevadm info -q property -x "$DEVPATH") ++MODEL="$FOO2ZJS_FW_MODEL" ++SERIAL="$ID_SERIAL_SHORT" ++ ++log "Downloading firmware for printer model '$MODEL' serial '$SERIAL' at devpath '$DEVPATH'" ++ ++if ! [[ "$FOO2ZJS_FW_MODEL" ]]; then ++ log "Model number is empty -- borked udev configuration?" ++ exit 1 ++fi ++ ++if ! [[ "$SERIAL" ]]; then ++ log "Serial number is empty -- borked udev configuration?" ++ exit 1 ++fi + +case "$MODEL" in +P1005) @@ -254,7 +287,7 @@ index 0000000..c0f5ec0 + +$USB_BACKEND 2>/dev/null | grep "\<usb://" | grep "serial=$SERIAL" | while read direct uri model1 model2 params; do + log "Got printer: URI='$uri'" -+ if DEVICE_URI="$uri" $USB_BACKEND 1 1 1 1 '' "$FW"; then ++ if DEVICE_URI="$uri" $USB_BACKEND 1 1 1 1 '' "$FW" 2>/dev/null; then + log "Firmware download OK" + exit 0 + else @@ -262,11 +295,23 @@ index 0000000..c0f5ec0 + exit 1 + fi +done +diff --git a/foo2zjs-loadfw@.service.in b/foo2zjs-loadfw@.service.in +new file mode 100644 +index 0000000..7bf47be +--- /dev/null ++++ b/foo2zjs-loadfw@.service.in +@@ -0,0 +1,6 @@ ++[Unit] ++Description=Load HP ZJS/XQX printer firmware for %f ++ ++[Service] ++Type=oneshot ++ExecStart=@PREFIX@/bin/foo2zjs-loadfw %f diff --git a/hplj10xx.rules b/hplj10xx.rules -index ee0295d..e5785d3 100644 +index ee0295d..dec1cdd 100644 --- a/hplj10xx.rules +++ b/hplj10xx.rules -@@ -1,39 +1,20 @@ +@@ -1,39 +1,21 @@ -# -# hplj10xx.rules.old: udev equal or after 1.30 -# @@ -306,26 +351,27 @@ index ee0295d..e5785d3 100644 -KERNEL=="lp*", SUBSYSTEMS=="usb", ATTRS{idVendor}=="03f0", \ - ATTRS{product}=="HP LaserJet P1505", NAME="usb/%k", \ - SYMLINK+="hpljP1505-%n", MODE="0666", RUN+="/etc/hotplug/usb/hpljP1505" -+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ -+ ATTRS{idProduct}=="0517", RUN+="/usr/bin/foo2zjs-loadfw 1000 $env{ID_SERIAL_SHORT}" -+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ -+ ATTRS{idProduct}=="1317", RUN+="/usr/bin/foo2zjs-loadfw 1005 $env{ID_SERIAL_SHORT}" -+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ -+ ATTRS{idProduct}=="4117", RUN+="/usr/bin/foo2zjs-loadfw 1018 $env{ID_SERIAL_SHORT}" -+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ -+ ATTRS{idProduct}=="2b17", RUN+="/usr/bin/foo2zjs-loadfw 1020 $env{ID_SERIAL_SHORT}" -+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ -+ ATTRS{idProduct}=="3d17", RUN+="/usr/bin/foo2zjs-loadfw P1005 $env{ID_SERIAL_SHORT}" -+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ -+ ATTRS{idProduct}=="3e17", RUN+="/usr/bin/foo2zjs-loadfw P1006 $env{ID_SERIAL_SHORT}" -+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ -+ ATTRS{idProduct}=="4817", RUN+="/usr/bin/foo2zjs-loadfw P1007 $env{ID_SERIAL_SHORT}" -+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ -+ ATTRS{idProduct}=="4917", RUN+="/usr/bin/foo2zjs-loadfw P1008 $env{ID_SERIAL_SHORT}" -+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ -+ ATTRS{idProduct}=="3f17", RUN+="/usr/bin/foo2zjs-loadfw P1505 $env{ID_SERIAL_SHORT}" -+ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="03f0", \ -+ ATTRS{idProduct}=="4017", RUN+="/usr/bin/foo2zjs-loadfw P1505n $env{ID_SERIAL_SHORT}" ++ACTION!="add", GOTO="foo2zjs_fw_end" ++SUBSYSTEM!="usb", GOTO="foo2zjs_fw_end" ++ENV{DEVTYPE}!="usb_device", GOTO="foo2zjs_fw_end" ++ ++ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="0517", ENV{FOO2ZJS_FW_MODEL}="1000" ++ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="1317", ENV{FOO2ZJS_FW_MODEL}="1005" ++ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="4117", ENV{FOO2ZJS_FW_MODEL}="1018" ++ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="2b17", ENV{FOO2ZJS_FW_MODEL}="1020" ++ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="3d17", ENV{FOO2ZJS_FW_MODEL}="P1005" ++ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="3e17", ENV{FOO2ZJS_FW_MODEL}="P1006" ++ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="4817", ENV{FOO2ZJS_FW_MODEL}="P1007" ++ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="4917", ENV{FOO2ZJS_FW_MODEL}="P1008" ++ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="3f17", ENV{FOO2ZJS_FW_MODEL}="P1505" ++ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="4017", ENV{FOO2ZJS_FW_MODEL}="P1505n" ++ENV{FOO2ZJS_FW_MODEL}=="", GOTO="foo2zjs_fw_end" ++ ++# Inherit the instance name from the parent unit's instance name (or unit name, if there is no instance name). ++# In our case -- the printer's full devpath gets passed. ++TAG+="systemd", ENV{SYSTEMD_WANTS}+="foo2zjs-loadfw@.service" ++ ++LABEL="foo2zjs_fw_end" diff --git a/usblp.conf b/usblp.conf new file mode 100644 index 0000000..5a604bf diff --git a/0005-Makefile-fix-generating-.ppd-in-place.patch b/0004-Makefile-fix-generating-.ppd-in-place.patch index 576af558604a..60ea711cab53 100644 --- a/0005-Makefile-fix-generating-.ppd-in-place.patch +++ b/0004-Makefile-fix-generating-.ppd-in-place.patch @@ -1,17 +1,17 @@ -From 3271b56e3c33cdbe69f1d03747091fa092c23791 Mon Sep 17 00:00:00 2001 +From 3dc1ff8f60500f79956a7ded38dfb160fe6d6aff Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov <intelfx@intelfx.name> Date: Sun, 23 Oct 2016 01:01:17 +0300 -Subject: [PATCH 5/6] Makefile: fix generating *.ppd in-place +Subject: [PATCH 4/5] Makefile: fix generating *.ppd in-place --- Makefile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile -index d5ab384..176fdfe 100644 +index 2f546f9..fcca27e 100644 --- a/Makefile +++ b/Makefile -@@ -1386,10 +1386,8 @@ ppd: +@@ -1408,10 +1408,8 @@ ppd: *) driver=foo2zjs;; \ esac; \ echo $$driver - $$printer; \ diff --git a/0004-Makefile-skip-installing-Foomatic-files.patch b/0004-Makefile-skip-installing-Foomatic-files.patch deleted file mode 100644 index a3427e39e562..000000000000 --- a/0004-Makefile-skip-installing-Foomatic-files.patch +++ /dev/null @@ -1,25 +0,0 @@ -From d5b02fc59c140eb2d53cef5a90df9fbe7265e17d Mon Sep 17 00:00:00 2001 -From: Ivan Shapovalov <intelfx@intelfx.name> -Date: Sun, 23 Oct 2016 01:00:36 +0300 -Subject: [PATCH 4/6] Makefile: skip installing Foomatic files - ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 6ddcf96..d5ab384 100644 ---- a/Makefile -+++ b/Makefile -@@ -607,7 +607,7 @@ command2foo2lava-pjl.o: command2foo2lava-pjl.c - # Installation rules - # - install: all install-test install-prog install-icc2ps install-osx-hotplug \ -- install-extra install-crd install-foo install-ppd \ -+ install-extra install-crd install-ppd \ - install-gui install-desktop install-filter \ - install-man install-doc - # --- -2.10.0 - diff --git a/0006-Makefile-leverage-default-rules-as-much-as-possible-.patch b/0005-Makefile-leverage-default-rules-as-much-as-possible-.patch index 352d2a7b2236..df480c0de007 100644 --- a/0006-Makefile-leverage-default-rules-as-much-as-possible-.patch +++ b/0005-Makefile-leverage-default-rules-as-much-as-possible-.patch @@ -1,7 +1,7 @@ -From 359f64c508a34e977b2a36af322b139a7c3ee49e Mon Sep 17 00:00:00 2001 +From 170a4d0f10107f40eaca97ba6b3ad46effe66e7a Mon Sep 17 00:00:00 2001 From: Ivan Shapovalov <intelfx@intelfx.name> Date: Sun, 23 Oct 2016 01:01:59 +0300 -Subject: [PATCH 6/6] Makefile: leverage default rules as much as possible to +Subject: [PATCH 5/5] Makefile: leverage default rules as much as possible to fix behavior wrt user compile flags --- @@ -10,10 +10,10 @@ Subject: [PATCH 6/6] Makefile: leverage default rules as much as possible to 2 files changed, 30 insertions(+), 75 deletions(-) diff --git a/Makefile b/Makefile -index 176fdfe..ac48605 100644 +index fcca27e..615f9e1 100644 --- a/Makefile +++ b/Makefile -@@ -455,33 +455,15 @@ all-done: +@@ -452,33 +452,15 @@ all-done: @echo "yourself." @@ -56,13 +56,18 @@ index 176fdfe..ac48605 100644 foo2zjs-loadfw: foo2zjs-loadfw.in Makefile [ ! -f $@ ] || chmod +w $@ -@@ -559,49 +541,21 @@ getweb: getweb.in Makefile +@@ -562,54 +544,26 @@ getweb: getweb.in Makefile chmod 555 $@ all-icc2ps: - cd icc2ps; $(MAKE) all + $(MAKE) -C icc2ps all + all-osx-hotplug: + ifeq ($(UNAME),Darwin) + cd osx-hotplug; $(MAKE) all + endif + -ok: ok.o $(LIBJBG) - $(CC) $(CFLAGS) ok.o $(LIBJBG) -o $@ - @@ -5,7 +5,7 @@ pkgname=foo2zjs pkgver=20161021 -pkgrel=3 +pkgrel=4 pkgdesc="foo2zjs Printer Drivers. Includes also foo2hp, foo2hbpl, foo2oak, foo2xqx, foo2qpdl, foo2slx, foo2hiperc and foo2lava drivers." url="http://foo2zjs.rkkda.com/" license=('GPL' 'custom') @@ -20,17 +20,15 @@ source=("foo2zjs-$pkgver.tar.gz::http://foo2zjs.rkkda.com/foo2zjs.tar.gz" '0001-Makefile-DESTDIR-support.patch' '0002-Makefile-general-fixes.patch' '0003-Rework-firmware-loading.patch' - '0004-Makefile-skip-installing-Foomatic-files.patch' - '0005-Makefile-fix-generating-.ppd-in-place.patch' - '0006-Makefile-leverage-default-rules-as-much-as-possible-.patch') + '0004-Makefile-fix-generating-.ppd-in-place.patch' + '0005-Makefile-leverage-default-rules-as-much-as-possible-.patch') sha256sums=('55604f4580fb21534739c294df64e041b6ea96ef45d8a0ff4cdcf516eff243a3' - '2c0e40294c3f77a33e242280e280a98ed834a16584072b2d0f5fa95d0c44503f' - 'b3fdf0702404bf2e4e5e47588d4c1440b95fb301abe0a03c58cf27aedefcadeb' - '2cc5c9c51f240218106713e36682fd69caca05e04cfe3ee5b857a9bb55959977' - '81abc3714cf1a6a1f46d5eefe4a6d554e66017befcca66a1d6891ab26f2a014d' - '537db87a3d7e81c154d6a6b4b6d3b67f893aa4cede6046bf7658e414e9a5f825' - '90a78899436021695246b884e717cd0f7fb6b4ec8e16e6aac029e0b348c4be50') + 'f13c6a2308df53d7ed5636f6d77aae7616fc0e8437ca5f4f79ed4361c92eb709' + 'cf40a20898b9619545bdcf2a59e72e0018c47d81b965b8a781e01688faa1abae' + 'dd049ccd362c098515d3873c17b9f09b2d78da697e89d2022f537d7587874861' + 'ef76d05b549e2c5875eabe7f526fda3caa5151824000ef582a869601edfbf690' + '83c37616c37887df933910b5dee30cedb118e4c3e4b08d7ab6dd7813466441f2') prepare() { cd "${pkgname}" @@ -56,7 +54,7 @@ package() { install -d "${pkgdir}"/usr/share/{applications,pixmaps,cups/model} - make DESTDIR="${pkgdir}" install install-hotplug-prog + make DESTDIR="${pkgdir}" install install-hotplug # install -m755 getweb "${pkgdir}/usr/bin" install -D -m644 COPYING "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" diff --git a/foo2zjs.install b/foo2zjs.install index c6976641e78f..dc313aa0e25a 100644 --- a/foo2zjs.install +++ b/foo2zjs.install @@ -3,7 +3,13 @@ restart_cups() { systemctl try-restart org.cups.cupsd } +reload_udev() { + echo "> Now reloading udev rules database..." + udevadm control --reload +} + post_install() { + reload_udev restart_cups echo "" @@ -14,9 +20,11 @@ post_install() { } post_upgrade() { + reload_udev restart_cups } post_remove() { + reload_udev restart_cups } |