diff -u brother-cups-wrapper-extra-1.2.1/debian/rules brother-cups-wrapper-extra-1.2.1/debian/rules --- brother-cups-wrapper-extra-1.2.1/debian/rules +++ brother-cups-wrapper-extra-1.2.1/debian/rules @@ -17,23 +17,108 @@ # Remove stuff that cause problems or outputs when brother scripts are used to create ppd files. cp usr/local/Brother/cupswrapper/* debian/tmp/scripts/ cp usr/local/Brother/Printer/*/cupswrapper/cupswrapper* debian/tmp/scripts/ - sed -i s_'/usr/local'_'/usr'_g debian/tmp/scripts/* - sed -i s/'ppd_file_name=\/usr'/'ppd_file_name=debian\/tmp\/usr'/g debian/tmp/scripts/* - sed -i s/'brotherlpdwrapper=\/usr'/'brotherlpdwrapper=debian\/tmp\/usr'/g debian/tmp/scripts/* - sed -i s/' echo "ERROR : Brother LPD filter is not installed."'/'echo ""'/ debian/tmp/scripts/* - sed -i s/'mkdir -p \/usr\/Brother\/filter'// debian/tmp/scripts/* - sed -i s/'mkdir -p \/usr\/lib\/cups\/filter'// debian/tmp/scripts/* - sed -i s/'chmod a+w'/'#chmod a+w'/g debian/tmp/scripts/* - sed -i s/'sleep 2s'// debian/tmp/scripts/* - sed -i s/'lpinfo -v'/'echo ""'/g debian/tmp/scripts/* - sed -i s/' cp $brotherlpdwrapper $brotherlpdwrapper64'// debian/tmp/scripts/* - sed -i '/^lpadmin/d' debian/tmp/scripts/* - sed -i s/'lib64'/'lib'/g debian/tmp/scripts/* - sed -i s/'\/etc\/init.d\/cups restart'/'echo ""'/g debian/tmp/scripts/* - sed -i s_'usr/share/cups/model'_'usr/share/ppd/Brother'_g debian/tmp/scripts/* + for i in debian/tmp/scripts/* ; do \ + sed -i s_'/usr/local'_'/usr'_g $$i ; \ + sed -i s/'ppd_file_name=\/usr'/'ppd_file_name=debian\/tmp\/usr'/g $$i ; \ + sed -i s/'brotherlpdwrapper=\/usr'/'brotherlpdwrapper=debian\/tmp\/usr'/g $$i ; \ + sed -i s/' echo "ERROR : Brother LPD filter is not installed."'/'echo ""'/ $$i ; \ + sed -i s/'mkdir -p \/usr\/Brother\/filter'// $$i ; \ + sed -i s/'mkdir -p \/usr\/lib\/cups\/filter'// $$i ; \ + sed -i s/'chmod a+w'/'#chmod a+w'/g $$i ; \ + sed -i s/'sleep 2s'// $$i ; \ + sed -i s/'lpinfo -v'/'echo ""'/g $$i ; \ + sed -i s/' cp $brotherlpdwrapper $brotherlpdwrapper64'// $$i ; \ + sed -i '/^lpadmin/d' $$i ; \ + sed -i s/'lib64'/'lib'/g $$i ; \ + sed -i s/'\/etc\/init.d\/cups restart'/'echo ""'/g $$i ; \ + sed -i s_'usr/share/cups/model'_'usr/share/ppd/Brother'_g $$i ; \ + done for i in `ls debian/tmp/scripts/` ; do \ ./debian/tmp/scripts/$$i ; \ done + ## Patch PPDs and brlpdwrapper-scripts + ## because the original drivers are not ideal (Launchpad Bug #206365) + for i in debian/tmp/usr/share/ppd/Brother/*.ppd ; do \ + # Most PPDs have bi-directional printing option in OrderDependency: 18 ; \ + # but a few have it in OrderDependency: 15 ; \ + sed -i '/OrderDependency: 18 AnySetup \*BRColorPaperThick/s/BRColorPaperThick/BRBiDir/g' $$i ; \ + sed -i '/OrderDependency: 15 AnySetup \*BRColorPaperThick/s/BRColorPaperThick/BRBiDir/g' $$i ; \ + # set higher resolution for photo quality and remove an unnecessary option for some older printers ; \ + sed -i '/S.Fine/d' $$i ; \ + sed -i 's_Photo/Photo: "< /dev/null ; \ + if test $$? -eq 1 ; then \ + # older printer modell with less settings ; \ + sed -i 's/set brcommands = ( \\/\set brcommands = ( \\\ + Resolution=Normal "-reso 300" \\\ + Resolution=Fine "-reso 600" \\\ + Resolution=Photo "-reso 1200" \\/g' $$i ; \ + else \ + # some more settings for newer printers ; \ + # to avoid problems with whitespaces DON'T INDENT THE FOLLOWING COMMAND! ; \ + sed -i 's/set brcommands = ( \\/\set brcommands = ( \\\ + Resolution=Fast0 "-reso 300 -md PLAIN -doc GRAPH" \\\ + Resolution=Normal0 "-reso 600 -md PLAIN -doc GRAPH" \\\ + Resolution=EnhNormal0 "-reso 750 -md PLAIN -doc GRAPH" \\\ + Resolution=Fine0 "-reso 1200 -md PLAIN -doc GRAPH" \\\ + Resolution=Fine1 "-reso 1200x600 -md INKJET -doc GRAPH" \\\ + Resolution=Photo1 "-reso 1200 -md INKJET -doc PHOTO" \\\ + Resolution=Fine2 "-reso 1200 -md GLOSSY -doc GRAPH" \\\ + Resolution=Photo2 "-reso 1200 -md GLOSSY -doc PHOTO" \\\ + Resolution=Highest2 "-reso 1200x6000 -md GLOSSY -doc PHOTO" \\\ + Resolution=Normal3 "-reso 600 -md TRANS" \\\ + Resolution=EnhNormal3 "-reso 750 -md TRANS" \\\ + Resolution=Fine3 "-reso 1200 -md TRANS" \\\ + Resolution=Fast4 "-reso 300 -md SLOWDRY" \\\ + Resolution=Normal4 "-reso 600 -md SLOWDRY" \\\ + Resolution=EnhNormal4 "-reso 750 -md SLOWDRY" \\\ + Resolution=Fine4 "-reso 1200 -md SLOWDRY" \\/g' $$i ; \ + fi \ + # align some expression with them in the PPD ; \ + sed -i 's/Bi-DirPrinting/BiDir/g' $$i ; \ + sed -i 's/MirrorPrint/Mirror/g' $$i ; \ + sed -i 's/PaperType/PageSize/g' $$i ; \ + sed -i 's/PaperThickness/PaperThick/g' $$i ; \ + sed -i 's/ColorOrMono/MonoColor/g' $$i ; \ + sed -i 's/HalfTone=/HalfTonePattern=/g' $$i ; \ + sed -i 's/ColorEnhance=/ColorEnhancement=/g' $$i ; \ + sed -i 's/RedKey/Red/g' $$i ; \ + sed -i 's/BlueKey/Blue/g' $$i ; \ + sed -i 's/GreenKey/Green/g' $$i ; \ + # paper format is misspelled ; \ + sed -i 's/Exective/Executive/g' $$i ; \ + # obviously a mistake in quality settings ; \ + sed -i 's/Highest2 "-reso 1200x600 -md GLOSSY -doc GRAPH"/Highest2 "-reso 1200x6000 -md GLOSSY -doc PHOTO"/g' $$i ; \ + # correction of misspelled *DefaultBRBrightness ; \ + sed -i 's/\*Default\*BRBrightness/*DefaultBRBrightness/g' $$i ; \ + # the 2nd occurence of "" has to include a tab ; \ + sed -i '/sed s\/" "\/\/g |sed s\/" "/s/" "/" "/2' $$i ; \ + # fix some mistakes to let the cupswrapper give valid arguments ; \ + sed -i 's/tr " " n/tr " " "\\n"/g' $$i ; \ + sed -i '/grep $$brcommands/s/grep/grep -i/g' $$i ; \ + sed -i 's/sed s\/"$$brcommands2/sed s\/"BR""$$brcommands2/g' $$i ; \ + done + ## End patching PPDs and brlpdwrapper-scripts cp -R usr/local/Brother/Printer/* debian/tmp/usr/Brother/Printer/ rm debian/tmp/usr/Brother/Printer/*/cupswrapper/* for i in `ls debian/tmp/usr/Brother/Printer/` ; do \ diff -u brother-cups-wrapper-extra-1.2.1/debian/changelog brother-cups-wrapper-extra-1.2.1/debian/changelog --- brother-cups-wrapper-extra-1.2.1/debian/changelog +++ brother-cups-wrapper-extra-1.2.1/debian/changelog @@ -1,3 +1,9 @@ +brother-cups-wrapper-extra (1.2.1-0ubuntu3) intrepid; urgency=low + + * debian/rules: Fix PPD files and brlpdwrapper* scripts. (LP: #206365) + + -- Dominic Lyons Sat, 24 May 2008 16:21:32 +0100 + brother-cups-wrapper-extra (1.2.1-0ubuntu2) intrepid; urgency=low * debian/control: Change "provide" to "provides" (LP: #229346).