[splix/f15] Patch for compiling/installing DRVs instead of PPDs.
Jiří Popelka
jpopelka at fedoraproject.org
Wed Nov 30 18:53:20 UTC 2011
commit 5f43bc4bb600818f73ae034e401f01029c40300f
Author: Jiri Popelka <jpopelka at redhat.com>
Date: Wed Nov 30 19:33:53 2011 +0100
Patch for compiling/installing DRVs instead of PPDs.
However we still ship only selected PPDs instead of DRVs as some printers
require JBIG1 support.
Install splix PPDs into separate directory.
splix-custom-ppd-dir.patch | 12 +++
splix-drv.patch | 211 ++++++++++++++++++++++++++++++++++++++++++++
splix.spec | 52 ++++++++---
3 files changed, 263 insertions(+), 12 deletions(-)
---
diff --git a/splix-custom-ppd-dir.patch b/splix-custom-ppd-dir.patch
new file mode 100644
index 0000000..0812c2c
--- /dev/null
+++ b/splix-custom-ppd-dir.patch
@@ -0,0 +1,12 @@
+diff -up splix/module.mk.custom-ppd-dir splix/module.mk
+--- splix/module.mk.custom-ppd-dir 2011-07-20 18:20:18.000000000 +0200
++++ splix/module.mk 2011-11-30 17:05:22.909275151 +0100
+@@ -55,7 +55,7 @@ endif
+
+ # Get some information
+ CUPSFILTER := `cups-config --serverbin`/filter
+-CUPSPPD := `cups-config --datadir`/model
++CUPSPPD ?= `cups-config --datadir`/model
+ ifeq ($(ARCHI),Darwin)
+ PSTORASTER := pstocupsraster
+ else
diff --git a/splix-drv.patch b/splix-drv.patch
new file mode 100644
index 0000000..5ef31b2
--- /dev/null
+++ b/splix-drv.patch
@@ -0,0 +1,211 @@
+diff -up splix/INSTALL.drv-only splix/INSTALL
+--- splix/INSTALL.drv-only 2008-06-15 00:22:11.000000000 +0200
++++ splix/INSTALL 2011-11-30 19:27:25.112732948 +0100
+@@ -114,6 +114,9 @@ options are:
+ memory will use an average of 9Mo of RAM. Other pages
+ are swapped into the disk. A little CACHESIZE value will
+ increase disk access and increase the job rendering time.
++ * DRV_ONLY=1 [0 by default]:
++ Don't install PPD files at all, only DRV
++ (driver information file) files.
+
+ Example:
+
+diff -up splix/module.mk.drv-only splix/module.mk
+--- splix/module.mk.drv-only 2011-11-30 19:27:25.110732973 +0100
++++ splix/module.mk 2011-11-30 19:27:25.113732935 +0100
+@@ -9,6 +9,7 @@
+ # Compilation option:
+ # V=1 Verbose mode
+ # DESTDIR=xxx Change the destination directory prefix
++# DRV_ONLY Don't install PPD files at all, only DRV files.
+
+ MODE := optimized
+
+@@ -23,6 +24,7 @@ CACHESIZE ?= 30
+ DISABLE_JBIG ?= 0
+ DISABLE_THREADS ?= 0
+ DISABLE_BLACKOPTIM ?= 0
++DRV_ONLY ?= 0
+
+
+ # Flags
+@@ -56,6 +58,7 @@ endif
+ # Get some information
+ CUPSFILTER := `cups-config --serverbin`/filter
+ CUPSPPD ?= `cups-config --datadir`/model
++CUPSDRV ?= `cups-config --datadir`/drv
+ ifeq ($(ARCHI),Darwin)
+ PSTORASTER := pstocupsraster
+ else
+@@ -63,7 +66,7 @@ PSTORASTER := pstoraster
+ endif
+ GSTORASTER := gstoraster
+ CUPSPROFILE := `cups-config --datadir`/profiles
+-export CUPSFILTER CUPSPPD
++export CUPSFILTER CUPSPPD CUPSDRV
+
+
+ # Specific information needed by pstoqpdl
+diff -up splix/ppd/compile.sh.drv-only splix/ppd/compile.sh
+--- splix/ppd/compile.sh.drv-only 2010-07-31 19:11:24.000000000 +0200
++++ splix/ppd/compile.sh 2011-11-30 19:27:25.113732935 +0100
+@@ -28,13 +28,13 @@ parseFile() {
+ #
+ # Main script
+ #
+-if [ "$2" = "debug" ]; then
+- TMPFILE="output.drv"
++if [ "$2" = "drv" ]; then
+ DRIVER=$1
++ OUTFILE=${DRIVER%.in}
+ shift 1
+
+- echo "" > $TMPFILE
+- parseFile $DRIVER $TMPFILE
++ echo "" > $OUTFILE
++ parseFile $DRIVER $OUTFILE
+
+
+ elif [ "$2" = "lang" ]; then
+diff -up splix/ppd/Makefile.drv-only splix/ppd/Makefile
+--- splix/ppd/Makefile.drv-only 2011-07-21 17:22:26.000000000 +0200
++++ splix/ppd/Makefile 2011-11-30 19:28:36.440841223 +0100
+@@ -5,7 +5,8 @@
+ #
+ #
+
+-SOURCE := samsung.drv dell.drv xerox.drv lexmark.drv toshiba.drv
++SOURCE := samsung.drv.in dell.drv.in xerox.drv.in lexmark.drv.in toshiba.drv.in
++DRVS := samsung.drv dell.drv xerox.drv lexmark.drv toshiba.drv
+ DELL := 1100 1110
+ SAMSUNG := clp500 clp550 clp510 clp610 clp610nd ml1510 ml1520 ml1610 \
+ ml1630 ml1640 ml1660 ml1710 ml1740 ml1750 ml1910 ml1915 \
+@@ -42,39 +43,47 @@ printCmd = $(if $(filter $(V),1),
+
+ all:
+
++.PHONY: drv
++drv: $(SOURCE)
++ ./compile.sh samsung.drv.in drv
++ ./compile.sh dell.drv.in drv
++ ./compile.sh xerox.drv.in drv
++ ./compile.sh lexmark.drv.in drv
++ ./compile.sh toshiba.drv.in drv
++
+ .PHONY: ppd
+ ppd: $(DRIVER) $(LANGDRIVERSEXT)
+
+ $(DRIVER): $(SOURCE)
+- ./compile.sh samsung.drv -I . -d ./
+- ./compile.sh dell.drv -I . -d ./
+- ./compile.sh xerox.drv -I . -d ./
+- ./compile.sh lexmark.drv -I . -d ./
+- ./compile.sh toshiba.drv -I . -d ./
++ ./compile.sh samsung.drv.in -I . -d ./
++ ./compile.sh dell.drv.in -I . -d ./
++ ./compile.sh xerox.drv.in -I . -d ./
++ ./compile.sh lexmark.drv.in -I . -d ./
++ ./compile.sh toshiba.drv.in -I . -d ./
+
+ $(LANGDRIVERSEXT): $(SOURCE) $(patsubst %, $(PODIR)/%.$(POEXT), $(LANGUAGES))
+ lang=$(patsubst $(MASTERDRIVER)%.$(DRIVERSEXT),%, $@); \
+- ./compile.sh samsung.drv -l $$lang -c ${PODIR}/$$lang.${POEXT} -d ${PODIR}/$$lang; \
++ ./compile.sh samsung.drv.in -l $$lang -c ${PODIR}/$$lang.${POEXT} -d ${PODIR}/$$lang; \
+ for filename in ${SAMSUNG}; do \
+ recode utf8..latin1 ${PODIR}/$$lang/$$filename.${DRIVERSEXT}; \
+ mv ${PODIR}/$$lang/$$filename.${DRIVERSEXT} $$filename$$lang.${DRIVERSEXT}; \
+ done; \
+- ./compile.sh xerox.drv -l $$lang -c ${PODIR}/$$lang.${POEXT} -d ${PODIR}/$$lang; \
++ ./compile.sh xerox.drv.in -l $$lang -c ${PODIR}/$$lang.${POEXT} -d ${PODIR}/$$lang; \
+ for filename in ${XEROX}; do \
+ recode utf8..latin1 ${PODIR}/$$lang/$$filename.${DRIVERSEXT}; \
+ mv ${PODIR}/$$lang/$$filename.${DRIVERSEXT} $$filename$$lang.${DRIVERSEXT}; \
+ done; \
+- ./compile.sh dell.drv -l $$lang -c ${PODIR}/$$lang.${POEXT} -d ${PODIR}/$$lang; \
++ ./compile.sh dell.drv.in -l $$lang -c ${PODIR}/$$lang.${POEXT} -d ${PODIR}/$$lang; \
+ for filename in ${DELL}; do \
+ recode utf8..latin1 ${PODIR}/$$lang/$$filename.${DRIVERSEXT}; \
+ mv ${PODIR}/$$lang/$$filename.${DRIVERSEXT} $$filename$$lang.${DRIVERSEXT}; \
+ done; \
+- ./compile.sh lexmark.drv -l $$lang -c ${PODIR}/$$lang.${POEXT} -d ${PODIR}/$$lang; \
++ ./compile.sh lexmark.drv.in -l $$lang -c ${PODIR}/$$lang.${POEXT} -d ${PODIR}/$$lang; \
+ for filename in ${LEXMARK}; do \
+ recode utf8..latin1 ${PODIR}/$$lang/$$filename.${DRIVERSEXT}; \
+ mv ${PODIR}/$$lang/$$filename.${DRIVERSEXT} $$filename$$lang.${DRIVERSEXT}; \
+ done; \
+- ./compile.sh toshiba.drv -l $$lang -c ${PODIR}/$$lang.${POEXT} -d ${PODIR}/$$lang; \
++ ./compile.sh toshiba.drv.in -l $$lang -c ${PODIR}/$$lang.${POEXT} -d ${PODIR}/$$lang; \
+ for filename in ${TOSHIBA}; do \
+ recode utf8..latin1 ${PODIR}/$$lang/$$filename.${DRIVERSEXT}; \
+ mv ${PODIR}/$$lang/$$filename.${DRIVERSEXT} $$filename$$lang.${DRIVERSEXT}; \
+@@ -83,19 +92,21 @@ $(LANGDRIVERSEXT): $(SOURCE) $(patsubst
+ .PHONY: update
+ update: $(patsubst %, $(PODIR)/%.$(POEXT), $(LANGUAGES))
+ %.po: $(SOURCE)
+- ./compile.sh samsung.drv lang $@
+- ./compile.sh dell.drv lang $@
+- ./compile.sh xerox.drv lang $@
+- ./compile.sh lexmark.drv lang $@
+- ./compile.sh toshiba.drv lang $@
++ ./compile.sh samsung.drv.in lang $@
++ ./compile.sh dell.drv.in lang $@
++ ./compile.sh xerox.drv.in lang $@
++ ./compile.sh lexmark.drv.in lang $@
++ ./compile.sh toshiba.drv.in lang $@
+
+ cmd_install_samsung = INSTALL Samsung PPD files
+ cmd_install_xerox = INSTALL Xerox PPD files
+ cmd_install_dell = INSTALL Dell PPD files
+ cmd_install_lexmark = INSTALL Lexmark PPD files
+ cmd_install_toshiba = INSTALL Toshiba PPD files
++cmd_install_drv = INSTALL DRV files
+ .PHONY: install
+ install:
++ifneq ($(DRV_ONLY),1)
+ $(call printCmd, $(cmd_install_samsung))
+ $(Q)install -d -m 755 ${DESTDIR}${CUPSPPD}/samsung
+ $(Q)for filename in ${SAMSUNG}; do \
+@@ -136,8 +147,16 @@ install:
+ install -m 644 $$filename$$lang.${DRIVERSEXT} ${DESTDIR}${CUPSPPD}/toshiba;\
+ done; \
+ done;
++else
++ $(call printCmd, $(cmd_install_drv))
++ $(Q)install -d -m 755 ${DESTDIR}${CUPSDRV}
++ $(Q)for filename in ${DRVS}; do \
++ install -m 644 $$filename ${DESTDIR}${CUPSDRV};\
++ done;
++endif
+
+ .PHONY: clean distclean
+ clean:
+ distclean:
+ $(RM) *.${DRIVERSEXT}
++ $(RM) *.drv
+diff -up splix/rules.mk.drv-only splix/rules.mk
+--- splix/rules.mk.drv-only 2011-11-30 19:27:25.104733048 +0100
++++ splix/rules.mk 2011-11-30 19:27:25.114732922 +0100
+@@ -75,6 +75,11 @@ BLACKOPTIMSTATE := disabled
+ else
+ BLACKOPTIMSTATE := enabled
+ endif
++ifeq ($(DRV_ONLY),0)
++DRVSTATE := disabled
++else
++DRVSTATE := enabled
++endif
+
+
+ MSG := +---------------------------------------------+\n
+@@ -85,8 +90,9 @@ MSG += | THREADS Nr = %8i
+ MSG += | CACHESIZE = %8i |\n
+ MSG += | JBIG = %8s |\n
+ MSG += | BLACK OPTIM = %8s |\n
++MSG += | DRV ONLY = %8s |\n
+ MSG += +---------------------------------------------+\n
+ MSG += (Do a \"make clean\" before updating these values)\n\n
+ optionList:
+ @printf " $(MSG)" $(THREADSSTATE) $(THREADS) $(CACHESIZE) $(JBIGSTATE) \
+- $(BLACKOPTIMSTATE)
++ $(BLACKOPTIMSTATE) $(DRVSTATE)
diff --git a/splix.spec b/splix.spec
index a2726e4..9fe6dbf 100644
--- a/splix.spec
+++ b/splix.spec
@@ -3,7 +3,7 @@
Summary: Driver for QPDL/SPL2 printers (Samsung and several Xerox printers)
Name: splix
Version: 2.0.1
-Release: 0.5.%{checkout}%{?dist}
+Release: 0.6.%{checkout}%{?dist}
License: GPLv2
Group: System Environment/Base
URL: http://splix.sourceforge.net/
@@ -20,9 +20,15 @@ Patch0: splix-nostrip.patch
# Samsung ML-1610
Patch1: splix-deviceID.patch
+# Install PPDs to custom directory
+Patch2: splix-custom-ppd-dir.patch
+
+# Don't install PPD files at all, only DRV files.
+Patch3: splix-drv.patch
+
Requires: cups
-# needed for PPD re-compilation
+# PPD re-compilation
BuildRequires: cups, recode
# _cups_serverbin macro
@@ -47,15 +53,36 @@ chmod -x ppd/po/pt.po
%patch0 -p1 -b .nostrip
%patch1 -p1 -b .deviceID
+%patch2 -p1 -b .custom-ppd-dir
+%patch3 -p1 -b .drv-only
-%build
-# re-compile PPD files
pushd ppd
+# rename *.drv to *.drv.in
+for i in *.drv; do mv $i ${i}.in; done
+# remove old PPDs
make distclean
+popd
+
+%build
+# The situation is that we can't ship jbigkit (JBIG1 implementation) in Fedora
+# because of one known patent. It can be found in rpmfusion-free repository.
+# DISABLE_JBIG=1 prevents splix from building against jbigkit and also from
+# installing PPD files for printers that require JBIG1 support.
+#
+# Luckily JBIG1 will be free of known patents in all countries from
+# 2012-04-04 onwards. (http://www.cl.cam.ac.uk/~mgk25/jbigkit/patents/)
+# So once jbigkit is in Fedora we could do the following with this spec:
+# - remove DISABLE_JBIG=1
+# - replace 'make ppd' with 'make drv'
+# - remove cups and recode from BuildRequires
+# - add 'DRV_ONLY=1 CUPSDRV=%{_datadir}/cups/drv/splix' to make install
+# That will result in building splix with JBIG1 support and also
+# installing DRV files instead of only selected set of PPD files.
+
+pushd ppd
make ppd
popd
-# remove DISABLE_JBIG=1 once jbigkit is shipped with Fedora (i.e. after April 2012)
DISABLE_JBIG=1 \
V=1 \
CXXFLAGS="%{optflags} -fno-strict-aliasing" \
@@ -63,23 +90,24 @@ make %{?_smp_mflags}
%install
-# remove DISABLE_JBIG=1 once jbigkit is shipped with Fedora (i.e. after April 2012)
DISABLE_JBIG=1 \
+CUPSPPD=%{_datadir}/cups/model/splix \
DESTDIR=%{buildroot} \
make install
-
%files
%doc COPYING AUTHORS ChangeLog THANKS
%{_cups_serverbin}/filter/pstoqpdl
%{_cups_serverbin}/filter/rastertoqpdl
-%{_datadir}/cups/model/dell
-%{_datadir}/cups/model/lexmark
-%{_datadir}/cups/model/samsung
-%{_datadir}/cups/model/toshiba
-%{_datadir}/cups/model/xerox
+%{_datadir}/cups/model/splix/
%changelog
+* Wed Nov 30 2011 Jiri Popelka <jpopelka at redhat.com> - 2.0.1-0.6.20111121svn
+- Install splix PPDs into separate directory.
+- Added patch for compiling/installing DRVs instead of PPDs.
+ However we still ship only selected PPDs instead of DRVs as some printers
+ require JBIG1 support.
+
* Tue Nov 29 2011 Jiri Popelka <jpopelka at redhat.com> - 2.0.1-0.5.20111121svn
- Re-compile PPD files.
More information about the scm-commits
mailing list